【问题标题】:@model doesn't exist in my view with VS2015 but work fine with VS2012@model 在我看来在 VS2015 中不存在,但在 VS2012 中可以正常工作
【发布时间】:2016-06-15 13:03:49
【问题描述】:

我有一个使用 Visual Studio 2012 创建的项目,它工作正常,但是当我使用 Visual Studio 2015 Entreprise Edition 打开它时,我不知道为什么,但在我的所有视图中@model、ViewBag & co 并没有存在 VS2015 说“'模型'在当前上下文中不存在”但是我的项目编译得很好并且可以工作。

print screen here, on the left side from VS2012 on the right side from VS2015, the same view in the same project

有人遇到过这个问题吗?

我的项目是一个带有 RazorViewEngine 的基本 ASP.NET MVC3 项目

【问题讨论】:

  • 您是否安装并启用了 resharper?如果是这样,请尝试禁用/暂停它?
  • 你更新了 VS 2015 更新 1 请更新你的视觉工作室,然后再试一次 :)
  • 不,我没有 Resharper
  • 是的 2015 是最新的。
  • Microsoft Visual Studio Enterprise 2015 版本 14.0.24720.00 更新 1 Microsoft .NET Framework 版本 4.6.01055

标签: asp.net visual-studio asp.net-mvc-3 visual-studio-2012 visual-studio-2015


【解决方案1】:

顺便说一下,@Html、@Html.Label、@Html.Hidden 以及 VS2015 中的基本工作。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多