Posted by Giedrius in Plugin Development on Jan 28 2008, 06:49 am

i have plugin written in c# and i have problem loading it. If i'm choosing plugin in plugins tab, and run application everything goes ok, but if i'm trying to load it like this (for debug support in visual studio):

ssCore.Plugin.loadFromFolder({plugin:"CallDLL", alias:"CallDLL", path:"startdir://"}, {callback:"result_plugin", scope:_level0});
_level0.result_plugin = function(return_obj, callback_obj, error_obj) 
   if (return_obj.success) 
      ssDebug.trace("ERROR - " + callback_obj.callback+" : "+error_obj.description);    

i'm getting error
ERROR - result_plugin : LoadLibrary failed while attempting to load the plugin.

Posted by Giedrius in Plugin Development on Jan 28 2008, 09:45 am

it's kind of urgent, so any help appreciated.
if needed, i could send dll source and sample northcode application

Posted by Dan in Plugin Development on Jan 29 2008, 11:37 am

There is indeed a procedure for debugging a .NET plugin using loadFromFolder. I'll start off by admitting that it might seem a little clunky, but we're working on improving it.

First off, SWF Studio automatically includes support for the .NET plugins whenever you generate an EXE that includes a .NET plugin in the plugins tab. In your case, you're probably not doing this, so you will need to either include some dummy .NET plugin in your project, or better yet, add the following 3 files to the Files tab: NetPlugin.dll, NetShim.dll, and xshim.exe. Make sure these are marked for "Auto Extract" (the default). These file can be found in the SWF Studio folder, which is typically C:\Program Files\Northcode\Studio3

Secondly, because your plugin gets loaded indirectly by the EXE, through xshim.exe, you will need to run your application and then attach to the xshim.exe process.

Posted by Giedrius in Plugin Development on Jan 30 2008, 02:57 am

Great, that worked like a charm. I think you should place this info in .net sdk folder's readme.rtf file.

Posted by northcode in Plugin Development on Jan 30 2008, 09:55 am

We had that same thought :)