It is currently April 25th, 2024, 2:32 pm

Sample C# plugin crashes RM

Share and get help with Plugins and Addons
Xandr
Posts: 3
Joined: November 19th, 2016, 11:20 pm

Sample C# plugin crashes RM

Post by Xandr »

Hello everyone,

Today I decided to give self-written plugins a try and suddenly ran into a problem with that canvas on "Developers" page. I just downloaded it, did steps mentioned (renamed, created GUID), built it as x64 Release and created a simple plugin measure referencing it . And booom - RM crashed with
Plugin: Unable to load "" (error 126)
in log. Exactly like this, with no dll name at all.

How can it be fixed?
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Sample C# plugin crashes RM

Post by jsmorley »

Xandr wrote:Hello everyone,

Today I decided to give self-written plugins a try and suddenly ran into a problem with that canvas on "Developers" page. I just downloaded it, did steps mentioned (renamed, created GUID), built it as x64 Release and created a simple plugin measure referencing it . And booom - RM crashed with in log. Exactly like this, with no dll name at all.

How can it be fixed?
Make sure you are using Microsoft Visual Studio 2015 with all the latest updates.

https://www.visualstudio.com/downloads/download-visual-studio-vs

for C# (.NET) be sure you have .NET 2.0 installed (in addition to any newer ones you might want to use)

http://www.microsoft.com/en-us/download/details.aspx?id=21
Xandr
Posts: 3
Joined: November 19th, 2016, 11:20 pm

Re: Sample C# plugin crashes RM

Post by Xandr »

Make sure you are using Microsoft Visual Studio 2015 with all the latest updates.
Check
for C# (.NET) be sure you have .NET 2.0 installed (in addition to any newer ones you might want to use)
Check
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Sample C# plugin crashes RM

Post by jsmorley »

Xandr wrote:Check


Check
Well then... I don't know. Error 126 is generally a Runtime library issue of one kind or another. The root of it is usually calling a library function that it can't find.
Xandr
Posts: 3
Joined: November 19th, 2016, 11:20 pm

Re: Sample C# plugin crashes RM

Post by Xandr »

jsmorley wrote:Well then... I don't know. Error 126 is generally a Runtime library issue of one kind or another. The root of it is usually calling a library function that it can't find.
Im really concerned about that empty string, since its usually is bad dll name. Of course it will be runtime panic if you try to load dll with no name, but how can this attempt happen?
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Sample C# plugin crashes RM

Post by jsmorley »

I'm really not sure, but then I'm not particularly an expert in C#.

If it were me. I would start over in a sense. Download the .zip of the Plugin SDK from https://github.com/rainmeter/rainmeter-plugin-sdk (or create a repo on your hard drive with a fork of it with Git)

Load the C# project .sln and build PluginEmpty (a very basic example plugin). Take the 64bit version of that .dll from X64\Release and put it in %APPDATA%\Rainmeter\Plugins.

Restart Rainmeter and see if the plugin works ok with no errors. Create a test skin that uses it. As is, it doesn't return anything really, just 0.0 (number) and "" (string). But what we are going for here is no errors. Feel free to change it to return 49 and "Hello World" if you want.

That should give you some confidence (or not) about your "environment". From there, I'm afraid you are on your own.