English 中文(简体)
视觉工作室调试器未通知的错误财产名?
原标题:Wrong Model property name in view not notified by visual studio debugger?

为了解释我的问题 举个例子比较好

I have an ASP.NET MVC 3 controller action who return a view with an object as a Model. This object, contains some business properties used by the view like a list of contacts, for example.

If i call a property of my object in the view (from Model.) and, after that, I change this property name, the debugger of visual studio say nothing. However, this one should alert me that I try to load, in the view, a property who doesn t exist !

此外,当我编集这个项目时,它会一直持续到我试图提出观点为止。

有办法从视觉工作室查看吗?

感谢提前!

最佳回答

http://www.stefanprodan.eu/2011/05/compile-views-in-asp-asp-net-mvc-3-with-visual-studio/"rel=“nofollow”> 包含您 ASP.NET MVC 观点的汇编 ,在您的 .csproj 中加入以下内容:

<MvcBuildViews>true</MvcBuildViews>

这样您就会发现一个编译时间错误 。

问题回答

您可以以 releasure 模式编译, 以突出显示所有交易断开器。 编辑要长一点, 但要捕捉一切, 直到视图中的属性, 甚至将您带到视图中引发问题的行 。





相关问题
WebForms and ASP.NET MVC co-existence

I am trying to make a WebForms project and ASP.NET MVC per this question. One of the things I ve done to make that happen is that I added a namespaces node to the WebForms web.config: <pages ...

Post back complex object from client side

I m using ASP.NET MVC and Entity Framework. I m going to pass a complex entity to the client side and allow the user to modify it, and post it back to the controller. But I don t know how to do that ...

Create an incremental placeholder in NHaml

What I want to reach is a way to add a script and style placeholder in my master. They will include my initial site.css and jquery.js files. Each haml page or partial can then add their own required ...

asp.net mvc automapper parsing

let s say we have something like this public class Person { public string Name {get; set;} public Country Country {get; set;} } public class PersonViewModel { public Person Person {get; ...

structureMap mocks stub help

I have an BLL that does validation on user input then inserts a parent(PorEO) and then inserts children(PorBoxEO). So there are two calls to the same InsertJCDC. One like this=>InsertJCDC(fakePor)...

ASP.NET MVC: How should it work with subversion?

So, I have an asp.net mvc app that is being worked on by multiple developers in differing capacities. This is our first time working on a mvc app and my first time working with .NET. Our app does not ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

热门标签