AbelCam Forum
Download AbelCam buy Pro
 
 
 
Welcome Anonymous User
11/22/2024 - 04:56 PM
Quick Search:
Quick Jump:
 
Announcements
Latest Topics
 
Sample Plugin Documentation
By: DougLu
Rank: Newbie
Topics: 4
From: Canada
Added: 01/20/2011 - 03:28 AM

Is there any additional documentation on the SamplePlugin install. I've set up a pic microprocessor and have it communicating with the X10 plugin', and would now like to wrap my head around the Plugin side. I've compiled and installed the sampleplugin dll in the plugin/web folder but it does not show up on the plugin list. I assume there are variables which need to be set (configpath, dllpath) but I'm not sure where. I'm new to C# but luckily it's close enough to C++ that I can find my way around. Any help is greatly appreciated.
By: sse
Rank: Forum Addict
Topics: 73
From: n/a
Added: 01/20/2011 - 04:50 AM

Doug, if you enable the Debug Info, the debug log will contain information about the plugins found on startup.

Remove all but the sample plugin and your own new plugin from the plugin folder and you should be able to find out why your plugin is not detected the way it should.

Here's an example of what you should see in the log file
08:30:36 Analyzing C:\Program Files (x86)\AbelCam\Plugin\Web\SamplePlugin.dll 
08:30:36 Interface Name matches: AbelCam.IWebPlugin, analyzing Methods: 
08:30:36 interfaceVersion() 
08:30:36 Plugin Method interfaceVersion ok
...
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 01/20/2011 - 07:55 AM

Author of X10 Plugins here...

Those variables (configpath, dllpath) you asked about: you don't need to set them. Look at the startPlugin method - when AbelCam calls that method to start your code it gives you the values in the arguments. IOW AbelCam tells you "where you live" (dllpath) and where the configs are stored (configpath).

I can't actually think of a reason for the sample plugin to not show up in the list. All I ever do is build (for Release, not Debug) from inside the C# IDE and then copy the .dll over to AbelCam\Plugin\Web and the next time I launch AbelCam it picks it up in the list. In fact, I just tested by doing exactly that using an unmodified copy of the Sample Plugin source dated 8/27/2008 and it worked fine. I'm on XP Pro SP-3 here using Visual Studio 2008.

By: DougLu
Rank: Newbie
Topics: 4
From: Canada
Added: 01/20/2011 - 12:14 PM

Thanks for the replies. I turned on the debug listing as suggested and found the following message:

05:57:08 Load Assembly Error Could not load file or assembly 'file:///C:\Program Files\AbelCam\Plugin\Web\SamplePlugin.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

I am using Visual Studio 2010.
By: DougLu
Rank: Newbie
Topics: 4
From: Canada
Added: 01/20/2011 - 12:38 PM

The problem appears to be with changes in the VS2010 runtime.
I re-compiled with VS2008 and it works fine.

Thanks again.
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 01/20/2011 - 04:14 PM

Hmmmm... what version of AbelCam are you running? I would THINK anything >= 4.0.5 would have handled a plugin compiled with VS2010 just fine. If that's not the case there are a few of us that would like to know about it...
By: sse
Rank: Forum Addict
Topics: 73
From: n/a
Added: 01/20/2011 - 04:38 PM

It's not the version of Visual Studio that matters, but the version of the .NET framework used in the project.
I'm using .NET 3.5 for AbelCam, which uses the same Common Language Runtime as 2.0.
-> any plugin compiled for 2.0, 3.0 or 3.5 should run in AbelCam

VS2010 uses .NET 4.0 by default which has a different CLR.
By: DougLu
Rank: Newbie
Topics: 4
From: Canada
Added: 01/21/2011 - 01:58 AM

OK... Just to verify I ran the following tests using VS 2010
I compiled with .NET 4. The Plugin was not recognized in Abel Cam.
I changed the Property -> target framework to 3.5 and the Plugin was recognized.
So... as stated above in SSE's reply, the .NET version is the key.
By: MelvinG
Rank: Magna Cum Laude
Topics: 661
From: Los Angeles, USA
Added: 01/21/2011 - 11:22 AM

SSE and Doug... thanks for the clarification and follow-up! Makes perfect sense now. Obviously I haven't recompiled any of my plugins lately Wink