问题描述
我如何运行的FxCop针对ASP.net的Web站点?
How can I run FxCop against an ASP.net Web-site?
我有一个ASP.net的Web站点,我想针对其运行的FxCop。
I have an ASP.net Web-site that I want to run FxCop against.
注意:我有一个ASP.net网站,而不是ASP.net Web的应用程序,我想针对其运行的FxCop。
Note: I have an ASP.net web-site, not an ASP.net web-application, that I want to run FxCop against.
我如何在Visual Studio 2010中运行的FxCop针对ASP.net网站专业?
How can I run FxCop against an ASP.net web-site in Visual Studio 2010 Professional?
有人建议的,它是非常简单的:只需右键点击网站项目,然后单击生成code分析/ STRONG>:
Some people suggest that it's very simple: just right-click the web-site project, and click Run Code Analysis on Web Site:
这很简单....只是右键点击网站项目的过程和网站运行code分析
他们忽略了什么是没有这样的选择存在:
我也试过工具菜单 - > 的FxCop 。不过,当然,这并不因为它的命令行选项工作:
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"
无厘头的web站点。
Doesn't make sense for web-sites.
的,正确的,这是不可能的,因为没有装配为FxCop的验证
Someone has suggested, correctly, that it's not possible, because there is no assembly for FxCop to validate:
在ASP.NET 2.0中的构建过程比ASP.NET 1.x中非常不同的,因为它不会产生一个dll文件。
这意味着你不能使用FxCop的,因为它只能与DLL和EXE的文件类型。
That means that you cannot use FxCop because it can only work with dll and exe file types.
这意味着,短期编译整个网站到一个程序集中,你不能对一个ASP.net网站运行的FxCop。
That means that short of compiling the entire web-site into an assembly, you cannot run FxCop against an ASP.net web-site.
我如何运行的FxCop针对ASP.net网站?
How can I run FxCop against an ASP.net web-site?
推荐答案
一个解决方法是pre-编译你的网站,
A workaround is to pre-compile your web site,
- pre-编译使用aspnet_compiler.exe你的网站,的
- 在precompilation的结果运行的FxCop。
您看不到了网站运行code分析,因为您的Visual Studio版本不高到底够不够(微软应该被指责为这些基本功能应该在所有版本在那里)。
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).
这篇关于针对ASP.net网站运行的FxCop?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!