Asp.net mvc ASP.NET MVC不明确类型错误-';System.Web.Mvc.ViewMasterPage';含糊不清

Asp.net mvc ASP.NET MVC不明确类型错误-';System.Web.Mvc.ViewMasterPage';含糊不清,asp.net-mvc,master-pages,Asp.net Mvc,Master Pages,我创建了一个ASP.NETMVC2.0应用程序。它在第一次测试时运行良好,我对视图进行了一些小的编辑。然后我想添加一个新的控制器,所以我必须编译这个应用程序。执行此操作后,无论何时运行它,都会出现以下错误: Parser Error Message: The type 'System.Web.Mvc.ViewMasterPage' is ambiguous: it could come from assembly 'C:\Users\DerekM\Documents\Visual Studio

我创建了一个ASP.NETMVC2.0应用程序。它在第一次测试时运行良好,我对视图进行了一些小的编辑。然后我想添加一个新的控制器,所以我必须编译这个应用程序。执行此操作后,无论何时运行它,都会出现以下错误:

Parser Error Message: The type 'System.Web.Mvc.ViewMasterPage' is ambiguous: it could come from assembly 'C:\Users\DerekM\Documents\Visual Studio 2008\Projects\ABELMedicalSoftwareMVC\ABELMedicalSoftwareMVC\bin\System.Web.Mvc.DLL' or from assembly 'C:\Users\DerekM\Documents\Visual Studio 2008\Projects\ABELMedicalSoftwareMVC\ABELMedicalSoftwareMVC\bin\ABELMedicalSoftwareMVC.DLL'. Please specify the assembly explicitly in the type name.

Source Error:

Line 1:  <%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
Line 2:  
Line 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
解析器错误消息:类型“System.Web.Mvc.ViewMasterPage”不明确:它可能来自程序集“C:\Users\DerekM\Documents\visualstudio 2008\Projects\ABELMedicalSoftwareMVC\ABELMedicalSoftwareMVC\bin\System.Web.Mvc.DLL”或程序集“C:\Users\DerekM\Documents\visualstudio”2008\Projects\ABELMedicalSoftwareMVC\ABELMedicalSoftwareMVC\bin\ABELMedicalSoftwareMVC.DLL'。请在类型名称中显式指定程序集。
源错误:
第1行:
第2行:
第3行:
我在谷歌上搜索了一下,浏览了以下教程:

我完全遵循了它,但仍然得到相同的错误。因此,我现在从我的bin文件夹读取System.Web.Mvc.dll,并且从我的Web.config中删除了对GAC的引用

从我从其他帖子中收集到的信息来看,问题似乎出在我的视图页面上,或者我的母版页面上。但我不知道如何编辑它们

以下是从默认站点继承的

<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>

这是我的观点的继承

<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

我正在阅读的论坛帖子说,它需要引用隐藏的代码,但视图中没有隐藏的代码。它只是一个普通的Index.aspx文件。 默认母版页没有代码隐藏,但是如果我创建一个新的母版页,它会得到一个.cs和.designer.cs


感谢您的帮助,这似乎是一个非常简单的问题,我缺少了一些非常基本的东西。

我想您已经为这个母版页编写了代码

更改“继承自” 改为System.Web.Mvc.ViewMasterPage 位于System.Web.UI.MasterPage的

我也有同样的问题,这也帮助了我: