Author Topic: Error on loading assembly  (Read 6006 times)

0 Members and 1 Guest are viewing this topic.

T.Willey

  • Needs a day job
  • Posts: 5251
Error on loading assembly
« 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.
Quote
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.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Glenn R

  • Guest
Re: Error on loading assembly
« Reply #1 on: August 01, 2008, 05:43:30 PM »
Just to clarify, are you loading ANYTHING from the external drive?

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Error on loading assembly
« Reply #2 on: August 01, 2008, 05:45:42 PM »
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.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Glenn R

  • Guest
Re: Error on loading assembly
« Reply #3 on: August 01, 2008, 05:56:48 PM »
I have only received this warning:
Code: [Select]
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?

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Error on loading assembly
« Reply #4 on: August 01, 2008, 06:00:39 PM »
I have only received this warning:
Code: [Select]
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.
« Last Edit: August 01, 2008, 06:07:24 PM by T.Willey »
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Glenn R

  • Guest
Re: Error on loading assembly
« Reply #5 on: August 01, 2008, 06:11:34 PM »
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...

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Error on loading assembly
« Reply #6 on: August 01, 2008, 06:12:48 PM »
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.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Error on loading assembly
« Reply #7 on: August 01, 2008, 06:15:41 PM »
Thanks again Glenn.  Hope you get some good sleep tonight.   :-)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Glenn R

  • Guest
Re: Error on loading assembly
« Reply #8 on: August 01, 2008, 06:18:36 PM »
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 :)

Glenn R

  • Guest
Re: Error on loading assembly
« Reply #9 on: August 01, 2008, 06:21:37 PM »
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.