“尚未为此文档加载任何符号。”但他们有!

发布于 2024-10-31 21:30:27 字数 492 浏览 1 评论 0原文

您可以注意到

在此处输入图像描述

符号已正确加载。

我刚刚使用 AddView 短链接

enter image 创建了一个视图 <code>GetCompanies.cshtml</code>这里的描述

但是,无论我做什么,我都无法在视图中进行调试。

到目前为止我所做的:

  • 关闭并打开解决方案
  • 关闭并打开 Visual Studio
  • 关闭所有 ASP.NET 开发服务器
  • 删除所有符号库 .pdb
  • 清理解决方案
  • 重新构建解决方案

尚未关闭 Windows 7 x64 :-/

As you can notice

enter image description here

Symbols are been correctly loaded.

I just created a view GetCompanies.cshtml using the AddView shortlink

enter image description here

But, no matter what I do, I can't debug in the View.

What I did so far:

  • Close and Open Solution
  • Close and open Visual Studio
  • Shutdown all ASP.NET Development Server's
  • Deleted all Symbol Libraries .pdb
  • Clean Solution
  • Re-Build Solution

did not (yet) shutdown Windows 7 x64 :-/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(10

与风相奔跑 2024-11-07 21:30:27

有时,如果您遇到硬停止,Visual Studio 临时缓存将会被破坏。
通过删除这些文件夹来清除缓存:

C:\Windows\Microsoft.NET\Framework\<.net version>\Temporary ASP.NET Files\(ApplicationName)
C:\Windows\Microsoft.NET\Framework64\<.net version>\Temporary ASP.NET Files\(ApplicationName)

Sometimes if you have a hard stop, Visual Studio temp cache will be screwed.
Clear the cache by deleting these folders:

C:\Windows\Microsoft.NET\Framework\<.net version>\Temporary ASP.NET Files\(ApplicationName)
C:\Windows\Microsoft.NET\Framework64\<.net version>\Temporary ASP.NET Files\(ApplicationName)
咽泪装欢 2024-11-07 21:30:27

我在调试 silverlight 时时常发现相同的行为。我的解决方案是清理浏览器的缓存(在最新的 IE 上,单击滚轮按钮、开发人员工具),因为它有时会缓存二进制文件而不加载新文件。

或许与您的观点相同?

I am finding the same behavior from time to time when debugging silverlight. My solution is to clean the browser's cache (on latest IE click on the wheel button, Developer tools), as it sometimes will cache the binary files and not load the new ones.

Perhaps is could be the same with your views?

望笑 2024-11-07 21:30:27

尝试上述所有方法已经解决这个问题几个小时了。我最终将目标框架更改为 .NET Framework4.5,一切都开始神奇地工作。

Been messing with this problem for a couple hours trying everything above. I finally changed my Target Framework to .NET Framework4.5 and it all started magically working.

坠似风落 2024-11-07 21:30:27

这总是很奇怪。我刚刚遇到了这个问题,并通过完全重建整个解决方案来解决它。

不过,还有另一个奇怪的症状:我使用 NUnit 编写的新单元测试(用 NSubstitute 进行模拟)不会通过,因为 NSubstitute 没有返回我希望它返回的内容。我花了几分钟时间试图弄清楚我在 NSubstitute 编程中是否做错了什么,然后当我尝试将调试器附加到 NUnit GUI 时,我看到了该警告。

就在那时,我决定对解决方案进行全面重建,这对我很有用。

所以我想我们要吸取的教训是“在把头撞到墙上之前,尝试完全重建”。

This is always weird. I just had this problem and solved it with a full rebuild of the entire solution.

There was also another strange symptom, though: a new unit test that I had written using NUnit, mocking with NSubstitute, wouldn't pass because NSubstitute wasn't returning what I wanted it to return. I lost a few minutes trying to figure out if I did something wrong programming NSubstitute, then when I tried to attach the debugger to the NUnit GUI I saw that warning.

That's when I decided to do a full rebuild of the solution, and that worked for me.

So I guess the lesson to be learned is "before smashing your head against the wall, try a full rebuild".

一张白纸 2024-11-07 21:30:27

对我来说,我以某种方式将目标构建切换为 Release 而不是 Debug

For me, I somehow switched my target build to Release instead of Debug

偏爱自由 2024-11-07 21:30:27

请记住,视图实际上是在您请求页面时编译的(默认情况下)。

这意味着当您在视图中设置断点时:

  1. 它会显示“无符号”错误。 这只是意味着视图不是
    尚未编译。
  2. 它显示断点正常。 这仅仅意味着
    它找到了页面的某些编译版本。
    就像最后一个工作版本一样...

所以基本上,当您将鼠标悬停在视图中的断点上时查看它所说的内容并没有什么意义(至少在这个考虑)

如果您尝试调试此页面,那么您遇到了问题。查看调试器向浏览器输出的内容并首先修复该问题。我想我们会惊讶地发现有多少人会对此捂脸。

Remember that views are actually compiled when you request the page (by default).

This means when you set a breakpoint in a view:

  1. It shows the "No Symbols" error. This just means the view isn't
    compiled yet.
  2. It shows the breakpoint fine. This just means
    that it found SOME compiled version of the page.
    Like the LAST working version...

So basically its not meaningful information to look at what it says when you mouseover the breakpoint in a view (at least in this regard)

If you are trying to debug this page, then you have a problem. Look at what the debugger is outputting to your BROWSER instead and fix that first. I think we'll be surprised about how many people are going to facepalm at this.

酷到爆炸 2024-11-07 21:30:27

我在 SL5 项目(VS2012)中遇到了这个问题。为了解决这个问题,我需要在 Web 选项卡下的 %MyProjectName%.Web 项目属性中设置启用“Silverlight”选项。

在此处输入图像描述

I had this problem with SL5 project (VS2012). And to fix this, I was needed to set "Silverlight" option enabled in %MyProjectName%.Web project properties, under Web tab.

enter image description here

稳稳的幸福 2024-11-07 21:30:27

就我而言,.PDB 文件是在 VS 2012 中加载的(从中加载符号),因此执行清理和构建重建了 .PDB 文件,一切都再次开始工作。

In my case, the .PDB file was hosed (from which the symbols are loaded) in VS 2012, so performing a Clean and Build reconstructed the .PDB file and everything started workign again.

栀子花开つ 2024-11-07 21:30:27

我试图调试已部署的 WCF Windows 服务(在发布模式下编译)并遇到了完全相同的问题。尝试一下...

  1. 全部保存。您甚至可能想尝试清理解决方案
  2. 重新构建全部并安装或部署
  3. 在启动服务(或exe)之前我将.pdb文件复制到安装文件夹
  4. 启动服务(或exe)并将调试器附加到进程

工作对我来说(终于)就像一个魅力。

I was attempting to debug a deployed WCF windows services (compiled in Release mode) and had the exact same issue. Give this a shot...

  1. Save All. You may even want to try to clean the solution
  2. Rebuild all and install or deploy
  3. BEFORE starting the service (or exe) I copied the .pdb files over to the install folder
  4. Start the service (or exe) and attach the debugger to the process

Worked like a charm (finally) for me.

走野 2024-11-07 21:30:27

删除bin和obj目录
再次运行解决方案。
注意:除非 cshtml 在运行时加载,否则不会加载符号。页面加载时将命中断点。所以等到控制权转到该页面

delete bin and obj directories
run solution again.
Note: Unless that cshtml loads at runtime the symbols are not loaded. On page load that breakpoint will be hit. So wait till control goes to that page

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文