2

We have a server with about 200 web sites that all run code from the same assemblies. So for efficiency the assemblies are registered in the gac with the version number 1.0.0.0 They want to do a development site where the code differs from what is in the gac. The solution is comprised of several projects, one being a web application and it references 3 other c# library projects. I've updated all 4 projects version from 1.0.0.0 to 1.0.0.1 and then pushed the new compiled files to a development folder on the same server as all the other sites. From what I was reading, this should force that development site to use the dlls in the local bin directory rather than what's in the gac due to the version increment. However, when I run this I get the error from my global.asax ...

The type 'CMIWeb.Global' is ambiguous: it could come from assembly 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\CMIWeb\v4.0_1.0.0.0__671ea09b8c72436a\CMIWeb.dll' or from assembly 'D:\Inetpub\wwwroot\cmidev\bin\CMIWeb.DLL'. Please specify the assembly explicitly in the type name.

I'm not sure how to get around this.

edit: Here's the bindingRedirect addition to the web.config file

<runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

        <dependantAssembly name="CMIWeb" PublicKeyToken="671ea09b8c72436a" culture="en-us" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="1.0.0.1" />

        <dependantAssembly name="CMIBLL" PublicKeyToken="16740601ec0c3aab" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="1.0.0.1" />

        <dependantAssembly name="CMIData" PublicKeyToken="6016b538121b0f75" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="1.0.0.1" />

        <dependantAssembly name="CMIObjects" PublicKeyToken="110dd5d29fab7114" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="1.0.0.1" />

        <dependantAssembly name="CMISettings" PublicKeyToken="90ce34438590d2f3" />
        <bindingRedirect oldVersion="1.0.0.0" newVersion="1.0.0.1" />

    </assemblyBinding>
</runtime>

When this didn't work I also tried adding the following, but it still complains with the same error.

<compilation debug="true" targetFramework="4.0">
      <assemblies>
          <add assembly="CMIBLL, Version=1.0.0.1, Culture=neutral, PublicKeyToken=16740601ec0c3aab" />
          <add assembly="CMIData, Version=1.0.0.1, Culture=neutral, PublicKeyToken=6016b538121b0f75" />
          <add assembly="CMIObjects, Version=1.0.0.1, Culture=neutral, PublicKeyToken=110dd5d29fab7114" />
          <add assembly="CMISettings, Version=1.0.0.1, Culture=neutral, PublicKeyToken=90ce34438590d2f3" />
          <add assembly="CMIWeb, Version=1.0.0.1, Culture=neutral, PublicKeyToken=671ea09b8c72436a" />
      </assemblies>
  </compilation>
4

0 回答 0