【问题标题】:VS2010 ASP.MVC breakpoints not being hit in multiple site solutionVS2010 ASP.MVC 断点在多站点解决方案中未命中
【发布时间】:2012-01-12 08:51:10
【问题描述】:
我正在编写一个有多个项目的联合 Web 解决方案。调试一直运行良好,直到昨天突然(我不记得弄乱了任何关键的东西)我得到了“断点当前不会被命中”。在解决方案中的 3 个 ASP.MVC 项目中,没有为此文档的消息加载任何符号。
我在网上和这个网站上搜寻建议,这些都是我做过的事情。
- 已检查构建 > 配置管理器以确保正确的构建设置
- 检查项目 > 属性以确保 ASP.Net 为调试器勾选
- 检查了 Web.config 以确保 'compilation debug="true" targetFramework="4.0"'
- iisreset
- 已删除每个项目中的 bin 和 obj 目录
- 清理并重建解决方案
- 删除的内容
'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET
文件'
- 退出并重新启动 VS2010
- 哭得像个婴儿
在做完这些事情之后,3 个 ASP.MVC 项目中的 2 个可以正常调试,但我真正想要逐步完成的第 3 个和关键的是没有。
为您提供的其他信息
- 使用本地安装 IIS(不是 IIS express)
- Windows 7
- 带有所有服务包的 VS2010
- ReSharper 已安装
- Chrome 是我正在使用的浏览器
任何帮助表示赞赏。
【问题讨论】:
标签:
asp.net-mvc
debugging
c#-4.0
【解决方案1】:
这可能很明显,但它不在您所做的事情列表中,并且处于恐慌状态可能会被遗忘,但是您是否检查过 IIS 中的目录与代码 VS 中的目录相同加载了吗?
VS 应该重新创建站点(取决于项目设置),因此请尝试关闭 VS,删除站点,重新打开项目并让 VS 为您重新创建 IIS 站点。
【解决方案2】:
我已经找出了问题所在。
虽然最初的问题是所有项目都没有调试联邦项目,但事实证明这是一个特例。我一直在休假,忘记了我的网络配置中有这个
<federatedAuthentication>
<!--
<wsFederation passiveRedirectEnabled="false" issuer="https://localhost/FederationProvider/"
realm="https://localhost/Application/Home/FederationResult" requireHttps="true" />
-->
<wsFederation passiveRedirectEnabled="false" issuer="https://localhost/Issuer/"
realm="https://localhost/Application/Home/FederationResult" requireHttps="true" />
<cookieHandler requireSsl="true" path="/Application/" />
</federatedAuthentication>
当我更改它以便我直接使用联邦而不是发行者时,调试器可以工作。
<federatedAuthentication>
<wsFederation passiveRedirectEnabled="false" issuer="https://localhost/FederationProvider/"
realm="https://localhost/Application/Home/FederationResult" requireHttps="true" />
<!--
<wsFederation passiveRedirectEnabled="false" issuer="https://localhost/Issuer/"
realm="https://localhost/Application/Home/FederationResult" requireHttps="true" />
-->
<cookieHandler requireSsl="true" path="/Application/" />
</federatedAuthentication>
我觉得自己很愚蠢,没有早点意识到这一点。 VS2010 太聪明了。