Unable to attach the revit.exe to visual studio

Unable to attach the revit.exe to visual studio

Anonymous
Not applicable
1,140 Views
4 Replies
Message 1 of 5

Unable to attach the revit.exe to visual studio

Anonymous
Not applicable

Hi all,

 

I am trying to debug the code I've written. I'm even trying it with the "My first Revit Plug-in" code so that it will be simple and not related to the code..

 

I've tried almost every way thats explained and discussed on the forum but no luck...

 

I'm using VS 2015 and Revit 2017.1

 

I've set use managed compatibility from debugging options. I've enabled native code debugging option.

 

I've tried targeting .NET framework 4.5.2 and 4.6.1

 

In the end I've tried to attach another process(i.e calc.exe) and it was fine. Its just Revit.exe refusing to be attached to the VS debugging.  The error I get is ExecutionEngineException.(shown in the screenshot)

 

Can anybody understand whats going wrong?

 

 

0 Likes
1,141 Views
4 Replies
Replies (4)
Message 2 of 5

aignatovich
Advisor
Advisor

Hi!

 

Try to set "Use Managed Compatibility Mode" in Visual Studio Debugging options (VS main menu: Debug\Options...)

vs debug opts.PNG

 

0 Likes
Message 3 of 5

Anonymous
Not applicable

I've already tried to enable that option. Unfortunately it didn't change anything.

0 Likes
Message 4 of 5

Anonymous
Not applicable

Now I've installed Revit 2019 and still having problem. This time Revit simply shuts down.

 

Any ideas?

0 Likes
Message 5 of 5

bweinreder
Enthusiast
Enthusiast

Have you set Copy Local as False for your RevitAPI and RevitAPIUI references? Also, I assume you've gone under Properties (under your project tree in the Solution Explorer) and set the path to Revit under 'Start external program'?

 

This and the Managed Compatibility more are the three things you need to have right before debugging. Otherwise, I simply wouldn't know. In the worst case you can uninstall VS and all your C++ redistributables, but I'd do some more research before going through these steps because it's probably something in your Visual Studio project.

0 Likes