ASP.NET MVC参考问题?问题、ASP、NET、MVC

由网友(面对)分享简介:在做一个MVC项目,我得到了以下2编译错误:的类型 System.Web.Mvc.ViewPage 在未被引用的程序集中定义。您必须添加一个引用组件:System.Web.Mvc,版本= 1.0.0.0,文化=中性公钥=空。 的调用不明确以下方法或属性之间:System.Web.Mvc.Html.LinkExtensi...

在做一个MVC项目,我得到了以下2编译错误:

的类型 System.Web.Mvc.ViewPage 在未被引用的程序集中定义。您必须添加一个引用组件:   

System.Web.Mvc,版本= 1.0.0.0,文化=中性公钥=空。

的调用不明确以下方法或属性之间:   

System.Web.Mvc.Html.LinkExtensions.ActionLink(System.Web.Mvc.HtmlHelper,字符串,字符串,字符串)和System.Web.Mvc.Html.LinkExtensions.ActionLink(System.Web.Mvc.HtmlHelper,字符串,字符串,字符串)

我想我有正确的设置在的web.config

 <编译调试=真正的>
  <组件>
    <添加组件=System.Core程序,版本= 3.5.0.0,文化=中性公钥= B77A5C561934E089/>
    <添加组件=System.Web.Extensions程序,版本= 3.5.0.0,文化=中性公钥= 31BF3856AD364E35/>
    <添加组件=System.Web.Abstractions,版本= 3.5.0.0,文化=中性公钥= 31BF3856AD364E35/>
    <添加组件=System.Web.Routing,版本= 3.5.0.0,文化=中性公钥= 31BF3856AD364E35/>
    <添加组件=System.Web.Mvc,版本= 1.0.0.0,文化=中性公钥= 31BF3856AD364E35/>
    <添加组件=System.Data.DataSetExtensions,版本= 3.5.0.0,文化=中性公钥= B77A5C561934E089/>
    <添加组件=System.Xml.Linq的,版本= 3.5.0.0,文化=中性公钥= B77A5C561934E089/>
    <添加组件=System.Data.Linq程序,版本= 3.5.0.0,文化=中性公钥= B77A5C561934E089/>
  < /组件>
< /编译>
 

 <命名空间>
    <加上命名空间=System.Web.Mvc/>
    <加上命名空间=System.Web.Mvc.Ajax/>
    <加上命名空间=System.Web.Mvc.Html/>
    <加上命名空间=System.Web.Routing/>
    <加上命名空间=System.Linq的/>
    <加上命名空间=System.Collections.Generic/>
< /命名空间>
 
ASP NET MVC 2

和,我参考了3的dll我在龙头安装asp.net mvc的有:

  C: Program Files文件微软ASP.NET  ASP.NET MVC的测试大会
 

3的dll:

  System.Web.Abstractions.dll
System.Web.Routing.dll
System.Web.Mvc.dll程序
 

可能有人揭示了什么错误以及如何解决这些名词吗?

解决方案

我下载了MVC的最新源关闭的codePLEX和建造它。 程序Files Microsoft ASP.NET ASP.NET MVC的测试大会文件夹:我通过引用System.Web.Mvc.dll程序到我的下载版本,另2的DLL引用的DLL在C固定的第一个错误。

现在的第一个错误是不存在的,但第二个错误仍然存​​在,这是

调用不明确以下方法或属性之间:System.Web.Mvc.Html.LinkExtensions.ActionLink(System.Web.Mvc.HtmlHelper,字符串,字符串,字符串)'和'System.Web.Mvc。 Html.LinkExtensions.ActionLink(System.Web.Mvc.HtmlHelper,字符串,字符串,字符串)

这发生在每个视图页面pretty的多。我能做些什么来解决这个问题?

感谢你了!

In doing a MVC project I got the following 2 compile errors:

The type System.Web.Mvc.ViewPage is defined in an assembly that is not referenced. You must add a reference to assembly:

System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.

The call is ambiguous between the following methods or properties:

System.Web.Mvc.Html.LinkExtensions.ActionLink(System.Web.Mvc.HtmlHelper, string, string, string) and System.Web.Mvc.Html.LinkExtensions.ActionLink(System.Web.Mvc.HtmlHelper, string, string, string)

I think I have the correct setup in the web.config

<compilation debug="true">
  <assemblies>
    <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
    <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
    <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
  </assemblies>
</compilation>

and

<namespaces>
    <add namespace="System.Web.Mvc"/>
    <add namespace="System.Web.Mvc.Ajax"/>
    <add namespace="System.Web.Mvc.Html"/>
    <add namespace="System.Web.Routing"/>
    <add namespace="System.Linq"/>
    <add namespace="System.Collections.Generic"/>       
</namespaces>

And, I got reference to the 3 dlls I intalled asp.net mvc with in:

C:Program FilesMicrosoft ASP.NETASP.NET MVC BetaAssemblies

3 dlls:

System.Web.Abstractions.dll
System.Web.Routing.dll
System.Web.Mvc.dll

Could someone shed some light on what is going wrong and how to solve them please?

解决方案

I downloaded the latest source of mvc off of CodePlex and built it. I fixed the first error by referencing the System.Web.Mvc.dll to my downloaded version and the other 2 dlls to reference the dlls in the C:Program FilesMicrosoft ASP.NETASP.NET MVC BetaAssemblies folder.

Now that the first error is not there, but the 2nd error still exists which is

The call is ambiguous between the following methods or properties: 'System.Web.Mvc.Html.LinkExtensions.ActionLink(System.Web.Mvc.HtmlHelper, string, string, string)' and 'System.Web.Mvc.Html.LinkExtensions.ActionLink(System.Web.Mvc.HtmlHelper, string, string, string)'

this happens on every view page pretty much. What could I do to fix this?

Thank you so much!

阅读全文

相关推荐

最新文章