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

First steps with AutoCAD 2017 and VS2015

58 REPLIES 58
SOLVED
Reply
Message 1 of 59
Anonymous
7985 Views, 58 Replies

First steps with AutoCAD 2017 and VS2015

I'm making my first steps porting our application to AutoCAD2017 and VS2015.

 

I immediately found a weird behaviour: AutoCAD 2017 run from inside Visual Studio (just execuded acad.exe without netloading anything) starts without ribbon and the command _ribbon is unknown....

 

If I run AutoCAD 2017 outside Visual Studio everything is normal...

Also, no problems running AutoCAD 2015 inside Visual Studio.

 

My environment is Windows 8.1 64bit, Visual Studio 2015, AutoCAD 2017 64bit.

 

Any idea?

58 REPLIES 58
Message 2 of 59
Jeff_M
in reply to: Anonymous

If you turn on the Managed Compatibility Mode in the Debug options it should then show the Ribbon and the commands will be known. However, you will lose the ability to Edit & Continue.
Jeff_M, also a frequent Swamper
EESignature
Message 3 of 59
Anonymous
in reply to: Jeff_M

Really?

I'd like to know if it's Microsoft's or Autodesk's responsibility... I just built a x64 development machine  because I was able to use Edit&Continue with VS2013 and AutoCAD 2015/2016 and now you say I have to go back with a 32bit environment?!?

 

I'll investigate your suggestion though! Thank you!

 

Message 4 of 59
_Tharwat
in reply to: Anonymous

Hi,

 

I have downloaded AutoCAD 2017 this morning and tried it with VS Community 2015 , AutoCAD did not run in Visual Studio.

 

After invoking AutoCAD 2017 from VS ,AutoCAD started but the netloadingloaded the .dll file but the command name of the program gives an error as it is unknown command name.

 

It seems a bad start with CAD 2017.

 

 

Message 5 of 59
Alfred.NESWADBA
in reply to: Jeff_M

Hi,

 

>> If you turn on the Managed Compatibility Mode in the Debug options it should then show the Ribbon

>> and the commands will be known. However, you will lose the ability to Edit & Continue.

@Jeff_M THX for this solution, just run into the same problem now and found your response great.

 

As I just have setup a new system I thought I don't need VS2013 any more, but now the question raise up ... does VS2013 show the same issue or does VS2013 work better than VS2015 and - most important - is VS 2013 able to do edit-while-debug with AutoCAD 2017 64bit?

As the system is new and I want to mess it up at this early stage I don't want to install it just to know it is also not working 😉

 

Thx in advance, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 6 of 59
Jeff_M
in reply to: Alfred.NESWADBA

@Alfred.NESWADBA, problem exists in VS2013 and VS2015. So, for me, I do most of my debug work in C3D2016 as I have yet to implement any 2017 specific API calls. Then I just create a build for 2017 and run it outside of VS.

Jeff_M, also a frequent Swamper
EESignature
Message 7 of 59
_Tharwat
in reply to: Jeff_M

Jeff_M

 

I already downloaded AutoCAD 2017 and I already have VS community 2015 but when I debug a C# program it does not run AutoCAD 2017 inside VS.

So how do you convert from running AutoCAD inside or outside VS 2015 ?

 

Thank you

Message 8 of 59
Alfred.NESWADBA
in reply to: Jeff_M

Hi,

 

>> problem exists in VS2013 and VS2015

@Jeff_M thx for information!

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2024
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 9 of 59
Jeff_M
in reply to: _Tharwat

@_Tharwat, I setup my 2017 project just as I have my AutoCAD 2014-2016 projects. I do not recall having any issues geting it to run and debug, other than the Ribbon issue. I don't convert from running inside or outside of VS....to run 'outside' I just create a build, start Autocad normally, then netload that build. Here is how my Debug properties are setup:

3-28-2016 8-56-13 AM.png

 

I also have a .bundle autoloader setup and have my Debug builds output to the folder for 2017 there.

Jeff_M, also a frequent Swamper
EESignature
Message 10 of 59
_Tharwat
in reply to: Jeff_M

Thank you jeff_M

 

I already know and have these settings with every program but I am referring to debug a program with AutoCAD 2017 inside VS which is not available with my VS community 2015.

Message 11 of 59
Jeff_M
in reply to: _Tharwat

I'm not sure what you mean by "not available with my VSC2015", Tharwat. I am using VSC2015 with Autocad2017 and am able to debug...as long as I don't want to use the ribbon. But I still hit break points, can step through code, etc.
Jeff_M, also a frequent Swamper
EESignature
Message 12 of 59
_Tharwat
in reply to: Jeff_M

AutoCAD 2017 is not running inside VS 2015 but it loads autocad and run separately.

 

The first video shows that if I hit hi F5 and call netload and select the dll file it won't recognize the command call "msg" but if I run with Control + F5 it recognize the command name and show the related message correctly.

 

error-1.gif

 

error-2.gif

Message 13 of 59
Jeff_M
in reply to: _Tharwat

@_Tharwat, I seem to recall seing this issue in the past (in other versions of VS & Acad) but I'm not recalling what was causing it. Make sure all of your references for the Autocad managed assemblies are set "copy local = false" ?

 

 

 

Jeff_M, also a frequent Swamper
EESignature
Message 14 of 59
_Tharwat
in reply to: Jeff_M


@Jeff_M wrote:

@_Tharwat, I seem to recall seing this issue in the past (in other versions of VS & Acad) but I'm not recalling what was causing it. Make sure all of your references for the Autocad managed assemblies are set "copy local = false" ?

 

 

 


For sure there are set to false otherwise you would see them near the dll file in the netload dialog Smiley Wink

 

I have no probelm with VS nor even with AutoCAD 2017 but as I have read around that CAD 2017 would be running into VS Environment and that is what I am after.

Message 15 of 59
douggoforth
in reply to: _Tharwat

Turn on checkbox for: Use Managed Compatibility Mode

in Tools->Options->Debug-General

 

I had the very same problem with 2017. This worked for me.

 

Doug

 

 

Message 16 of 59
Jeff_M
in reply to: _Tharwat

Looks like I've been so busy that I'd forgotten where I'd left off. Turns out that I am unable to get my custom commands to work unless the Use Managed Compatablity Mode is on. I could've sworn it was working just fine at one point....

Jeff_M, also a frequent Swamper
EESignature
Message 17 of 59
_Tharwat
in reply to: douggoforth


@douggoforth wrote:

Turn on checkbox for: Use Managed Compatibility Mode

in Tools->Options->Debug-General

 

I had the very same problem with 2017. This worked for me.

 

Doug 

 


Thank you , it is really still with no effects.

 

Let us clear things up by clarifying this: 

What does it mean when we say ( with AutoCAD 2017 will be running inside VS 2015 ) ?

 

Does it mean that somehow AutoCAD 2017 would be used by VS 2015 as an Application to test the codes in VS environment or scope ? 

 

Thanks

Message 18 of 59
BlackBox_
in reply to: _Tharwat

Hi @_Tharwat - Good to see another friend here. 

 

Yes, when you debug an AutoCAD plugin, VS launches an AutoCAD process as startup object. Normally, your assembly needs to be manually netloaded, but you can setup an Autoloader .bundle, and change your build settings to instead compile to there, so the Assembly will be loaded automagically. 

 

Within VS refers to controlling the start/launch, and stop of the AutoCAD process from VS via debug/F5.

 

outside of VS refers to simply building your assembly, manually launching AutoCAD, and netloading the resultant assembly. This option does not allow you to debug via break points, review watch items, etc. 

 

 

What we're talking about above, is the fact that 2017 does not currently support proper debug functionality, without intentionally disabling useful features in VS2015, which pretty much defeats the purpose of  using it in the first place. 

 

HTH



"How we think determines what we do, and what we do determines what we get."

Message 19 of 59
_Tharwat
in reply to: BlackBox_

Hi BlackBox_

 

Thank you for the precious inputs mate.

 

 

Message 20 of 59
ambrosl
in reply to: _Tharwat

There is a known issue that is currently being looked into that was fixed in a previous release of the AutoCAD Managed .NET libraries and has since resurfaced in AutoCAD 2017. There are two known work arounds at the moment to allow debugging with Visual Studio:

  • Tools > Options > Debug-General > Use Managed Compatibility Mode
  • Project > Properties > Debug Enable native code debugging

This does cause problems with Edit & Continue though as mentioned previously in Kean's blog:

http://through-the-interface.typepad.com/through_the_interface/2013/11/debugging-autocad-using-visua...



Lee Ambrosius
Senior Principal Content Experience Designer
For additional help, check out the AutoCAD Developer Documentation

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

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report