views:

79

answers:

1

I just upgraded my Web Site project from 2.0 to 3.5 to take advantage of the TimeZoneInfo class. When I did this, I started getting an ambiguous assembly error (*see below). The problem is, I'm not using ScriptManager, an old version of SyncFusion is. I can't upgrade SyncFusion right now, so I need to tell ASP.NET to use version 1.0.61025.0 of the assembly.

I ripped out all of the 3.5 script stuff from the web.config and adding bindingRedirects to it, but it didn't work.

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <dependentAssembly>
            <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="3.5.0.0" newVersion="1.0.61025.0" />
        </dependentAssembly>
        <dependentAssembly>
            <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35" />
            <bindingRedirect oldVersion="3.5.0.0" newVersion="1.0.61025.0" />
        </dependentAssembly>
    </assemblyBinding>
</runtime>

The type 'System.Web.UI.ScriptManager' is ambiguous: it could come from assembly 'C:\inetpub\wwwroot\xxx\bin\System.Web.Extensions.DLL' or from assembly 'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll'. Please specify the assembly explicitly in the type name.

+5  A: 

Can you not change the Version in the Assemblies in the Compilation element?

<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.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" />
    </assemblies>
</compilation>
Ardman
I had done that, but I had a duplicate record for the assembly.
Greg
And you removed the duplicate? Does your <runtime> element entry still exist?
Ardman
Yes, it fixed it and I could remove the runtime element. Thanks.
Greg