Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to debug VSIX project

I'm trying to develop my first visual studio extensions project, I have VS10 SDK installed and was able to create a new project and can build it fine, however when I attempt to debug symbols are not loaded. I know that I can debug to VSIX project since I have downloaded a sample project online and it symbols are loaded and break points are being hit fine http://weshackett.com/2009/11/configure-vsix-project-to-enable-debugging/). So must be something specifically to do with the way I have created the VSIX project ( maybe !). One thing I do notice is that the dll and files aren't being copied over to the local "Application Data" area, only the manifest is being copied over, while for the sample project, all files are being copied over including the dll. I have compared project settings between both and they are both the same. I hope it makes sense, if I can provide any more detail then let me know...

like image 211
Rubans Avatar asked Oct 14 '11 11:10

Rubans


People also ask

What is a VSIX file?

A VSIX package is a . vsix file that contains one or more Visual Studio extensions, together with the metadata Visual Studio uses to classify and install the extensions. That metadata is contained in the VSIX manifest and the [Content_Types]. xml file. A VSIX package may also contain one or more Extension.

How do I create a VSIX project in Visual Studio?

Select File > New > Project. In the search box, type "vsix" and select either the C# or Visual Basic version of VSIX Project.

How do I create a VSIX file?

step 1: create a vsix projectselect file->new->project. now, in the templates, navigate to extensibility and select vsix project. note that these templates are shown here because we modified visual studio configuration to use visual studio extensibility. select 'vsix project' and give it a name.


2 Answers

OK I managed to get it working. In order to do so, I had to unload the vsix project and edit the file as an XML document.

Either remove the following lines from the project file:

<IncludeAssemblyInVSIXContainer>
    false
</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>
    false
</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>
    false
</IncludeDebugSymbolsInLocalVSIXDeployment>
<CopyBuildOutputToOutputDirectory>
    false
</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>
    false
</CopyOutputSymbolsToOutputDirectory>

or set them to true:

<IncludeAssemblyInVSIXContainer>
    true
</IncludeAssemblyInVSIXContainer>
<IncludeDebugSymbolsInVSIXContainer>
    true
</IncludeDebugSymbolsInVSIXContainer>
<IncludeDebugSymbolsInLocalVSIXDeployment>
    true
</IncludeDebugSymbolsInLocalVSIXDeployment>
<CopyBuildOutputToOutputDirectory>
    true
</CopyBuildOutputToOutputDirectory>
<CopyOutputSymbolsToOutputDirectory>
    true
</CopyOutputSymbolsToOutputDirectory>

or add them under the ... node if they don't exist.

Once I removed these lines and rebuilt the solution, the dll and pdb were copied now as expected to the bin\debug folder as well as to the "AppData\Local\Microsoft\VisualStudio\10.0Exp\Extensions\" folder.

like image 146
Rubans Avatar answered Sep 23 '22 17:09

Rubans


Been there.. in VS-2019 I'm developing a VSIX Async which worked fine, however at a certain point, Visual Studio Experimental Version stopped loading my VSIX in debug mode.

I am not sure of the root cause, but it coincided with opening a second VSIX project template in the same solution of Visual Studio. Don't know if that has anything to do with the issue, but on the first run, I found both VSIX-es loaded into the Experimental version session. At that point, I closed and reset the Experimental Version. On the next runs, no VSIX seemed to be loaded into the Experimental Version, when debugging.. very frustrating !

The solution I found, fiddling around

  • close any instances of Visual Studio
  • reset the Visual Studio Experimental Version using the commandline tool in Start menu.
  • Open VS, load your VSIX solution
  • clean your VSIX solution
  • switch to Release mode (yes, do it..)
  • Rebuild Solution then run
  • on the Just my Code warning popup, choose Continue Debugging
  • The Experimental Version will now start with your VSIX ! it is loaded !
  • Release mode is not handy when debugging. Close the Exp version You will be back in your VSIX solution
  • Switch back to Debug mode
  • run again

For me, above sequence lets the problem disappear. VSIX is loaded as it should.

like image 22
Goodies Avatar answered Sep 24 '22 17:09

Goodies