TheSwamp
Code Red => .NET => Topic started by: T.Willey on August 01, 2008, 05:39:23 PM
-
I don't know how this happened. I hooked up an external floppy drive ( 3 1/2" ), and now I can't run any .Net programs. Here is the error message from Acad. This is a .dll that I have used today before I hooked up the external drive to my comp.
Command: NETLOAD Cannot load assembly. Error details:
System.BadImageFormatException: The format of the file '3MAutoCAD.dll' is
invalid.
File name: "3MAutoCAD.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:\MyCustom\Dll\3MAutoCAD.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:/MyCustom/Dll/3MAutoCAD.dll.
I'm not quite sure if this is an acad, or a .Net problem, but I have tried to repair both, and the error still happens. When I try and run the code from the menu in Acad ( because I have it load on demand ) I get the error dialog attached. When I hit the okay button, it fatal errors Acad.
Any help is appreciated. Thanks in advance.
Edit: It must be a Acad issue, as I can run .Net for windows program, but nothing inside Acad will work.
-
Just to clarify, are you loading ANYTHING from the external drive?
-
Just to clarify, are you loading ANYTHING from the external drive?
Nope. The drive isn't hooked up anymore, and I have rebooted, as I had to once I repaired the .Net languages on my comp.
-
I have only received this warning:
System.BadImageFormatException
when I've inadvertently built a .dll using a framework that AutoCAD is not set to handle. Have you modified the acad.exe.config file to target a specific framework version?
Also, when you plug the drive in and it's mapped as say 'F:\', is your .dll you're trying to load, attempting to load anything from this drive?
-
I have only received this warning:
System.BadImageFormatException
when I've inadvertently built a .dll using a framework that AutoCAD is not set to handle. Have you modified the acad.exe.config file to target a specific framework version?
Also, when you plug the drive in and it's mapped as say 'F:\', is your .dll you're trying to load, attempting to load anything from this drive?
I can see if it is changed, but if so I didn't do it, and that scares me. :-o
The .dll should not load anything from anywhere.
Be right back to see if it is targeting some specific language.
Edit: It doesn't look like it is. I did notice that I have the framework for 3.0 installed, but code using 2.0. I don't think that should cause a problem, but I'm just trying to give all the information I can. Thanks for the help Glenn.
Edit: It does look like that was the issue. I had to read it a little harder than I did. YOU ARE THE MAN GLENN! I was scared I would have to use my lisp routines again until I fixed this, but that is not the case now. I'm happy again. :-) I don't know why it stopped working, but I'm glad it is again.
-
Sorry Tim, but it's late here and I'm tired - was it an issue of being built against a higher framework or something else? Sorry, my eyes are hanging out my noggin...
-
Sorry Tim, but it's late here and I'm tired - was it an issue of being built against a higher framework or something else? Sorry, my eyes are hanging out my noggin...
I pretty sure that was the issue. It looked like it wanted to only read for 1.1 .Net, but it was compiled against 2.0 .Net. Once I commented it out in the config file, it worked again without error.
-
Thanks again Glenn. Hope you get some good sleep tonight. :-)
-
It looked like it wanted to only read for 1.1 .Net, but it was compiled against 2.0 .Net. Once I commented it out in the config file, it worked again without error.
That would be it - been guilty of it myself before as well :)
-
YOU ARE THE MAN GLENN! I was scared I would have to use my lisp routines again until I fixed this, but that is not the case now. I'm happy again. :-) I don't know why it stopped working, but I'm glad it is again.
Maybe today Tim (and I thankyou for the kind words), but I'm sure I'll be vilified for something else tomorrow I'm sure - glad I could help.