.NET

Reply
Mentor
mgorecki
Posts: 401
Registered: ‎09-23-2004
Message 1 of 6 (332 Views)

Creating an Icon to Launch a dll

332 Views, 5 Replies
02-20-2013 09:52 AM

I have a .net program that I would like to run using an icon.  I've done this before and it worked, but now it's giving me an error.

I created the icon and command, I added the following to the command line:

^C^Cnetload "C://Program Files//my stuff//myProgram.dll” adp

(adp will lanch the program)

I get the following:

netload Assembly file name: "C://Program
Files//mystuff//myProgram.dll” adp

Cannot load assembly. Error details: System.ArgumentException: Illegal
characters in path.
   at System.IO.Path.CheckInvalidPathChars(String path)
   at System.IO.Path.Combine(String path1, String path2)
   at ?A0xe1e1f031.NormalizeLoadFilename(String fname)
   at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
   at loadmgd()

 

Originally I tried using single slashes (/), but it still gives the same error.  It seems to have trouble with the spaces in the file path.  How do I work around that?

 

*Expert Elite*
norman.yuan
Posts: 965
Registered: ‎04-27-2009
Message 2 of 6 (324 Views)

Re: Creating an Icon to Launch a dll

02-20-2013 10:31 AM in reply to: mgorecki

The file path in your macro is wrong: you use either double back-slash "\\" or single forward-slash "/". Yet, you used double forward-slash "//", hence the "illegal character in path"!

Mentor
mgorecki
Posts: 401
Registered: ‎09-23-2004
Message 3 of 6 (305 Views)

Re: Creating an Icon to Launch a dll

02-20-2013 12:00 PM in reply to: norman.yuan

When I use:

^C^Cnetload "C:\\Program Files\\my Stuff\\myProgram.dll” adp

I get:

Command: netload Assembly file name: "C:
Cannot load assembly. Error details: System.ArgumentException: Illegal
characters in path.
   at System.IO.Path.CheckInvalidPathChars(String path)
   at System.IO.Path.Combine(String path1, String path2)
   at ?A0xe1e1f031.NormalizeLoadFilename(String fname)
   at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
   at loadmgd()

 

When I use:

^C^Cnetload "C:/Program Files/my Stuff/myProgram.dll” adp

I get:

Command: netload Assembly file name: "C:/Program Files/my
Stuff/myProgram.dll” adp
Cannot load assembly. Error details: System.ArgumentException: Illegal
characters in path.
   at System.IO.Path.CheckInvalidPathChars(String path)
   at System.IO.Path.Combine(String path1, String path2)
   at ?A0xe1e1f031.NormalizeLoadFilename(String fname)
   at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
   at loadmgd()

 

It's so weird, it used to work with the single slashes.

Mentor
mgorecki
Posts: 401
Registered: ‎09-23-2004
Message 4 of 6 (302 Views)

Re: Creating an Icon to Launch a dll

02-20-2013 12:10 PM in reply to: norman.yuan

Ok, I just retyped the command very carefully:

^C^Cnetload "C:/Program Files/my Stuff/myProgram.dll" adp

 

For some reason, this one works.  Maybe a hidden character from a cut and paste?

*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 5 of 6 (272 Views)

Re: Creating an Icon to Launch a dll

02-21-2013 03:03 AM in reply to: mgorecki

I'm using for years lisp expression for button macro,

i.e. for full path of my test .dll:

^C^C(command "_.NETLOAD" "C:/Users/Oleg/Programming/ACAD/ACAD_START/AutoCAD CSharp plug-in1/AutoCAD CSharp plug-in1/bin/Release/AutoCAD CSharp plug-in1.dll" )(princ)

 It should working for me with no problem,

as you can see your friend is a single slash as delimiter

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Contributor
mjsmith
Posts: 13
Registered: ‎06-23-2008
Message 6 of 6 (127 Views)

Re: Creating an Icon to Launch a dll

08-07-2013 01:15 PM in reply to: mgorecki

The " character at the end of the string looks different than the one at the beginning I bet that is your illicit character causing the problem.

 

 

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community