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

AutoCAD from an external .NET application: System.IO.FileNotFoundException

13 REPLIES 13
SOLVED
Reply
Message 1 of 14
Mahmoud.Abdelmoneam
1144 Views, 13 Replies

AutoCAD from an external .NET application: System.IO.FileNotFoundException

I ran the LoadableComponent project (Mentioned here by Kean Walmsley) in my machine successfully After Building with Visual Studio. Whenever I try to run it on another machine (Without Building with Visual Studio) I get this Exception:

 

 

System.IO.FileNotFoundException: Problem in loading application

at Autodesk.AutoCAD.Interop.IAcadApplication.GetInterfaceObject(String ProgID)

 

 

I did everything Kean said (RegAsm and everything) but nothing works.

 

My Machine: Windows 7 x64, AutoCAD 2014, Visual Studio 2010

Other Machines: Windows 7 x64, AutoCAD 2014

 

Things I tried:
Registry Permissions

Files UnBlock - To make sure they are not blocked by any program

Tried on Several Other Machines without Building in Visual Studio

 

Things I tried and Worked:
Installed Visual Studio on the other Machines, Built the Project, after several trials got it to work

 

I want to deploy the Application, so I don't want to build the code on other Machines.

 

Any help would be Appreciated.
Please Help Smiley Sad


Best regards,
Mahmoud AbdElMoneam
13 REPLIES 13
Message 2 of 14

Building the Application Inside AutoCAD Folder Solved it.


Best regards,
Mahmoud AbdElMoneam
Message 3 of 14

Could you elaborate on what building the Application Inside AutoCAD Folder means and how to do it?

 

I am starting out with all of this! I appreciate any help 🙂

Message 4 of 14

As I remember, you set the build location inside the installation folder of Autocad.

Message 5 of 14

Are you referring to the output path located in the build tab of project properties? Also, are you referring to .exe build path or the .dll build path?

 

Thanks again!

Message 6 of 14

The .dll yes, it needs several referances to build correctly, that's why u need to build into the installation folder.

Message 7 of 14

Hmm, this does not seem to work for me, when I try to build the solution, an error says access to the installation folder is denied!

Message 8 of 14

Try to run visual studio as administrator.

Message 9 of 14

I don't recommend building your app into any folder belonging to another app. If the app is updated or removed, you will lose part of your project. Also, the reason you have file access issues is that you are trying to write to areas of the C:\ drive that are protected, e.g. Program Filies. Running as Administrator bypasses Windows security. You can follow the steps in this tutorial on how to set up a new project. The tutorial is about creating a VS template, but the template is used to set up a new project. At the end are some tips for debugging the project.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Message 10 of 14

Thanks for your reply. I agree with you completely. However, for this use case nothing else worked for me, and no one replied with a better solution yet.

Message 11 of 14

Looking back at your first post, if ran regasm on your pc, and then you just copy the exe/dll to another pc, wouldn't you need to run regasm on the other pc too?

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Message 12 of 14

I've worked on this project a long time ago, if I remember correctly, I think I used the installation itself to do this on users' machines.

Message 13 of 14

Hey,

Even after building in the project in AutoCAD directory, it does not work for me. I guess I didn't follow the step correctly. I think I will resort to utilizing the ActiveX interop object model to get internal data from AutoCAD to my .exe application. 

Thank you guys for your help.

Message 14 of 14

Maybe something was missed along the way, good luck with your implementation.

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost