.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Netload Error, Starting From Scratch

6 REPLIES 6
Reply
Message 1 of 7
mgorecki
1057 Views, 6 Replies

Netload Error, Starting From Scratch

Hello,

In the past, I've used a pre-packaged template to start my vb.Net code for AutoCad.  Today, I'm trying to just launch Visual Studio 2010 and start writing code from there.

What I;'ve done so far:

In the Project Properties, under the Debug tab, I've set the external program to AutoCad 2008\acad.exe (as well as a working directory)

Under the References tab I added acDbMgd and AcMgd from the ObjectARX 2020\inc-x64 folder.  I also added the Autodesk.AutoCAD.Interop and Autodesk.AutoCAD.Interop.Common dlls (also from the same folder)

 

I then wrote some simple code as a test.  I picked "Start Debugging" which launched AutoCad and I entered Netload and picked my .dll.

 

This is what came back:

NETLOAD Cannot load assembly. Error details: System.BadImageFormatException:
Could not load file or assembly
'file:///C:\Holding\acadtest\acadtest\bin\Debug\acadtest.dll' or one of its
dependencies. This assembly is built by a runtime newer than the currently
loaded runtime and cannot be loaded.
File name: 'file:///C:\Holding\acadtest\acadtest\bin\Debug\acadtest.dll'
   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
   at loadmgd()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure
logging.
To turn this feature off, remove the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog].

 

This is way over my head.  What did I leave out?  Are there more settings to set?  Any help would be greatly appreciated.

 

Thanks,

Mark

6 REPLIES 6
Message 2 of 7
mgorecki
in reply to: mgorecki

Ok, I went to the "Compile" tab and picked "Advanced Compile Options" and changed the Target framework from .NET Framework 4.0 to .NET Framework 3.5.  I saved and re-launched and now it seems to be working. 

Message 3 of 7
mgorecki
in reply to: mgorecki

The problem now is that I put in a break, but it is completely ignored.  The program runs, but I cannot get it to stop at the breakpoint.

Message 4 of 7
fieldguy
in reply to: mgorecki

I don't have acad 2008 to test.  Change the "target framework" under Project->"projectname" Properties->Compile->Advanced Compile Options at the bottom.  The default is 4 - I have to use 3.5 for acad 2011.  There are posts here that say 2.0 should be used for acad 2008.

Message 5 of 7


@mgorecki wrote:
[,,,]

In the Project Properties, under the Debug tab, I've set the external program to AutoCad 2008\acad.exe (as well as a working directory)

Under the References tab I added acDbMgd and AcMgd from the ObjectARX 2020\inc-x64 folder.  I also added the Autodesk.AutoCAD.Interop and Autodesk.AutoCAD.Interop.Common dlls (also from the same folder)[,,.]


What version of ObjectARX are you using??? (newest  version is 2013, but you have to use ObjectARX 2008 if your's assembly need to work with AutoCAD 2008). Also you can set Target framework to .NET Framework 2.0 and for all AutoCAD assembly set Copy Local to False. Also if your's version of  AutoCAD 2008 is x64 - set Platform target to Any CPU or to x64.

I hope that help you.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 6 of 7
mgorecki
in reply to: mgorecki

Ok, I went to the Debug tab and changed the external program from AutoCad 2008 to AutoCad 2010 and now the debugger stops at the breakpoints.

Message 7 of 7
mgorecki
in reply to: mgorecki

Thank you both for your information.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost