Suppose we made an application and the dll is present in the GAC. Now if we make another version of the same dll and put the dll in the GAC,which dll should the application refer ?
Ans.The application will refer to the latest version of the dll. But what do we have to do if we need to refer the older version of the dll. For that we can use the bindingRedirect to refer to the older version of the dll. |
How to use bindingRedirect ??
|
<configuration> <runtime> <assemblyBinding xmlns=" "> <dependentAssembly> <assemblyIdentity name="ClassLibraryVersion" publicKeyToken="b035c4774706cc72" culture="neutral"/> <bindingRedirect oldVersion= "1.1.0.0" newVersion= "1.0.0.0"/> </dependentAssembly> </assemblyBinding> </runtime> </configuration>
In the newVersion we need to mention the version number of the dll which we want to refer.Here i have mention the older version,so it will refer the older version.