Quantcast
Channel: SharpDevelop Community
Viewing all articles
Browse latest Browse all 1764

WinForms editor and unmanaged dll

$
0
0

Hi,

whenever I add an unmanaged DLL reference to my WinForms C# project I'm getting errors when trying to add new controls to my application form. I'm using SharpDevelop 4.1.0.8000 (but earlier versions are affected as well.

Here is a description on how to reproduce the issue:

1. Create a new .NET 3.5 C# windows application project.

2. Change the C# compiler to version 3.0 otherwise you'll get errors about "tracker.exe" cannot be found.

3. Add a reference to an unmanaged DLL to the project, e.g. kernel32.dll.

4. Add a button to the application form.

5. Compile & run the project to verify that everything works, then close the running project.

6. Exit SharpDevelop

7. Start SharpDevelop and open the project

8. Go to the WinForms editor tab and try to add another component, e.g. a checkbox

9. You should now see an error message like this:

"System.BadImageFormatException: Could not load file or assembly 'kernel32.dll' or one of its dependencies. The module was expected to contain an assembly manifest. ..."

10. After clicking on "Ok" to close the error message dialog the forms editor hangs in an endless loop, showing a "work in progress" mouse pointer. Clicking the left mouse button on the form just adds another checkbox and then showing the error message again, and so on, and so on.

The only way to get back to a sane state is to close SharpDevelop saving the changes and restart it again.

Best regards,

Bernd.

 

 


Viewing all articles
Browse latest Browse all 1764

Trending Articles