I've been successful in writing a Rainmeter plugin completely in C#.
There are two caveats:
(1) the code must be compiled 'unsafe' (dealing with pointers at the moment)
(2) it must be disassembled using ildasm.exe (.NET SDK utility), modified to export the public class members for stdcall and corflags update, and then reassembled using ilasm.exe (.NET base runtime utility).
I wrote a utility that does (2) and is completely automated, so I just include that as a build step. It works with both Rainmeter x86 and Rainmeter x64 (but you need a separate plugin compiled for each). I've tested with Update() and GetString() members and they're both passing data back and forth just fine.
I'm going to be cleaning up some code and preparing a template and a utility class -- anyone interested in this?
It is currently April 20th, 2024, 3:57 pm
Plugin development in C#: success
-
- Developer
- Posts: 30
- Joined: December 2nd, 2010, 1:56 pm
- Location: Meridian, ID, USA
-
- Developer
- Posts: 98
- Joined: August 6th, 2009, 3:03 pm
Re: Plugin development in C#: success
Yeah, that sounds pretty nice. Definitely would be useful, much easier to write .NET plugins.
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Plugin development in C#: success
He's got it working nice. He is putting some coats of polish on a "tempate" and might have something soon.MattKing wrote:Yeah, that sounds pretty nice. Definitely would be useful, much easier to write .NET plugins.
I installed VC# Express 2010 and compiled a new plugin in C# that worked fine with Rainmeter. I wet myself a little.
-
- Developer
- Posts: 30
- Joined: December 2nd, 2010, 1:56 pm
- Location: Meridian, ID, USA
Re: Plugin development in C#: success
... my work here is done.jsmorley wrote:I wet myself a little.
-
- Developer
- Posts: 2872
- Joined: April 17th, 2009, 12:18 pm
Re: Plugin development in C#: success
Likewise.jsmorley wrote:I wet myself a little.
-
- Posts: 1
- Joined: January 17th, 2011, 4:59 pm
Re: Plugin development in C#: success
C# developing tool will be just great. So, thumbs up and i'm looking forward to it (:
-
- Developer
- Posts: 30
- Joined: December 2nd, 2010, 1:56 pm
- Location: Meridian, ID, USA
Re: Plugin development in C#: success
It's live -- been in the beta builds and SVN for a bit over a month now. Download and enjoy.
-
- Posts: 4
- Joined: December 16th, 2010, 10:45 pm
Re: Plugin development in C#: success
Will this work for .NET 4.0 plugins in the future?
Building InputText against .NET 4.0 seems to work fine after fixing the references and enabling mscorlib.dll, but Rainmeter crashes with an unspecified error when I switch the libs in the Plugins folder (x64 version, in case that matters).
Building InputText against .NET 4.0 seems to work fine after fixing the references and enabling mscorlib.dll, but Rainmeter crashes with an unspecified error when I switch the libs in the Plugins folder (x64 version, in case that matters).
-
- Developer
- Posts: 30
- Joined: December 2nd, 2010, 1:56 pm
- Location: Meridian, ID, USA
Re: Plugin development in C#: success
It works for 4.0, but you shouldn't enable mscorlib.dll automatic referencing. It was specifically excluded due to target platform incompatibilities (which is why you're crashing). Force the compiler to late bind and remove that reference. Then the plugin source should compile against .NET 2.0 and above (including 4.0).
-
- Posts: 4
- Joined: December 16th, 2010, 10:45 pm
Re: Plugin development in C#: success
If I want late-binding, do I have to replace all mscorlib types with dynamic? What I want to do is getting access to the new libraries added in later versions of the runtime...
Sorry if this is a noob question, I'm not very experienced when it comes to mixing runtimes
Sorry if this is a noob question, I'm not very experienced when it comes to mixing runtimes