How can I run FxCop against an ASP.net Web-site?
I have an ASP.net Web-site that I want to run FxCop against.
Note: I have an ASP.net web-site, not an ASP.net web-application, that I want to run FxCop against.
How can I run FxCop against an ASP.net web-site in Visual Studio 2010 Professional?
Some people suggest that it's very simple: just right-click the web-site project, and click Run Code Analysis on Web Site:
The process it very simple.... just right click on the web site project and "Run Code Analysis on Web Site"
What they ignore is that no such option exists:
I also tried Tools menu -> FxCop. But of course that doesn't work because its command line options:
FxCopCmd.exe /c /f:$(TargetPath) /d:$(BinDir) /r:"C:\Program Files (x86)\Microsoft Fxcop 10.0\Rules"
Doesn't make sense for web-sites.
Someone has suggested, correctly, that it's not possible, because there is no assembly for FxCop to validate:
The build process in ASP.NET 2.0 is very different than in ASP.NET 1.x, because it does not produce a dll file.
That means that you cannot use FxCop because it can only work with dll and exe file types.
That means that short of compiling the entire web-site into an assembly, you cannot run FxCop against an ASP.net web-site.
How can I run FxCop against an ASP.net web-site?
A workaround is to pre-compile your web site,
You could not see the "Run Code Analysis on Web Site" because your Visual Studio edition is not high end enough (Microsoft should be blamed as such essential features should be there in all editions).