Runtime Error when using 'netload' in Command Line, ACAD 2010

Runtime Error when using 'netload' in Command Line, ACAD 2010

Anonymous
Not applicable
5,400 Views
9 Replies
Message 1 of 10

Runtime Error when using 'netload' in Command Line, ACAD 2010

Anonymous
Not applicable
Hello,

Can anyone shed some light on this error message? The loaded file is a .dll written in Visual Basic.NET using Visual Studio 2010.

NETLOAD Cannot load assembly. Error details: System.BadImageFormatException:
Could not load file or assembly 'file:///C:\Documents and Settings\dan\My
Documents\Visual Studio
10\Projects\ClassLibrary1\ClassLibrary1\obj\x86\Release\ClassLibrary1.dll' or
one of its dependencies. This assembly is built by a runtime newer than the
currently loaded runtime and cannot be loaded.

THX,
Dan M.
0 Likes
5,401 Views
9 Replies
Replies (9)
Message 2 of 10

Anonymous
Not applicable
Hi Dan,

You are far more likely to find expertise about .NET programming in the
.NET newsgroup compared with here which is a newsgroup for VBA and by
implication VB6.


Regards,


Laurie Comerford

dan.mcrae wrote:
> Hello,
>
> Can anyone shed some light on this error message? The loaded file is a .dll written in Visual Basic.NET using Visual Studio 2010.
>
> NETLOAD Cannot load assembly. Error details: System.BadImageFormatException:
> Could not load file or assembly 'file:///C:\Documents and Settings\dan\My
> Documents\Visual Studio
> 10\Projects\ClassLibrary1\ClassLibrary1\obj\x86\Release\ClassLibrary1.dll' or
> one of its dependencies. This assembly is built by a runtime newer than the
> currently loaded runtime and cannot be loaded.
>
> THX,
> Dan M.
0 Likes
Message 3 of 10

Anonymous
Not applicable
You can't use Visual Studio 2010 to build AutoCAD .NET applications, unless
you set the target runtime to .NET 3.5, in your project settings.

Also, pay no attention to the resident dunce told you.

This newsgroup is for ActiveX API issues, regardless of what language is
being used.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:[email protected]...
Hello,

Can anyone shed some light on this error message? The loaded file is a .dll
written in Visual Basic.NET using Visual Studio 2010.

NETLOAD Cannot load assembly. Error details: System.BadImageFormatException:
Could not load file or assembly 'file:///C:\Documents and Settings\dan\My
Documents\Visual Studio
10\Projects\ClassLibrary1\ClassLibrary1\obj\x86\Release\ClassLibrary1.dll'
or
one of its dependencies. This assembly is built by a runtime newer than the
currently loaded runtime and cannot be loaded.

THX,
Dan M.
0 Likes
Message 4 of 10

Anonymous
Not applicable
Hi Tony,

I presume you are referring to my post since there aren't any others.

Every time this issue is raised you repeat the same ridiculous advice
based on an inability to read the names of the newsgroups and the other
reality that the expertise for .NET questions is far more likely to be
found in the .NET newsgroup than in a VBA newsgroup.

VBA programmers don't even need to know the significance of the
different .NET programming paradigms which you use to tell people to
write to the wrong newsgroup because these issues don't exist in VBA.

To illustrate the warrant for your distorted viewpoint you should be
able to point to answers to .NET questions in this newsgroup which have
been provided by posters who don't read the .NET newsgroup. Knowing you
won't be able to, I await your usual abuse as a reply.

Go back to your psychiatrist and get some help.



Regards,


Laurie Comerford




Tony Tanzillo wrote:
> You can't use Visual Studio 2010 to build AutoCAD .NET applications, unless
> you set the target runtime to .NET 3.5, in your project settings.
>
> Also, pay no attention to the resident dunce told you.
>
> This newsgroup is for ActiveX API issues, regardless of what language is
> being used.
>
0 Likes
Message 5 of 10

Anonymous
Not applicable
I don't even bother reading your posts, because you
don't have the slightest idea what you're talking about,
as you have proven hundreds of times over.

Get lost.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

"Laurie" wrote in message
news:[email protected]...
Hi Tony,

I presume you are referring to my post since there aren't any others.

Every time this issue is raised you repeat the same ridiculous advice
based on an inability to read the names of the newsgroups and the other
reality that the expertise for .NET questions is far more likely to be
found in the .NET newsgroup than in a VBA newsgroup.

VBA programmers don't even need to know the significance of the
different .NET programming paradigms which you use to tell people to
write to the wrong newsgroup because these issues don't exist in VBA.

To illustrate the warrant for your distorted viewpoint you should be
able to point to answers to .NET questions in this newsgroup which have
been provided by posters who don't read the .NET newsgroup. Knowing you
won't be able to, I await your usual abuse as a reply.

Go back to your psychiatrist and get some help.



Regards,


Laurie Comerford




Tony Tanzillo wrote:
> You can't use Visual Studio 2010 to build AutoCAD .NET applications,
> unless
> you set the target runtime to .NET 3.5, in your project settings.
>
> Also, pay no attention to the resident dunce told you.
>
> This newsgroup is for ActiveX API issues, regardless of what language is
> being used.
>
0 Likes
Message 6 of 10

Anonymous
Not applicable

Tony,

I have the same issue.

Could you tell me where to find the setting to change runtime version in VS 2010.?

 

Thanx,

Matej

 

 

Tony Tanzillo wrote:
> You can't use Visual Studio 2010 to build AutoCAD .NET applications, unless
> you set the target runtime to .NET 3.5, in your project settings.

0 Likes
Message 7 of 10

norman.yuan
Mentor
Mentor

VS2010 can be used to target .NET 2.0/3.0/3.5/4.0 framework.

 

Go to your project->Properties. In "Compile" tab (assume you use VB.NET), click "Advanced Compile Options..." button. In the dialog box, you'll find "Target framework" dropdown list.

 

If you use AutoCAD2007 to 2011, usually, you can target .NET3.5. With Acad 2010, you can also target .NET4.0 with some setting configured in acad.exe.config. But targeting .NET3.x would be safer bet.

 

By the way, this kind of question would be better posted in .NET forum as Laurie suggested. This forum is mainly for COM API. If you searched .NET forum, you would have found the answer already.

 

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 8 of 10

Anonymous
Not applicable

Thank you, Norman - now it works great!!

 

The reason I posted here was that the google search directed me here.. thanx for the suggestion, anyways.

 

0 Likes
Message 9 of 10

kylei7449
Enthusiast
Enthusiast

Thanks so much! I know this is an old post, but your solution of changing to 3.5 worked. Thx.

 

>VS2010 can be used to target .NET 2.0/3.0/3.5/4.0 framework.

 

>Go to your project->Properties. In "Compile" tab (assume you use VB.NET), click "Advanced Compile Options..." >button. In the dialog box, you'll find "Target framework" dropdown list.

 

>>If you use AutoCAD2007 to 2011, usually, you can target .NET3.5. With Acad 2010, you can also target .NET4.0 with some setting configured in acad.exe.config. But targeting .NET3.x would be safer bet.

 

>By the way, this kind of question would be better posted in .NET forum as Laurie suggested. This forum is mainly for >COM API. If you searched .NET forum, you would have found the answer already.

0 Likes
Message 10 of 10

Anonymous
Not applicable

I assume you are running the project sample.

 

To get AutoCAD .NET running with AutoCAD 2010 you need to change the build to 3.5  ,NET

4.0 doesn't work.

Also, you need to make sure 3.5 is installed by looking in REGEDIT

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5 example

 

For Visual Studio Express 2013.

 

Make sure //using System.Threading.Tasks; is commented out since that's for later version of .NET?

 

On Solution Explorer window, right click on reference and delete csharp

 

Add the DLL of acdbmgd and acmgd only, core is not available.

 

Right click on these references and make sure Copy Local is false

 

 

Under Build, go to Configuration Manager and create a new configuration for x64 - 64 bits

 

 

When building there should be no warnings at all about AMD or anything else

 

Right click on your project in solutions explorer and click properties

 

Make sure platform is still x64

 

Under application tab, make sure target framework is .NET Framework 3.5

 

Build solution...

 

Go to C:\Program Files\Autodesk\ACADM 2010\acad.exe.config file

and open in notepad

 

make sure the following code is uncommented

<supportedRuntime version="v3.5"/>

 

Go to AutoCAD

 

run netload

 

select you DLL

and type AdskGreeting

 

And view extents to see greeting

 

autocad2010net35.jpg

 

 

 

 

 

 

 

0 Likes