.NET

.NET

Reply
*CraigV\(fs\)
Message 1 of 4 (153 Views)

What does it take to successfully the use VB.NET or C#.NET "Express Edition" ?

153 Views, 3 Replies
04-19-2006 07:56 AM
I am a complete newbie here. I've downloaded both VB.NET and C#.NET 2005
Express Editions. I've tried to compile the Autodesk labs and load them in
ADT2006. My vb .DLL error message is below. What is the secret to getting
the Express versions to work in AutoCAD 2006?

I understand the negatives to these Express versions is that there is no way
to debug using them. If worse comes to worse, I guess I could buy Visual
Studio Standard - but since I am just getting my feet wet, I thought I'd try
things out on the free version.

Thanks,

Craig


---------------------------------------------------------------------------------
Command: netload
Cannot load assembly. Error details: System.BadImageFormatException: The
format
of the file 'Lab1.dll' is invalid.
File name: "Lab1.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:\@Custom\Lab1.dll
LOG: Appbase = C:\Program Files\Autodesk Architectural Desktop 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:/@Custom/Lab1.dll.
Distinguished Contributor
cgay
Posts: 125
Registered: ‎08-02-2005
Message 2 of 4 (153 Views)

Re: What does it take to successfully the use VB.NET or C#.NET "Express Edition" ?

04-19-2006 04:48 PM in reply to: *CraigV\(fs\)
look here
http://discussion.autodesk.com/search.jspa?numResults=25&inputEntered=true&source=thread-threaded%7C152&q=express&objID=f152

for express info

I have seen the error you describe before, I believe it had something to do with the .NET framework version AutoCAD uses.
Express Uses .NET 2.0, and by default AutoCAD uses the latest version (which would be 2.0) so if this is indeed the cause, I would check to make sure the AutoCAD.exe.config file has the line specifying the previous version commented out. If this is not the cause, I would delete the referenced to the managed AutoCAD libraries in your project and re-add them from the AutoCAD folder.
Also, make sure you have the latest AutoCAD service pack installed.

And I think you can debug an AutoCAD extension dll in all versions of Visual Studio (including express). You just have to make sure you set it up properly. Look for my reply post here:
http://discussion.autodesk.com/thread.jspa?messageID=5035412
to see how I am debugging my AutoCAD dlls. I'm not saying my way is the only or best way, it's just what I do. Maybe some others would post a different and/or better way to start debugging.

Also, there is a lot of useful info here on this board which should answer a lot of questions you may have in the future. Use the search bar at the top of the page. Finally, don't forget the ARX and VBA groups as well (if you are going to use interop at all) as a source for answers.

Let us know how you make out

C
*CraigV\(fs\)
Message 3 of 4 (153 Views)

Re: What does it take to successfully the use VB.NET or C#.NET "Express Edition" ?

04-20-2006 09:08 AM in reply to: *CraigV\(fs\)
Thanks for the bump along. I had forced it to use the 1.x framework while I
used the Express beta. Re-commenting the line out fixed the situation.
Thanks again.

Craig


wrote in message news:5148163@discussion.autodesk.com...
look here
http://discussion.autodesk.com/search.jspa?numResults=25&inputEntered=true&source=thread-threaded%7C152&q=express&objID=f152

for express info

I have seen the error you describe before, I believe it had something to do
with the .NET framework version AutoCAD uses.
Express Uses .NET 2.0, and by default AutoCAD uses the latest version (which
would be 2.0) so if this is indeed the cause, I would check to make sure the
AutoCAD.exe.config file has the line specifying the previous version
commented out. If this is not the cause, I would delete the referenced to
the managed AutoCAD libraries in your project and re-add them from the
AutoCAD folder.
Also, make sure you have the latest AutoCAD service pack installed.

And I think you can debug an AutoCAD extension dll in all versions of Visual
Studio (including express). You just have to make sure you set it up
properly. Look for my reply post here:
http://discussion.autodesk.com/thread.jspa?messageID=5035412
to see how I am debugging my AutoCAD dlls. I'm not saying my way is the only
or best way, it's just what I do. Maybe some others would post a different
and/or better way to start debugging.

Also, there is a lot of useful info here on this board which should answer a
lot of questions you may have in the future. Use the search bar at the top
of the page. Finally, don't forget the ARX and VBA groups as well (if you
are going to use interop at all) as a source for answers.

Let us know how you make out

C
*Corey A. Layton
Message 4 of 4 (153 Views)

Re: What does it take to successfully the use VB.NET or C#.NET "Express Edition" ?

05-31-2006 07:10 AM in reply to: *CraigV\(fs\)
CraigV(fs) wrote:
> I am a complete newbie here.

Craig,

I'm right behind you.
hopefully you've dropped some crumbs along your path?

seriously,
what's your experience been in learning VB.NET?

I'm going to attempt to transition from VBA...
Starting with the .NET AutoCAD API Labs.

I'm into '07 now.
Should I fire up '05 to follow the lab tutorials?
Or will your fix work in '07 also?
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.