TheSwamp

Code Red => .NET => Topic started by: csharpbird on October 22, 2009, 02:41:53 AM

Title: Cannot netload dll from C# 4.0
Post by: csharpbird on October 22, 2009, 02:41:53 AM
It seems that we cannot use the latest visual studio 2010 in AutoCAD.
When I netload the dll compiled by Visual studio 2010,I get the following error message:System.BadImageFormatException.
Title: Re: Cannot netload dll from C# 4.0
Post by: Glenn R on October 22, 2009, 05:08:37 AM
Is your 2010's config set to use a specific framework version?
Title: Re: Cannot netload dll from C# 4.0
Post by: It's Alive! on October 22, 2009, 06:53:27 AM
 yep, looks like it's broke.  :-(
Title: Re: Cannot netload dll from C# 4.0
Post by: csharpbird on October 22, 2009, 06:55:41 AM
When I load a DLL using "NetLoad" command, I get the following error message:
Cannot load assembly. Error details: System.BadImageFormatException: Could not
load file or assembly 'file:///E:\Users\Administrator\Documents\Visual Studio
2010\Projects\ClassLibrary1\ClassLibrary1\bin\Debug\ClassLibrary1.dll' or one
of its dependencies. This assembly is built by a runtime newer than the
currently loaded runtime and cannot be loaded.
Title: Re: Cannot netload dll from C# 4.0
Post by: csharpbird on October 22, 2009, 08:58:27 AM
But AU 2009 will have the class "Using .NET 4.0 with AutoCADŽ".(http://au.autodesk.com/?nd=e_class&session_id=5164)

Class Description
Learn how you can use new features of version 4.0 of the .NET framework to create customizations for AutoCAD even easier than before. See how the Dynamic Language Runtime (DLR) and Languge Integrated Query (LINQ) enables experimentation and productivity without sacrificing (too much) performance.

Title: Re: Cannot netload dll from C# 4.0
Post by: It's Alive! on October 22, 2009, 10:38:54 AM
When I load a DLL using "NetLoad" command, I get the following error message:
Cannot load assembly. Error details: System.BadImageFormatException: Could not
load file or assembly 'file:///E:\Users\Administrator\Documents\Visual Studio
2010\Projects\ClassLibrary1\ClassLibrary1\bin\Debug\ClassLibrary1.dll' or one
of its dependencies. This assembly is built by a runtime newer than the
currently loaded runtime and cannot be loaded.

Same here, with VS2010 beta 1, I was able to goof with the acad.exe.config file to get the modules to load, not so with beta 2.
Title: Re: Cannot netload dll from C# 4.0
Post by: mohnston on October 23, 2009, 02:15:31 PM
But AU 2009 will have the class "Using .NET 4.0 with AutoCADŽ".(http://au.autodesk.com/?nd=e_class&session_id=5164)

Class Description
Learn how you can use new features of version 4.0 of the .NET framework to create customizations for AutoCAD even easier than before. See how the Dynamic Language Runtime (DLR) and Languge Integrated Query (LINQ) enables experimentation and productivity without sacrificing (too much) performance.
I'm noticed that session. Since I get to go this year I signed up for it. Stay tuned.
Title: Re: Cannot netload dll from C# 4.0
Post by: sinc on October 24, 2009, 11:15:09 AM
Unless that class gets pulled because the instructor discovers nothing works with VS 2010 Beta 2...   :lol: