针对ASP.net网站运行的FxCop? [英] Run FxCop against ASP.net web-site?

查看:252
本文介绍了针对ASP.net网站运行的FxCop?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何运行的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?

<一个href=\"http://social.msdn.microsoft.com/forums/en-US/asmxandxml/thread/737febfb-c142-4056-bf82-728d58ce8760\"相对=nofollow>有人建议的,它是非常简单的:只需右键点击网站项目,然后单击<关于网站生成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分析

The process it very simple.... just right click on the web site project and "Run Code Analysis on Web Site"

他们忽略了什么是<一个href=\"http://social.msdn.microsoft.com/forums/en-US/asmxandxml/thread/737febfb-c142-4056-bf82-728d58ce8760\"相对=nofollow>没有这样的选择存在:

我也试过工具菜单 - > 的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文件。

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.

这意味着你不能使用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,


  1. pre-编译使用aspnet_compiler.exe你的网站,的 http://msdn.microsoft.com/en-us/library/bb398860(v = VS.100)的.aspx

  2. 在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?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆