2016-07-22 62 views
1

收到此错误:如何在DLL引用中更具体?

Parser Error Message: The type 'System.Web.Mvc.ViewPage' is 
ambiguous: it could come from assembly 
'\\vmware-host\shared folders\documents\visual studio 2015\Projects\ClientApp\ClientApp\bin\ 
     Boilerplate.Web.Mvc5.Sample.DLL' 
or from assembly 
'\\vmware-host\shared folders\documents\visual studio 2015\Projects\ClientApp\ClientApp\bin\ 
    System.Web.Mvc.DLL'. 
Please specify the assembly explicitly in the type name. 

从这个代码:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="System.Web.Mvc.ViewPage" %> 

你怎么能在一个DLL参考具体些吗?

仅供参考,我的控制器是MVC 5控制器的动作,看起来像这样:

public ActionResult Index() 
    { 

     var view = new WebFormView(this.ControllerContext, "~/Views/Conduces/Index.aspx"); 

     return View(view); 

回答

1

可以包括组件的名称作为Inherits属性值的一部分:

<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage,System.Web.Mvc" %> 

注名称首先是类型名称的两部分名称,后跟程序集名称。