Add ins Edit code while Debugging

if you didn't know already, you can edit your .net code while debugging.  I don't remember being able to do this before visual studio 2010. i upgraded to visual studio 2017 and bam.  I was able to edit the code while running it live.  you cannot do it if you attach to process. Only if you launch Solidworks from visual studio using the Debugger in visual studio.

talk about a huge time saver.

there is a possible thing you will have to change.

all solidworks.interop.sldworks dll have to be set to Embed Interop Types = False.

if you knew this already,  cool. if not then you should. it is a huge time saver.

SolidworksApi macros
Comments 6
CA
CA 2018-05-10

Hi Jacob,

I'm trying to do this in a C# Add In (VS 2017), because I loved to have the "Edit and Continue" feature in VS2010 32 bit, as it was really easy and quick to test and correct code.

I have changed as you mencioned Embed Interop Types = False. But now I'm getting a lot of cast to do, as it displays a lot of "Cannot implicitly convert type" errors in the Error List window!

Is there any easy way to workaround this? Or do I really have to cast all this stuff?

JS
JS 2018-05-10
<p>Jacob Corder wrote:</p><p></p><p>if you didn't know already, you can edit your .net code while debugging. I don't remember being able to do this before visual studio 2010. i upgraded to visual studio 2017 and bam. </p>

Support for 64-bit Edit and Continue was added to Visual Studio in version 2013.

JC
JC 2018-05-10

i think you just need to turn off option strict

as ​ said below, it wont be available until 2013.

Thanks for the info Jim

CA
CA 2018-05-10

Unfortunately it is not possible to do it in C#. That Option is VB.Net specific.

It was really needed to cast every single "dynamic" that turned into "object" type after setting "Embed Interop Types = False".

JC
JC 2018-05-10

you should just add Includes or imports or whatever you C# guys use.

CA
CA 2018-05-11

That's not the solution for this case.

The issue here is that C# is always strict!

And in C# there is no chance to change this validation as in VB.Net.