.NET

.NET

Reply
*Jim Dowthwaite
Message 1 of 4 (119 Views)

Frustrated VB user moving to .Net looking for a bit of help!

119 Views, 3 Replies
09-23-2005 01:37 PM
Ok, I've been trying to get a couple of the labs posted here working on my
machine with ACAD2006 and VB.Net 2005 Express Beta 2. I notices something
about the acad.exe.config file in an earlier post but I couldn't figure out
if I had to change something there for VS 2005.

The dll compiles fine but when I try to load the file with NETLOAD I get the
following error in AutoCAD, any Ideas what I'm missing?:

Command: NETLOAD
Cannot load assembly. Error details: System.BadImageFormatException: The
format
of the file 'Lab1.dll' is invalid.
File name: "Lab1.dll"
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase,
Boolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound,
Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Boolean
stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence
securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
at loadmgd()

=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:\Documents and Settings\jim\My
Documents\Visual Studio 2005\Projects\Lab1\Lab1\bin\Release\Lab1.dll
LOG: Appbase = C:\Program Files\Autodesk\Acade 2006\
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===

LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Documents and Settings/jim/My
Documents/Visual Studio 2005/Projects/Lab1/Lab1/bin/Release/Lab1.dll.
*Albert Szilvasy
Message 2 of 4 (119 Views)

Re: Frustrated VB user moving to .Net looking for a bit of help!

09-23-2005 08:15 PM in reply to: *Jim Dowthwaite
Apperently you did change acad.exe.config. The error indicates that you are
trying to load an assembly compiled for .NET 2.0 while running AutoCAD on
the .NET 1.1 framework. If you want to load .NET 2.0 assemblies then you
must allow AutoCAD to load the .NET 2.0 framework. You can do this by either
not having an acad.exe.config file or using the original.

albert

"Jim Dowthwaite" wrote in message
news:4965990@discussion.autodesk.com...
Ok, I've been trying to get a couple of the labs posted here working on my
machine with ACAD2006 and VB.Net 2005 Express Beta 2. I notices something
about the acad.exe.config file in an earlier post but I couldn't figure out
if I had to change something there for VS 2005.

The dll compiles fine but when I try to load the file with NETLOAD I get the
following error in AutoCAD, any Ideas what I'm missing?:

Command: NETLOAD
Cannot load assembly. Error details: System.BadImageFormatException: The
format
of the file 'Lab1.dll' is invalid.
File name: "Lab1.dll"
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase,
Boolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound,
Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Boolean
stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence
securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
at loadmgd()

=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:\Documents and Settings\jim\My
Documents\Visual Studio 2005\Projects\Lab1\Lab1\bin\Release\Lab1.dll
LOG: Appbase = C:\Program Files\Autodesk\Acade 2006\
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===

LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Documents and Settings/jim/My
Documents/Visual Studio 2005/Projects/Lab1/Lab1/bin/Release/Lab1.dll.
*Jim Dowthwaite
Message 3 of 4 (119 Views)

Re: Frustrated VB user moving to .Net looking for a bit of help!

09-24-2005 05:22 AM in reply to: *Jim Dowthwaite
Albert,

Not sure when the original disappeared...is there any chance you could tell
me what has changed in the acad.exe.config file (or post an 'original'
here)?

Jim.

"Albert Szilvasy" wrote in message
news:4966198@discussion.autodesk.com...
Apperently you did change acad.exe.config. The error indicates that you are
trying to load an assembly compiled for .NET 2.0 while running AutoCAD on
the .NET 1.1 framework. If you want to load .NET 2.0 assemblies then you
must allow AutoCAD to load the .NET 2.0 framework. You can do this by either
not having an acad.exe.config file or using the original.

albert

"Jim Dowthwaite" wrote in message
news:4965990@discussion.autodesk.com...
Ok, I've been trying to get a couple of the labs posted here working on my
machine with ACAD2006 and VB.Net 2005 Express Beta 2. I notices something
about the acad.exe.config file in an earlier post but I couldn't figure out
if I had to change something there for VS 2005.

The dll compiles fine but when I try to load the file with NETLOAD I get the
following error in AutoCAD, any Ideas what I'm missing?:

Command: NETLOAD
Cannot load assembly. Error details: System.BadImageFormatException: The
format
of the file 'Lab1.dll' is invalid.
File name: "Lab1.dll"
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase,
Boolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound,
Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Boolean
stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence
securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
at loadmgd()

=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:\Documents and Settings\jim\My
Documents\Visual Studio 2005\Projects\Lab1\Lab1\bin\Release\Lab1.dll
LOG: Appbase = C:\Program Files\Autodesk\Acade 2006\
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===

LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Documents and Settings/jim/My
Documents/Visual Studio 2005/Projects/Lab1/Lab1/bin/Release/Lab1.dll.
*Albert Szilvasy
Message 4 of 4 (119 Views)

Re: Frustrated VB user moving to .Net looking for a bit of help!

09-24-2005 08:10 AM in reply to: *Jim Dowthwaite
The original is on your AutoCAD CD.

aLbert
"Jim Dowthwaite" wrote in message
news:4966238@discussion.autodesk.com...
Albert,

Not sure when the original disappeared...is there any chance you could tell
me what has changed in the acad.exe.config file (or post an 'original'
here)?

Jim.

"Albert Szilvasy" wrote in message
news:4966198@discussion.autodesk.com...
Apperently you did change acad.exe.config. The error indicates that you are
trying to load an assembly compiled for .NET 2.0 while running AutoCAD on
the .NET 1.1 framework. If you want to load .NET 2.0 assemblies then you
must allow AutoCAD to load the .NET 2.0 framework. You can do this by either
not having an acad.exe.config file or using the original.

albert

"Jim Dowthwaite" wrote in message
news:4965990@discussion.autodesk.com...
Ok, I've been trying to get a couple of the labs posted here working on my
machine with ACAD2006 and VB.Net 2005 Express Beta 2. I notices something
about the acad.exe.config file in an earlier post but I couldn't figure out
if I had to change something there for VS 2005.

The dll compiles fine but when I try to load the file with NETLOAD I get the
following error in AutoCAD, any Ideas what I'm missing?:

Command: NETLOAD
Cannot load assembly. Error details: System.BadImageFormatException: The
format
of the file 'Lab1.dll' is invalid.
File name: "Lab1.dll"
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String
codeBase,
Boolean isStringized, Evidence assemblySecurity, Boolean
throwOnFileNotFound,
Assembly locationHint, StackCrawlMark& stackMark)
at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Boolean
stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile, Evidence
securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm)
at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
at loadmgd()

=== Pre-bind state information ===
LOG: Where-ref bind. Location = C:\Documents and Settings\jim\My
Documents\Visual Studio 2005\Projects\Lab1\Lab1\bin\Release\Lab1.dll
LOG: Appbase = C:\Program Files\Autodesk\Acade 2006\
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===

LOG: Policy not being applied to reference at this time (private, custom,
partial, or location-based assembly bind).
LOG: Attempting download of new URL file:///C:/Documents and Settings/jim/My
Documents/Visual Studio 2005/Projects/Lab1/Lab1/bin/Release/Lab1.dll.
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.