无法加载文件或程序集“Microsoft.Web.Extensions”

时间:2011-07-22 11:40:45

标签: asp.net web-config

我继承了asp.net 3.5解决方案,但我无法正常工作。我一直收到错误:

  

无法加载文件或程序集“Microsoft.Web.Extensions,Version = 1.0.61025.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35”或其依赖项之一。该系统找不到指定的文件。 (c:\ mydir \ web.config第54行)

现在,我已经对Google有了一个很好的了解并且已经看到人们已经说要运行简单的搜索并将其替换为将“Microsoft.Web。”更改为“System.Web。”因为命名空间已经改变了,但我根本没有运气。

这些是Web.config文件的相关行

<pages validateRequest="True">
    <controls>
        <add tagPrefix="asp" namespace="Microsoft.Web.UI" assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
            <add tagPrefix="asp" namespace="Microsoft.Web.UI.Controls" assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </controls>
    <tagMapping>
        Line 54: <add tagType="System.Web.UI.WebControls.CompareValidator" mappedTagType="Microsoft.Web.UI.Compatibility.CompareValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add tagType="System.Web.UI.WebControls.CustomValidator" mappedTagType="Microsoft.Web.UI.Compatibility.CustomValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add tagType="System.Web.UI.WebControls.RangeValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RangeValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add tagType="System.Web.UI.WebControls.RegularExpressionValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RegularExpressionValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add tagType="System.Web.UI.WebControls.RequiredFieldValidator" mappedTagType="Microsoft.Web.UI.Compatibility.RequiredFieldValidator, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add tagType="System.Web.UI.WebControls.ValidationSummary" mappedTagType="Microsoft.Web.UI.Compatibility.ValidationSummary, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </tagMapping>
</pages>

我很感激对此的任何见解,因为我真的很挣扎。

提前致谢,

戴夫

3 个答案:

答案 0 :(得分:29)

您应该在服务器上安装ASP.NET AJAX for Asp.Net 2.0。 您可以在此处找到它:http://www.microsoft.com/download/en/details.aspx?id=883

如果您在此服务器中无权访问,则可以将.dll文件上传到bin文件夹。

我希望它有效!

答案 1 :(得分:7)

事实证明,以前的开发人员给了我一个不正确的web.config。放入新的允许我编译和构建解决方案。

一旦部署到服务器,我就安装了AJAX for ASP.NET 2.0,但仍然收到引用microsoft.web.extensions等的错误。

解决方案在于版本控制。

整个应用程序似乎构建在AJAX for ASP.NET Beta 2二进制文件之上。删除2.0并重新安装beta 2 MSI后,所有内容都开始行动。

感谢大家指点。

答案 2 :(得分:0)

你必须下载ASPNET.2.0.AJAX.Extensions。安装它。