HOW TO: Use F5 debugging

  • Set the VSIXProject as the startup project
  • Open the Properties page for the VSIXPoject and set the debug to start devenv.exe (either VS2010 or VS2012)
  • Use arguments of /rootsuffix Exp
  • Set breakpoints anywhere you like
  • Hit F5


Note
If you want to debug the StyleCop.ReSharper plugin then start devenv with arguments like :
/rootsuffix Exp /ReSharper.Internal /ReSharper.Plugin "<pathToYourRootStyleCopFolder>\Project\bin\<Configuration>\StyleCop.ReSharper700.dll"
where <pathToYourRootStyleCopFolder> is where you enlisted your sourcecode (normally like c:\dev\stylecop-main) and
<Configuration> is Debug or Release depending on which you're building (normally Debug)

So cmd line arguments like this are not uncommon:
/rootsuffix Exp /ReSharper.Internal /ReSharper.Plugin "C:\Dev\stylecop-main\Project\bin\Debug\StyleCop.ReSharper700.dll"

Examples:

VS2012
external program:
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe
Command line arguments:
/rootsuffix exp /ReSharper.Plugin "C:\Dev\StyleCop-main\Project\bin\Debug\StyleCop.ReSharper700.dll"
"C:\Users\andy\Documents\Visual Studio 11\Projects\ConsoleApplication1\ConsoleApplication1.sln"

VS2010
external program:
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
Command line arguments:
/rootsuffix exp /ReSharper.Plugin "C:\Dev\StyleCop-main\Project\bin\Debug\StyleCop.ReSharper611.dll" "C:\Users\andy\Documents\Visual Studio 2010\Projects\SolutionAlpha\SolutionAlpha.sln"

VS2008
external program:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe
Command line arguments:
/ReSharper.Plugin "C:\Dev\StyleCop-main\Project\bin\Debug\StyleCop.ReSharper611.dll" "C:\Users\andy\Documents\Visual Studio 2008\Projects\ClassLibrary1\ClassLibrary1.sln"

Note
You won't get the StyleCop context menus when debugging VS2008

To get the context menus for VS2008 debugging then build solution as normal.
Run the following as a reg file
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Packages\{629EB7CC-69C2-43AC-9BC9-482B0F810C4E}]
"ID"=dword:000000c8
"ProductVersion"="4.7"
"MinEdition"="Standard"
"ProductName"="StyleCop"
"CompanyName"="stylecop.codeplex.com"
"Class"="StyleCop.VisualStudio.StyleCopVSPackage"
@="StyleCop.VisualStudio.StyleCopVSPackage, StyleCop.VSPackage, Version=4.7.28.0, Culture=neutral, PublicKeyToken=f904653c63bc2738"
"InprocServer32"="C:\\Windows\\SysWOW64\\mscoree.dll"
"CodeBase"="C:\\Dev\\StyleCop-main\\Project\\bin\\Debug\\StyleCop.VSPackage.dll"

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\AutoLoadPackages\{F1536EF8-92EC-443C-9ED7-FDADF150DA82}]
"{629EB7CC-69C2-43AC-9BC9-482B0F810C4E}"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\AutoLoadPackages\{ADFC4E64-0397-11D1-9F4E-00A0C911004F}]
"{629EB7CC-69C2-43AC-9BC9-482B0F810C4E}"=dword:00000000

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\9.0\Menus]
"{629EB7CC-69C2-43AC-9BC9-482B0F810C4E}"=", 1000, 1"

Open a cmd prompt for VS2008 and run devenv.exe /setup

Start VS2008

Go back to VS2010 and attach the debugger to the VS2008 devenv process

Last edited Jul 26, 2012 at 11:31 AM by andyr, version 9