I tried to create T-SQL Static Code Analysis Rules in Visual Studio 2010 to analyze T-SQL code in Visual Studio 2010 database project. But I couldn’t find a way to debug them.
Does anyone know how to debug these rules?
Join Stack Overflow to learn, share knowledge, and build your career.
I tried to create T-SQL Static Code Analysis Rules in Visual Studio 2010 to analyze T-SQL code in Visual Studio 2010 database project. But I couldn’t find a way to debug them.
Does anyone know how to debug these rules?
You need to run another instance of VS2010 and open a dbproj to debug. You can do this by setting Debug option to "Start External Program" and point it to VS2010 exe (C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe). Hope this is what you are looking for..
I found this blog post which covers how to make and debug tsql static code analysis. Good luck! http://blogs.msdn.com/b/gertd/archive/2009/01/01/creating-t-sql-static-code-analysis-rules.aspx
Here are the important bits in a nutshell:
Start with a project that builds and works I'd hope
From a working project, create post build tasks:
copy "$(TargetDir)$(TargetName)$(TargetExt)" "$(ProgramFiles)\Microsoft Visual Studio 10.0\VSTSDB\Extensions\$(TargetName)$(TargetExt)" /y
copy "$(ProjectDir)$(TargetName).Extensions.xml" "$(ProgramFiles)\Microsoft Visual Studio 10.0\VSTSDB\Extensions\$(TargetName).Extensions.xml" /y
(the article mentions copying these files to your GAC, but I didn't need to do that)
Start Action – Start external program “C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe”
Peace.