CS0234:的mvc不System.Web命名空间存在 [英] CS0234: Mvc does not exist in the System.Web namespace

查看:78
本文介绍了CS0234:的mvc不System.Web命名空间存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我根据专业ASP.NET MVC 3.5,由Scott Hanselmen,菲尔哈克和罗布科纳,发布由Wiley出版公司的第13章转换一个ASP.net Web窗体4项目Asp.net MVC4(ISBN :978-0-470-38461-9)。我也跟着这个博客。现在,我可以添加控制器,视图,等所有的引用设置正确。没有生成错误。但在启动转换后的项目中,我得到了编译错误。我已经安装在同一台机器上MVC3。我甚至改变了参考的。它仍然抱怨。你能帮忙吗?谢谢你。

 说明:该请求提供服务所需资源的编译过程中出现错误。请检查下列特定错误详细信息并适当地修改源$ C ​​$ C。编译器错误信息:CS0234:类型或命名空间名称的mvc'不命名空间中存在'System.Web程序(是否缺少程序集引用?)源错误:109线:其中,命名空间>
线110:或其可添加空间=System.Web.Helpers/>
111线:其中,添加命名空间=System.Web.Mvc/>
行112:其中,添加命名空间=System.Web.Mvc.Ajax/>
113线:其中,添加命名空间=System.Web.Mvc.Html/>源文件:C:\\用户\\乔恩\\文档\\ Visual Studio 2012中\\项目\\ CMT \\ APPS \\分行\\ 3.0 \\ web.config行:111


解决方案

在部署Web应用程序到服务器,所以你必须检查,如果你已经安装MVC3可能发生此问题。

检查文件夹 C:\\ Program Files文件\\微软ASP.NET \\ ASP.NET MVC 3 存在

如果它不存在,你需要从安装<一个href=\"http://www.microsoft.com/en-us/download/details.aspx?id=1491\">http://www.microsoft.com/en-us/download/details.aspx?id=1491


如果你不会安装,您可以在bin文件夹添加本地所有DLL,并添加对它们的引用这项工作很好,如果你的主机服务器上不部署ASP.NET网页或MVC3。

I converted a ASP.net 4 webform project to Asp.net MVC4 according to Chapter 13 of the Professional ASP.NET 3.5 MVC, by Scott Hanselmen, Phil Haack, and Rob Conery, Published by Wiley Publishing, Inc. (ISBN: 978-0-470-38461-9). I also followed this blog. Now I can add Controllers, Views, etc. All the references are set properly. No build errors. But upon launching the converted project, I got compilation errors. I have mvc3 installed on the same machine. I even changed the reference to that. It still complain. Could you help? Thanks.

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

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

Source Error:

Line 109:            <namespaces>
Line 110:                <add namespace="System.Web.Helpers"/>
Line 111:                <add namespace="System.Web.Mvc"/>
Line 112:                <add namespace="System.Web.Mvc.Ajax"/>
Line 113:                <add namespace="System.Web.Mvc.Html"/> 

Source File: c:\Users\Jon\Documents\Visual Studio 2012\Projects\CMT\Apps\Branches\3.0\Web.config    Line: 111 

解决方案

This problem can happen when you deploy your web application to a server, so you must check if you already installed MVC3.

Check if the folder C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 3 exists.

If it doesn't exist, you need to install it from http://www.microsoft.com/en-us/download/details.aspx?id=1491


If you wont to install you can add all DLLs locally in bin folder and add references to them this work fine if you host on server don't deploy ASP.NET Web Pages or MVC3.

这篇关于CS0234:的mvc不System.Web命名空间存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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