Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when loading plugin #2

Open
markknol opened this issue Jan 26, 2016 · 20 comments
Open

Error when loading plugin #2

markknol opened this issue Jan 26, 2016 · 20 comments

Comments

@markknol
Copy link

I try to create own plugin. I renamed everything that's called sampleplugin, added own guid. and compiled it (that works 馃槃 ) 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 2308614 , but I cannot figure out what needs to be done to fix it.

Any hint?

@skial
Copy link
Owner

skial commented Jan 26, 2016

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.

@markknol
Copy link
Author

When compiling using build.xml I seem to miss the resgen.exe file. I maybe need to install something.

@skial
Copy link
Owner

skial commented Jan 26, 2016

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.

@skial skial closed this as completed Jan 26, 2016
@skial skial reopened this Jan 26, 2016
@markknol
Copy link
Author

For some reason this installer don't let me install the sdk. Kinda stuck here.

image

@skial
Copy link
Owner

skial commented Jan 26, 2016

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??

@markknol
Copy link
Author

(Oh, hey, I don't even have visual studio installed 馃槷 )

@skial
Copy link
Owner

skial commented Jan 26, 2016

馃榿

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.

@markknol
Copy link
Author

I now have vs community edition installed, but the build.hxml now complains about missing parameters

image

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;
image

@skial
Copy link
Owner

skial commented Jan 26, 2016

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.

@skial
Copy link
Owner

skial commented Jan 26, 2016

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. 馃槮

@markknol
Copy link
Author

hey it works! It opens the plugin 馃槃

@skial
Copy link
Owner

skial commented Jan 26, 2016

Yay!

@skial skial closed this as completed Jan 27, 2016
@skial skial reopened this Jan 27, 2016
@skial
Copy link
Owner

skial commented Jan 27, 2016

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 馃槈. You will also need to install my fork of hxcs.

@markknol
Copy link
Author

Hey I installed the git hxcs and pulled fresh copy of the repository. I compiled and tested; it works. Nice! 馃槃

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.

@markknol
Copy link
Author

btw I assume this git dependency will not be needed in future right?

@skial
Copy link
Owner

skial commented Jan 27, 2016

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.

@skial
Copy link
Owner

skial commented Jan 27, 2016

Hey I installed the git hxcs and pulled fresh copy of the repository. I compiled and tested; it works. Nice! 馃槃

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.

@skial
Copy link
Owner

skial commented Jan 28, 2016

@markknol Turns out that the dll being generated as Main.dll is simply based on the entry files name.

@markknol
Copy link
Author

Nice, then you need $(ProjectName).hx.template instead of Main.hx (and point to that as main class) 馃槈

@skial
Copy link
Owner

skial commented Feb 10, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants