BlackBox
18th Jan 2011, 02:59 pm
I am a Visual Studio noob, and have just began to dabble with VB.NET development.
I am running Visual Basic 2010 Express (sans VBCAD Template), AutoCAD Civil 3D 2011, Windows XP 32-Bit.
Going through the 'HelloWorld' tutorial, when I NETLOAD my .DLL, I get the following error:
Command: netload
Cannot load assembly. Error details: System.BadImageFormatException: Could not
load file or assembly 'file:///C:\Documents and Settings\%UserName%\My
Documents\Visual Studio
2010\Projects\HelloWorld\HelloWorld\bin\Release\He lloWorld.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:\Documents and Settings\\%UserName%\My Documents\Visual
Studio 2010\Projects\HelloWorld\HelloWorld\bin\Release\He lloWorld.dll'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyNa me assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence
securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm,
Boolean forIntrospection, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(Stri ng 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].
Command: helloworld
Unknown command "HELLOWORLD". Press F1 for help.
Here is my code:
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.Civil.Land
Imports Autodesk.Civil.Land.DatabaseServices
Public Class HelloWorld
<CommandMethod("HelloWorld")> _
Public Sub HellowWorld()
'Application.DocumentManager.MdiActiveDocument.Edi tor.WriteMessage("Hello World!")
MsgBox("Hello World!")
End Sub
End Class
Is this an issue of compiling using .NET 4.0 instead of 3.5? If so, how do I fix this?
Cheers!
I am running Visual Basic 2010 Express (sans VBCAD Template), AutoCAD Civil 3D 2011, Windows XP 32-Bit.
Going through the 'HelloWorld' tutorial, when I NETLOAD my .DLL, I get the following error:
Command: netload
Cannot load assembly. Error details: System.BadImageFormatException: Could not
load file or assembly 'file:///C:\Documents and Settings\%UserName%\My
Documents\Visual Studio
2010\Projects\HelloWorld\HelloWorld\bin\Release\He lloWorld.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:\Documents and Settings\\%UserName%\My Documents\Visual
Studio 2010\Projects\HelloWorld\HelloWorld\bin\Release\He lloWorld.dll'
at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase,
Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark,
Boolean throwOnFileNotFound, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoad(AssemblyNa me assemblyRef,
Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
at System.Reflection.Assembly.InternalLoadFrom(String assemblyFile, Evidence
securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm,
Boolean forIntrospection, StackCrawlMark& stackMark)
at System.Reflection.Assembly.LoadFrom(String assemblyFile)
at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(Stri ng 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].
Command: helloworld
Unknown command "HELLOWORLD". Press F1 for help.
Here is my code:
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.Civil.Land
Imports Autodesk.Civil.Land.DatabaseServices
Public Class HelloWorld
<CommandMethod("HelloWorld")> _
Public Sub HellowWorld()
'Application.DocumentManager.MdiActiveDocument.Edi tor.WriteMessage("Hello World!")
MsgBox("Hello World!")
End Sub
End Class
Is this an issue of compiling using .NET 4.0 instead of 3.5? If so, how do I fix this?
Cheers!