`
yingyingol
  • 浏览: 744717 次
文章分类
社区版块
存档分类
最新评论

Visual Studio 2008 Beta 2在Web站点上启动调试的问题

 
阅读更多
zz from:http://www.cnblogs.com/andersliu/archive/2007/08/03/unable_to_start_debugging_on_the_web_server-strong_name_validation_failed.html


摘要
   本文解决使用Visual Studio 2008 Beta 2调试IIS7 (Vista)站点时发生的“Unable to start debugging on the web server. 强名称验证失败。”问题。(英文版提示文字:Unable to start debugging on the web server. Strong name validation failed.)

环境
  Vista Ultimate/Business、IIS 7.0、Visual Studio 2008 Beta 2 (en)。
  调试方法为,让Visual Studio(除非特殊制定,否则在本文中都表示Visual Studio 2008 Beta 2,下同)不启动任何调试页,而是监视http://localhost/上的请求;在IIS中配置一个站点指向Web目录,并为该目录设置了足够的权限。

问题
  在Visual Studio中按F5启动调试,弹出如下对话框:

---------------------------
Microsoft Visual Studio
---------------------------
Unable to start debugging on the web server. 强名称验证失败。

Click Help for more information.
---------------------------
确定 帮助
---------------------------

(此处出现中文是因为操作系统为中文版。)

原因
  这是由于Visual Studio文件(iisresolver.dll)的强名称验证造成的。禁用其即可。

解决方案
  1 以管理员身份打开命令提示符窗口(如遇UAC提示,请单击“继续”)。
  2 定位到sn.exe的目录,运行如下命令:

"<path_to_sn>/sn.exe" -Vr "%ProgramFiles%/Microsoft Visual Studio 9.0/Common7/IDE/iisresolver.dll"

  3 当屏幕上出现如下文字后,重新启动Visual Studio即可。

C:/Windows/system32>sn.exe -Vr "C:/Program Files/Microsoft Visual Studio 9.0/Com
mon7/IDE/iisresolver.dll"

Microsoft (R) .NET Framework Strong Name Utility Version 3.5.20706.1
Copyright (c) Microsoft Corporation. All rights reserved.

Verification entry added for assembly 'iisresolver,B03F5F7F11D50A3A'

  (最后的数字“B03F5F7F11D50A3A”可能会随您的环境有所变化。)

说明
  1 sn.exe是随Visual Studio 2005或.NET Framework 2.0 SDK一同发布的,可以从这里获取SDK:(x86)http://www.microsoft.com/downloads/details.aspx?FamilyID=FE6F2099-B7B4-4F47-A244-C96D69C35DEC,(x64)http://www.microsoft.com/downloads/details.aspx?FamilyId=1AEF6FCE-6E06-4B66-AFE4-9AAD3C835D3D
  2 随着sn.exe所在的目录,以及Visual Studio的安装目录的不同,请修改上述命令中对应的路径。

版权和感谢
  本文所提到的解决方案来自:http://forums.asp.net/p/1139555/1835456.aspx。【后添加:当然,最初的解决方案还是微软提供的,在这里:http://download.microsoft.com/download/d/d/1/dd18043a-fe86-4f57-ac22-791b30e6f04b/ExpressReadme.htm,参见其中的“2.3.5.2 Strong name validation failed error when launching IIS project on Windows Vista ”一节,感谢Webdiyer提醒!(前面的论坛帖子中也给出了这个链接。)】
  感谢QQ昵称为Webdiyer的MVP告诉我这个解决方案!

写作动机
  我在遇到这个问题后,第一想到的也是搜索引擎,但由于提示中出现中文文字,所以没有搜索到解决方案。但又没有足够的水准猜测出英文的提示文字。因此在解决了这一问题后,撰写本文,望其他使用中文版操作系统的朋友能够搜索到。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics