OK this is an odd one.
好的,这是一个奇怪的。
I wanted to install ASP.NET MVC 2 Beta 2, so I uninstalled VS2010 Beta 2 (which I wasn't using anyway) and installed MVC 2.
我想安装ASP.NET MVC 2 Beta 2,所以我卸载了VS2010 Beta 2(我没有使用它)并安装了MVC 2。
I then upgraded one of my projects to MVC 2 but noticed that if I try to set a breakpoint on any of my view models (classes in the Models folder) I get an error message about debug symbols.
然后我将我的一个项目升级到MVC 2,但注意到如果我尝试在我的任何视图模型(Models文件夹中的类)上设置断点,我会收到有关调试符号的错误消息。
"The breakpoint will not currently be hit..."
“断点目前不会被击中......”
Then I tried to debug one of my old MVC 1 projects and noticed the same symptom.
然后我尝试调试我的一个旧的MVC 1项目并注意到相同的症状。
I've now uninstalled MVC beta 2, repaired Visual Studio 2008 and still get this with my existing projects.
我现在已经卸载了MVC beta 2,修复了Visual Studio 2008并且仍然使用我现有的项目。
What's especially strange is that breakpoints anywhere else in the project (controllers, helper methods etc) ARE being hit successfully.
特别奇怪的是,项目中的其他任何地方的断点(控制器,辅助方法等)都被成功击中。
So I guess the question is, what is unique about my view models in the models folder that is causing breakpoints to not be loaded.
所以我想问题是,我在模型文件夹中的视图模型有什么独特之处,导致断点无法加载。
Here is an example view model...
这是一个示例视图模型......
using System.Collections.Generic;
using System.Web.Mvc;
using MountKitSearch.Core.DTO.MountKit;
namespace MountKitSearch.Web.ViewModels
{
public class MountKitSearchViewModel
{
public string Distributor { get; set; }
public SelectList VehicleMakes;
public SelectList VehicleModels;
public SelectList VehicleTypes;
public SelectList VehicleEngines;
public ICollection<MountKitDetailsDTO> MountKits;
}
}
Unfortunately I'm not sure which of the two events (uninstalling VS2010, installing MVC2) caused the problem!
不幸的是我不确定这两个事件中的哪一个(卸载VS2010,安装MVC2)导致了这个问题!
1 个解决方案
#1
1
Attempting to debug an Automatic Property was actually the cause of this error.
尝试调试自动属性实际上是导致此错误的原因。
There is no good reason to debug an automatic property (as by definition they contain no logic).
没有充分的理由来调试自动属性(根据定义它们不包含逻辑)。
All other breakpoints are working fine (and I am an idiot!).
所有其他断点工作正常(我是个白痴!)。
#1
1
Attempting to debug an Automatic Property was actually the cause of this error.
尝试调试自动属性实际上是导致此错误的原因。
There is no good reason to debug an automatic property (as by definition they contain no logic).
没有充分的理由来调试自动属性(根据定义它们不包含逻辑)。
All other breakpoints are working fine (and I am an idiot!).
所有其他断点工作正常(我是个白痴!)。