简体   繁体   English

VS2010卸载后的ASP.NET MVC调试

[英]ASP.NET MVC debugging following VS2010 uninstall

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,但注意到如果尝试在我的任何视图模型(“模型”文件夹中的类)上设置断点,则会收到有关调试符号的错误消息。

"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. 所以我想问题是,models文件夹中的视图模型有什么独特之处,导致无法加载断点。

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)中的哪一个导致了问题!

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!). 所有其他断点都工作正常(我是个白痴!)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM