Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

VS Package Debugging Issue

$
0
0
I just brought two of my add-ins (C#, VS 2010) into a new VS Package project.  It went quite well and the two commands seem to work the same as they did as add-ins.  I didn't have to change the code at all, except for some minor adjustments because of differences in infrastructure between add-ins and VS packages.

I did encounter one interesting problem which makes debugging these add-ins when inside the VS Package environment impossible.

With add-ins, the DTE2 object is provided as part of the add-in architecture.

With VS Packages, one may obtain the DTE2 object as follows:

DTE2 AppObject = (DTE2)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.10.0");

This works just fine for the finished VSIX installed extensions.

Unfortunately, however, when attempting to debug a VS Package, the DTE2 object returned is that of the debug instance of visual studio and not that of the test instance.  When debugging add-ins, on the other hand, the provided DTE2 object is, correctly, that of the test instance of visual studio.

While I understand that it is Microsoft's position that VS Packages are preferable to add-ins, it is clear that not being able to debug a VS Package when the DTE2 object is used, is a serious problem and one, I must add, that does not exist with the deprecated add-in architecture.

Charles S. Cotton


Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>