Using spidermonkey-dotnet in Class Libraries/Web Apps

May 5, 2011 at 2:40 AM

Hi,

I realise this isn't specifically a spidermonkey issue, but hoping someone may have a solution.

I'm succesfully using smnet, within an *application*, to execute JS code include E4X. The E4X code I'm using unfortunately limits the choice of interpreters/engines that I can use (i.e. doesn't work with Jint etc.)

I added MSVCR90.DLL to the manifest of the application to get this to work ok. I now have the requirement to use this within a class library. The code compiles fine, but class libraries do not use manifest files (as in the sort automatically used within VS), so it keeps crashing trying to load js32.dll (because it can't load MSVCR90.dll). I've tried manually adding a manifest to the class library / webapp at resource #2 using MT.exe, but this doesn't seem to help either?

Unfortunately this is one of the areas, when researched on the web, things go round and round in circles with no real solution :-(

Any ideas?

Thanks.

Developer
Jun 5, 2011 at 10:43 PM
Edited Jun 22, 2011 at 9:49 PM

Sorry about the late reply.

I think this is due in part to the compiler used to compile the js32.dll library. As I used mozilla-build and the vc9.0 batch file to compile the js32 source files it requires the VC9.0 runtime to be loaded. You may be able to alleviate this problem by using a different compiler (or compiled binary) for the js32.dll.

Hope this helps.

[EDIT] I have started a C++/CLI binding  for the project to make migrating to spidermonkey 1.8.5 a little bit easier. API's, macros, and conversion routines have changed significantly, and a project written in C# wouldn't have been able to embed it properly. An interesting side-effect to using the C++/CLI binding is that you don't explicitly need to tell the CLR you need the C Runtimes. They are loaded along with the library