Author Topic: Important note re: .NET 4.0 and C3D (and likely other) 2012 hosts  (Read 2337 times)

0 Members and 1 Guest are viewing this topic.

StefanDidak

  • Guest
I hope the following information about using .NET 4.0 with Civil 3D 2012 (and possibly other 2012 AutoCAD based product as far as I can tell) is going to save everyone a lot of wasted time trying to track down a very strange and time consuming problem (I'm not even going into the many hours that went into figuring this one out).

Especially if you are running into problems debugging and hitting breakpoints in your addon source code and having VS2010 tell you the source isn't available:

http://www.stefandidak.com/2011/04/vs2010-debugger-and-autodesk-civil-3d-2012-breakpoint-and-no-source-issues/

Edit: corrected URL in link
« Last Edit: April 17, 2011, 11:45:55 AM by StefanDidak »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Important note re: .NET 4.0 and C3D (and likely other) 2012 hosts
« Reply #1 on: April 17, 2011, 07:46:28 PM »
Stefan,
Using Autocad 2012 English Vanilla
I can still debug as I did in 2011.

I'm building on a 64bit machine so Edit and Continue is still an issue, similar to 2011


I'm using this acad.exe.config
Quote
<configuration>

  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>

<!--All assemblies in AutoCAD are fully trusted so there's no point generating publisher evidence-->
   <runtime>       
   <generatePublisherEvidence enabled="false"/>   
   </runtime>
</configuration>
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

StefanDidak

  • Guest
Re: Important note re: .NET 4.0 and C3D (and likely other) 2012 hosts
« Reply #2 on: April 17, 2011, 07:52:48 PM »
Stefan,
Using Autocad 2012 English Vanilla
I can still debug as I did in 2011.
I suspect AutoCAD itself doesn't suffer from this debugger problem like the verticals (MEP, C3D, etc.) do.

But let me ask, have you tried hitting breakpoints in modal or modeless Windows Forms in your .NET 4.0 AutoCAD app?

Cheers,
Stefan.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Important note re: .NET 4.0 and C3D (and likely other) 2012 hosts
« Reply #3 on: April 17, 2011, 07:55:31 PM »
Stefan,
Using Autocad 2012 English Vanilla
I can still debug as I did in 2011.
I suspect AutoCAD itself doesn't suffer from this debugger problem like the verticals (MEP, C3D, etc.) do.

But let me ask, have you tried hitting breakpoints in modal or modeless Windows Forms in your .NET 4.0 AutoCAD app?

Cheers,
Stefan.

No Stefan, haven't tried.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Jeff H

  • Needs a day job
  • Posts: 6142
Re: Important note re: .NET 4.0 and C3D (and likely other) 2012 hosts
« Reply #4 on: April 17, 2011, 10:28:29 PM »
It works fine here with MEP 2012 bulit to target 4.0 with VS2010 on 32 bit


I have not tested much.


I did not use any of the workarounds you had to for AutoCAD 2011 with VS2010

The setup was like using VS2008 with Acad 2010 where I just set acad.exe for Start Action on Debug Tab in properties.


Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Important note re: .NET 4.0 and C3D (and likely other) 2012 hosts
« Reply #5 on: April 18, 2011, 02:06:16 AM »

Stefan,
I just ran up a modal form in .NET 4.0 in AutoCAD 2012 and hit the breakpoint without issue.
Tried with FIBERWORLD set at 1 and O.

Regards
Kerry
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

StefanDidak

  • Guest
Re: Important note re: .NET 4.0 and C3D (and likely other) 2012 hosts
« Reply #6 on: April 18, 2011, 10:56:03 AM »
Strange results. Jeff, I think MEP might be safe from the problem or perhaps it's x64 specific, but I'm not 100% sure of that. The debug problems with modal forms and .NET 4.0 are now also confirmed via an ADN KB article (DD2011031801) and says it applies to the 2012 versions of AutoCAD, C3D, and Map 3D.