简体   繁体   中英

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.

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.

"The breakpoint will not currently be hit..."

Then I tried to debug one of my old MVC 1 projects and noticed the same symptom.

I've now uninstalled MVC beta 2, repaired Visual Studio 2008 and still get this with my existing projects.

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!

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!).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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