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

Creating an Icon to Launch a dll

5 REPLIES 5
Reply
Message 1 of 6
mgorecki
1078 Views, 5 Replies

Creating an Icon to Launch a dll

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?

 

5 REPLIES 5
Message 2 of 6
norman.yuan
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"!

Norman Yuan

Drive CAD With Code

EESignature

Message 3 of 6
mgorecki
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.

Message 4 of 6
mgorecki
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?

Message 5 of 6
Hallex
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
Message 6 of 6
Anonymous
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.

 

 

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

Post to forums  

Forma Design Contest


Autodesk Design & Make Report