类型或命名空间名称'的ViewPage'不命名空间中存在'System.Web.Mvc“ [英] The type or namespace name 'ViewPage' does not exist in the namespace 'System.Web.Mvc'

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

问题描述

我有一个完美的工作很好,直到前两天溶液(VisualStudi0 2013年)。我已经重新启动我的电脑突然后我开始在当地出现以下错误每次我运行调试器。有在该溶液本身,而仅在浏览器中没有错误。我能够清理,新建,改建和发布没有任何问题的解决方案。事实上该解决方案行之有效的上线,但没有在本地计算机上。

另一个事实是,在ASPX文件没有任何错误调试。这是唯一被送达MVC抛出这个错误的页面。

我关注的ViewPage,而且只在web.config中存在。

  pageBaseType =System.Web.Mvc.ViewPage,System.Web.Mvc,版本= 5.1.0.0,文化=中性公钥= XXXXXXXXXXXXX

我敢肯定的是的ViewPage下的'System.Web.Mvc',但为什么我得到这个错误在ASP.NET临时文件的文件解决方案提供参考。我清除临时文件,但它并没有帮助。


  

编译器错误信息:CS0234:类型或命名空间名称的ViewPage不
  存在于空间'System.Web.Mvc(是否缺少程序集引用?)


源错误:


  

136线:公共类views_home_index_aspx:全球:: System.Web.Mvc.ViewPage,System.Web.SessionState.IRequiresSessionState,System.Web.IHttpHandler {


  
  

源文件:C:\\ WINDOWS \\ Microsoft.NET \\框架\\ v4.0.30319 \\临时ASP.NET文件\\ VS \\ 6f597118 \\ 63e8eef9 \\ App_Web_index.aspx.a8d08dba.6ujukvge.0.cs行:136



解决方案

这是由安全更新造成的。我固定它通过在System.Web.Mvc参考CopyLocal设置为true,但你可以在<一个得到更多的细节href=\"http://blogs.msdn.com/b/webdev/archive/2014/10/16/microsoft-asp-net-mvc-security-update-broke-my-build.aspx\">http://blogs.msdn.com/b/webdev/archive/2014/10/16/microsoft-asp-net-mvc-security-update-broke-my-build.aspx

I have a solution (VisualStudi0 2013) that worked perfectly well until couple of days ago. Suddenly after I had restarted my computer I started getting the following error locally everytime I run the debugger. There are no errors in the solution itself but only in the browser. I'm able to clean, build, rebuild and publish the solution without any problems. In fact the solution works well on-line but not locally on my computer.

Another fact is that the aspx files are debugged without any error. It's only the pages that are served with MVC that throws this error.

I searched for the ViewPage and it only exists in the web.config.

pageBaseType="System.Web.Mvc.ViewPage, System.Web.Mvc, Version=5.1.0.0, Culture=neutral, PublicKeyToken=XXXXXXXXXXXXX"

I'm certain that the ViewPage is available in the solution references under the 'System.Web.Mvc' but why I'm getting this error in a file in the Temporary ASP.NET Files. I cleared the temp files but it didn't help.

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

Source Error:

Line 136: public class views_home_index_aspx : global::System.Web.Mvc.ViewPage, System.Web.SessionState.IRequiresSessionState, System.Web.IHttpHandler {

Source File: c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\vs\6f597118\63e8eef9\App_Web_index.aspx.a8d08dba.6ujukvge.0.cs Line: 136

解决方案

That was caused by a Security Update. I fixed it by setting CopyLocal to true on the System.Web.Mvc reference but you can get more details at http://blogs.msdn.com/b/webdev/archive/2014/10/16/microsoft-asp-net-mvc-security-update-broke-my-build.aspx

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

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