Could not load file or assembly “Microsoft.Web.Extensions”

ε祈祈猫儿з 提交于 2019-12-21 03:33:13

问题


I've inherited an asp.net 3.5 solution and I'm having trouble getting it working. I keep receiving the error:

Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. (c:\mydir\web.config line 54)

Now, I've had a good look around Google and have seen that people have said to run a simple search and replace to change "Microsoft.Web." to "System.Web." as the namespaces have changed, but I'm having no luck at all.

These are the pertinent lines of the Web.config file

<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>

I would appreciate any insight into this, as I'm really struggling.


回答1:


You should install on your server the ASP.NET AJAX for Asp.Net 2.0. You can find it here: http://www.microsoft.com/download/en/details.aspx?id=883

If you don't have access in this server, you can upload the .dll file into the bin folder.

I hope it works!




回答2:


As it turns out, I had been given an incorrect web.config by the previous developers. Putting the new one in allowed me to compile and build the solution.

Once deployed to the server, I had installed the AJAX for ASP.NET 2.0, but still received errors referencing microsoft.web.extensions etc.

The solution lie in the versioning.

The whole application seems to be built on top of the AJAX for ASP.NET Beta 2 binary. After removing the 2.0 and re-installing the beta 2 MSI, everything fired into action.

Thanks for the pointers everyone.




回答3:


you have to download ASPNET.2.0.AJAX.Extensions. and instal it.



来源:https://stackoverflow.com/questions/6789446/could-not-load-file-or-assembly-microsoft-web-extensions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!