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

Visual Studio Debug Issue: Unable to start '...acad.exe'.

9 REPLIES 9
Reply
Message 1 of 10
calvindale
6474 Views, 9 Replies

Visual Studio Debug Issue: Unable to start '...acad.exe'.

Greetings,

 

I see the following error when I attempt to launch AutoCAD via F5 debugging from Visual Studio:

 

     Error while trying to run project: Unable to start program '...path...\acad.exe'.

 

     Input or output cannot be redirected because the specified file is invalid.

 

The path to the executable is correct.  I tried launching with and without the command line args: "/p <<VANILLA>>" to no avail.

 

I'm running AutoCAD 2011, VS2010 Ultimate, 64-bit Win 7, .NET 3.5, C#

 

Any ideas?  Thanks!

 

Both AutoCAD and Visual Studio hang if I attach the debugger after AutoCAD is launched (either before or after a NETLOAD).

 

I have fresh installs of AutoCAD, Visual Studio, Windows 7.  This is a new box.

 

Again, thanks!

Tags (1)
9 REPLIES 9
Message 2 of 10

Hi,

 

have you set the path to AutoCAD enclosed in quotations marks?

Show us a screenshot of your project-settings/tab debug or upload the CSPROJ-file (there are also the settings for debugging saved.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 10

The "Start external program" text box won't accept a quote delimited path/file.  I also tried a shortened 8.3 path.

 

The program couldn't be simpler:

 

namespace AutoCadLibrary {
    public class ScratchPad {
 
        [CommandMethod("HelloWorld")]
        public void HelloWorld() {
            Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
            ed.WriteMessage("\nHello World 1");
        }
 
    }
}

 

Thanks for your help

Message 4 of 10

Hi,

 

sorry, you are right, no quotes in "start ..."

 

Is drive D in your case a internal harddisk, an external or a network-drive?

Do you have write-access to the directory?

Do you have any AntiVirus or defender or ... running?

 

One idea I have is: create a batch-file, placed on C-drive (thats now your start-prog for vs) and in this place the line to start AutoCAD. (just as a test for differences between C: and D:)

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 5 of 10

I tried launching AutoCAD indirectly via a batch file; but I got this exception:

 

     External Program Path:

     We can only debug an EXE file.  Please enter a valid executable.

 

 

Message 6 of 10

Hi,

 

and the other 3 questions?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 7 of 10

My harddrive's are both internal.  AutoCAD is installed on one harddrive and my visual studio projects are located on another.  I do have write access the acad.exe path.  I'm an admin on this machine.

 

We run LANDesk antivirus here.  But I disabled it.

 

 

 

Message 8 of 10

Hi,

 

what happens if you compile your project, start AutoCAD and _NETLOAD your DLL? Does this work?

 

Have you tried to open any of the samples from the ObjectARX-kit?

 

Sorry, the number of ideas I have goes to 0 ;(

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 9 of 10

I'm able to netload a dll and run a command.  But I'm not able to launch AutoCAD from Visual Studio and attaching to a running instance of AutoCAD freezes it as well as Visual Studio.

Message 10 of 10
calvindale
in reply to: calvindale

I got this fixed by changing the command line arguments from

 

/p <<VANILLA>>

 

to

 

/p "<<VANILLA>>"

 

 

That's all it took.

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