15

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.

Luke Girvin
  • 13,221
  • 9
  • 64
  • 84
Dave
  • 1,076
  • 5
  • 15
  • 30
  • 2
    Don't go changing any code - its very likely you are missing a dependency (the .dll which has the Microsoft.Web.Extensions namespace). Find it and your app will probably build. The previous developer would be the person I'd ask - it'll be in their bin folder. – saille Jul 23 '11 at 01:37

3 Answers3

29

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!

Felipe Oriani
  • 37,948
  • 19
  • 131
  • 194
  • Hi Felipe, thanks for the answer. I can't even get to publishing it to the server as it won't build in my IDE These errors are appearing in the Error List at the bottom of Visual Studio. I have installed the ASP.NET AJAX msi on this machine, but nothing :( – Dave Jul 22 '11 at 11:47
  • Hi Dave, this pratice (to register validators) is kind of old pratice, we did in asp.net 2.0 in when this framework was called by Atlas Framework, I remember there's a .dll file you need to put in BIN folder to it works (in runtime). do you have this .dll file ? – Felipe Oriani Jul 22 '11 at 17:06
8

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.

Dave
  • 1,076
  • 5
  • 15
  • 30
0

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

Jk1
  • 11,233
  • 9
  • 54
  • 64