VS2015 ASP.NET MVC名称为“模式”并不在当前的背景下存在 [英] VS2015 ASP.NET MVC the name 'model' does not exist in the current context

查看:201
本文介绍了VS2015 ASP.NET MVC名称为“模式”并不在当前的背景下存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的一个ASP.NET MVC 4在VS2013和一切都很好,然后我卸载了2013年和2015年安装的,我能打开项目,构建它,甚至可以运行,一切正常(运行/调试)。问题是,我所有的意见都包含在错误:

I was working on an ASP.NET MVC 4 in VS2013 and everything was fine, then I've uninstalled 2013 and installed 2015, I was able to open the project, build it and even run, everything works fine (run/debug). The problem is that all my views are covered in errors:

the name 'model\Scripts\Url...' does not exist in the current context  

在另外,在模型列表的。凡方法示出了一个错误,以及所有的@Html帮手。我想强调的是,该项目仍然工件W \\ o任何问题,所以这个问题是相关的UI或包装。我试图强制卸载\\升级Microsoft.AspNet.MVC但包管理器控制台将引发错误并回滚尝试。我可以提供任何必要的信息,如果有帮助,谢谢你在前进。

In addition, the .Where method of a list in the model shows an error as well as all the @Html helpers. I want to emphasize that the project still works w\o any problems so the issue is UI or package related. I tried to force uninstall\upgrade Microsoft.AspNet.MVC but the package manager console throws an error and rolls back the attempt. I can provide any necessary info if it helps, thank you in advance.

推荐答案

新推出的VS2015 IDE似乎不再支持MVC3 / MVC4项目,同时它仅支持MVC5:

The newly released VS2015 IDE seems to no longer support MVC3/MVC4 projects, while it only supports the MVC5:

无法找到MVC3,MVC4,MVC5项目(或)有关支持MVC暂无信息框架版本

如果有严格的要求将任何现有MVC3 / 4的解决MVC5(对于2015年VS),你可以在列出的步骤进行
<一href=\"http://www.asp.net/mvc/overview/releases/how-to-upgrade-an-aspnet-mvc-4-and-web-api-project-to-aspnet-mvc-5-and-web-api-2\"相对=nofollow>如何升级ASP.NET MVC 4和Web API项目到ASP.NET MVC 5和Web API 2 指南。

If there are strict requirements to convert any existing MVC3/4 solution to MVC5 (for VS 2015), you can proceed with the steps listed in the How to Upgrade an ASP.NET MVC 4 and Web API Project to ASP.NET MVC 5 and Web API 2 guide.

似乎安装 VS 2015 SP2 更新,它的表现要好得多。如果你有机会的话,我建议你升级你的IDE和检查问题是否会消失。

It seems that after installing the VS 2015 SP2 update, it behaves much better. If you have a chance, I suggest that you upgrade your IDE and check if the issue goes away.

这篇关于VS2015 ASP.NET MVC名称为“模式”并不在当前的背景下存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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