BlackBox Posted January 18, 2011 Share Posted January 18, 2011 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\HelloWorld.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\HelloWorld.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(AssemblyName 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(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]. Command: helloworld Unknown command "HELLOWORLD". Press F1 for help. Here is my code: [font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Imports[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2][color=#000000] Autodesk.AutoCAD.Runtime[/color][/size][/font] [/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Imports[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2][color=#000000] Autodesk.AutoCAD.ApplicationServices[/color][/size][/font] [/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Imports[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2][color=#000000] Autodesk.AutoCAD.DatabaseServices[/color][/size][/font] [/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Imports[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2][color=#000000] Autodesk.Civil.Land[/color][/size][/font] [/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Imports[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2][color=#000000] Autodesk.Civil.Land.DatabaseServices[/color][/size][/font][/size][/font] [color=#000000][/color] [font=Consolas][size=2] [/size][/font][/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Public [/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Class [/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af]HelloWorld[/color][/size][/font] [/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2] <[/size][/font][/size][/font][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af][font=Consolas][size=2][color=#2b91af]CommandMethod[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2]([/size][/font][/size][/font][font=Consolas][size=2][color=#a31515][font=Consolas][size=2][color=#a31515][font=Consolas][size=2][color=#a31515]"HelloWorld"[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2])> _[/size][/font] [/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff] Public [/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Sub[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2] HellowWorld()[/size][/font] [/size][/font][font=Consolas][size=2][color=#008000][font=Consolas][size=2][color=#008000][font=Consolas][size=2][color=#008000] 'Application.DocumentManager.MdiActiveDocument.Editor.WriteMessage("Hello World!")[/color][/size][/font] [/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2] MsgBox([/size][/font][/size][/font][font=Consolas][size=2][color=#a31515][font=Consolas][size=2][color=#a31515][font=Consolas][size=2][color=#a31515]"Hello World!"[/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][font=Consolas][size=2])[/size][/font] [/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff] End [/color][/size][/font][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Sub[/color][/size][/font] [size=2][font=Consolas][color=#0000ff]End [/color][/font][/size][/color][/size][/font][/color][/size][/font][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff][font=Consolas][size=2][color=#0000ff]Class[/color][/size][/font] [/color][/size][/font][/color][/size][/font] Is this an issue of compiling using .NET 4.0 instead of 3.5? If so, how do I fix this? Cheers! Quote Link to comment Share on other sites More sharing options...
Tyke Posted January 18, 2011 Share Posted January 18, 2011 Have you got .NET Framework 4.0 installed on your computer? You could always try compiling for .NET Framework 3.5, it sounds awfully like a .NET Framework mismatch. Good luck :wink: Quote Link to comment Share on other sites More sharing options...
BlackBox Posted January 18, 2011 Author Share Posted January 18, 2011 it sounds awfully like a .NET Framework mismatch. ...Looks like one too: (Snapshot from Registry Editor) You could always try compiling for .NET Framework 3.5 How would one go about do that? Quote Link to comment Share on other sites More sharing options...
Tyke Posted January 18, 2011 Share Posted January 18, 2011 Open the Project Explorer Right click on the project name and select properties Go to the Compile Tab Click on the button bottom left "Further compilation options" (I think, I only have a German version at work) In the window that opens in the bottom drop down list you can select the .NET Framework version you want to compile to. Rebuild your project and "Bob's your uncle" Quote Link to comment Share on other sites More sharing options...
BlackBox Posted January 18, 2011 Author Share Posted January 18, 2011 Open the Project ExplorerRight click on the project name and select properties Go to the Compile Tab Click on the button bottom left "Further compilation options" (I think, I only have a German version at work) In the window that opens in the bottom drop down list you can select the .NET Framework version you want to compile to. Rebuild your project and "Bob's your uncle" Bob *IS* my uncle, and You are the Man. :wink: If I ever make it to Saxony, the first yard of Erdinger Hefeweizen is my treat. Prost! :stein: Quote Link to comment Share on other sites More sharing options...
Tyke Posted January 18, 2011 Share Posted January 18, 2011 Thanks, you're welcome. Erdinger is Bavarian, here we drink Radeburger But Erdinger is a good substitute. I'm done for today and off home to sink a couple of those Radeburgers. Quote Link to comment Share on other sites More sharing options...
BlackBox Posted January 18, 2011 Author Share Posted January 18, 2011 Thanks, you're welcome. Erdinger is Bavarian, here we drink Radeburger But Erdinger is a good substitute. I'm done for today and off home to sink a couple of those Radeburgers. The Privatbrauerei Erdinger Weißbräu Werner Brombach GmbH (also known as Erdinger Weißbräu) is a brewery in Erding, Germany. Its best-known products are its namesake Weißbiers (white beer). Well, what can this American say, other than bring on the Radeburgers! I'll have to see if I can get Radeburger here... Hmmm. Many thanks! Quote Link to comment Share on other sites More sharing options...
Tyke Posted January 19, 2011 Share Posted January 19, 2011 Have a look here: http://en.wikipedia.org/wiki/Radeberger_Brewery I don't like the look of that one in the background!!! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.