0

I am in signed .NET assembly hell.

I have an application compiled against signed Assembly A, version 1.1 (SA 1.1.1) . On some systems I already have SA 1.1.2

Is it possible to express this in the redirect?

SA 1.1.1 binds to SA 1.1.1 OR SA 1.1.2

Just to remind you how such a thing looks like:

<configuration>
   <runtime>
      <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
         <dependentAssembly>
            <assemblyIdentity name="myAssembly"
                              publicKeyToken="32ab4ba45e0a69a1"
                              culture="neutral" />
            <bindingRedirect oldVersion="1.0.0.0"
                             newVersion="2.0.0.0"/>
         </dependentAssembly>
      </assemblyBinding>
   </runtime>
</configuration>
flq
  • 22,247
  • 8
  • 55
  • 77
  • http://blog.davidsilvasmith.com/2010/02/redirecting-assembly-bindings-in-net-35.html - Excellent link... Look at the CodeBase settings if that helps.. – sajoshi Mar 08 '11 at 09:10

1 Answers1

1

Use

oldVersion="1.0.0.0-2.0.0.0"

Notice the dash denoting a range.

Sorry, thought you were going the other way around.

I don't think this is possible.

There are a couple things you can do though. If you have both versions in the GAC, you can just bind to the version you need in the app. I.e. the apps that need to bind to 1.1.1 can specify that version. The apps that need 1.1.2 can specify that binding. Otherwise, I think the safest thing is to compile against 1.1.1 or 1.1.2 for all your apps.

Or, last but not least, unsign them and compile against an unsigned version, which will then grab whatever assembly has the "friendly" name you specify.

richard
  • 12,263
  • 23
  • 95
  • 151
  • Yes, but my question is about the target. I have the same old version but want to point to either the same or newer. Is that possible? – flq Mar 08 '11 at 09:38
  • Hmm, I almost thought so. I was trying to see whether I get away with one config file. Man, that's awful. Looks like the best bet is to get the new version installed on all machines. The signed assembly is the Oracle.DataAccess, so unfortunately unsigned isn't an option. – flq Mar 08 '11 at 10:06
  • I see. Yeah, I think that is your best bet. Sorry! – richard Mar 08 '11 at 10:08