Visual Studio剃刀视图无法识别模型 [英] visual studio razor views not recognizing model

查看:85
本文介绍了Visual Studio剃刀视图无法识别模型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个VisualStudio 2010实例打开,并且两个项目都是ASP.Net MVC,并且我正在使用Razor视图引擎.在第一个实例中,视图正在识别@model的值,并且我得到了智能感知.第二个实例无法识别该视图的模型,并且没有智能感知.我知道我为模型拥有正确的名称空间,因为我可以运行应用程序并获取结果.我缺少什么设置?谢谢.

I have 2 instances of VisualStudio 2010 open and both projects are ASP.Net MVC and I'm using Razor view engine. In the first instance, views are recognizing @model value and I get intellisense. The second instance does not recognize the model for the view and no intellisense. I know i have the right namespace for the model because I can run the app and get results. What setting am I missing? Thank you.

推荐答案

今天我刚刚在VS2013中解决了这个问题; .csproj文件已将所有引用都设置为Private(= True),并以这种方式混淆了自身.消除所有的私有标记(并设置SpecificVersion = False)使Visual Studio再次清楚地思考.

I just fought through this with VS2013 today; the .csproj file had set all of the references to Private (=True) and confused itself that way. Eliminating all of the Private markers (and setting SpecificVersion = False) got Visual Studio thinking clearly again.

引用再次显示为Private = True,但Razor语法尚未再次分解(尚未).

The references are once again showing up as Private = True, but the Razor syntax hasn't broken down again (yet).

这篇关于Visual Studio剃刀视图无法识别模型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆