Error when loading plugin
I try to create own plugin. I renamed everything that's called sampleplugin, added own guid. and compiled it (that works :smile: ) But when loading I get this error:
Could not load file or assembly 'file:///C:\xxxxx\AppData\Local\HaxeDevelop\Plugins\MyPlugin.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
I see you solved it already here https://github.com/skial/FD_SamplePlugin/commit/2308614a8ff5e09a898dfda08de7c0afc1cc8bb2 , but I cannot figure out what needs to be done to fix it.
Any hint?
I think that error was related to using .net framework 4 or the dll file containing duplicate references to other dll files. FlashDevelop plugins should build with .net 2+. I use 3.5 in my build.hxml, pointing -D csc to C:\Windows\Microsoft.NET\Framework\v3.5\csc.exe .
Ignore the FD_SamplePlugin.hxml, it ended up just being used for autocompletion.
I found ILSpy really useful to peek into the compiled dll file to make sure what version of .net built the file and other info.
When compiling using build.xml I seem to miss the resgen.exe file. I maybe need to install something.
I unfortunately didn't download anything secific for this project, I must have downloaded it awhile ago :/. I think resgen is part of the windows sdk.
For some reason this installer don't let me install the sdk. Kinda stuck here.

I've been looking around to see how I might have "installed" all the dependencies. If you have visual studio 2015 community edition installed, there is an option when installing or modifying (through add and remove programs) to install the Windows 10 sdk.
This might work on previous editions of visual studio as well??
(Oh, hey, I don't even have visual studio installed :open_mouth: )
:grin:
When I get some spare time, I'll see if my laptop is able to build this and try to record everything needed to set it up.
I now have vs community edition installed, but the build.hxml now complains about missing parameters

update: I changed the lines to:
//line 88
var resgen_proc = new Process('$_resgen', ['$output/src/Resources/en_US.resX']);
//line 116:
var csc_proc = new Process( '$_csc' , csc_args );
But now i have this error;

Hey @markknol,
I've pushed an update that works on a fresh install of visual studio and haxe 3.2.1. I forgot that I was a git build of haxe while figuring this all out. Sorry!. There has been an api change to Process.hx at some point.
I've, hopefully have also fixed the cs2021 error.
Scratch the Process.hx change rubbish, I've just tried it on a git build of Haxe and it works with the recent commit I've made. :frowning:
hey it works! It opens the plugin :smile:
Yay!
Hey @markknol,
I've being looking through @waneck hxcs and figured out how to start replacing build/Tool.hx with it, would you be able to try out the latest changes?
The only file thats really changed is build.hxml, so just make sure all the paths are correct for you :wink:. You will also need to install my fork of hxcs.
Hey I installed the git hxcs and pulled fresh copy of the repository. I compiled and tested; it works. Nice! :smile:
The only annoying thing is that it compiles to Main.dll, while you want it to be named something like SamplePlugin.dll, not sure if that is doable.
btw I assume this git dependency will not be needed in future right?
Hopefully it won't be needed. If for whatever reason it cant be merged into hxcs, then a macro tool to do the same job can be written.
Hey I installed the git hxcs and pulled fresh copy of the repository. I compiled and tested; it works. Nice! :smile:
The only annoying thing is that it compiles to Main.dll, while you want it to be named something like SamplePlugin.dll, not sure if that is doable.
Brilliant, thanks for trying it out. Yep, I'll look into the name issue.
@markknol Turns out that the dll being generated as Main.dll is simply based on the entry files name.
Nice, then you need $(ProjectName).hx.template instead of Main.hx (and point to that as main class) :wink:
btw I assume this git dependency will not be needed in future right?
Just an update, there is a pull request to hxcs that will hopefully remove the git dependency, once its reviewed.