类型或命名空间名称“Mvc"不存在 [英] The type or namespace name 'Mvc' does not exist

查看:24
本文介绍了类型或命名空间名称“Mvc"不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近安装了visual studio 2013.从网上下载了一个示例项目后,当我运行它时,它给了我以下错误-

I have recently installed visual studio 2013. After downloaded a sample project from web, while i run it, it gives me the following errors-

The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)  

如何克服这个错误?

推荐答案

您的错误来源可能是您没有对 MVC 框架库的引用.一个简单的解决方案是通过 Nuget 添加此引用槽.MVC 库将安装在您的 bin 目录中,如果需要,所有引用都将添加到您的项目中.

The source of your error may be that you do not have a reference to the MVC framework library. A simple solution is to add this reference trough Nuget. The MVC library will be installed in your bin directory and, if needed, all the references will be added to your project.

浏览 MVC 包(工具 -> Nuget 包管理器 -> 管理解决方案的 Nuget 包)或使用 Nuget 控制台安装它(工具 -> Nuget 包管理器 ->包管理器控制台),输入 Install-Package Microsoft.AspNet.Mvc.您可以在 AspNet.Mvc 的官方 Nuget 页面上找到更多信息.

Either browse for the MVC package (Tools -> Nuget Package Manager -> Manage Nuget Packages for Solution) or install it using the Nuget console (Tools -> Nuget Package Manager -> Package Manager Console) by entering Install-Package Microsoft.AspNet.Mvc. You can find additional information on the official Nuget page for AspNet.Mvc.

这篇关于类型或命名空间名称“Mvc"不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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