views:

117

answers:

1

I am running a DNN 4.9.x site with a number of custom modules that we've written. They all use .NET 2.0 until I upgraded one of them to use 3.5.

Now I'm getting this error on the 2.0 modules

error CS0433: The type 'System.Web.UI.UpdatePanel' exists in both 'c:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll' and 'c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\5badfcee\f17ac744\assembly\dl3\69975b21\004187ac_515cc701\System.Web.Extensions.DLL'

Is there anything I can do besides upgrading all my other modules to use 3.5?

Update: It's going to be easier to just upgrade the rest of my modules to 3.5

If I remove the 2.0 version of System.Web.Extensions.dll I get this:

Could not load file or assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

My prefix extension is just:

<%@ Register Assembly="System.Web.Extensions" Namespace="System.Web.UI" TagPrefix="ajx" %>

So there is nothing specifying the 2.0 version except the reference for the project. My understanding of references was that you just have to reference the minimum version of an assembly and it will work with future versions unless there is a breaking change.

Solved I needed to add this to my web.config

<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
    <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
  </dependentAssembly>
</assemblyBinding>
+1  A: 

Sounds like there is simply a problem with the installed version of MS AJAX. Multiple versions should be able to exist side by side (I think). Cant tell you the exact fix but might be able to get rid of the 2.X version of the dll and then it should use the 3X version.

codemypantsoff
I'm editing the question to include the result from that.
AndyMcKenna
You're right, I was able to get rid of the 2.x with a web.config addition that I've added to my question. Thanks!
AndyMcKenna