I have a Class Library CL1 which has reference to an assembly with file version say 1.0.0.1 and assembly version 1.2.3.4. CL1 itself has an assembly version of 5.0.0.1 CL1 is a project reference to my main asp.net project ASP I have another class Library CL2 which has a reference to an assembly with file version say 1.0.0.2 and assembly version 1.2.3.4. CL2 itself has an assembly version of 5.0.0.2 CL2 is also referred by my asp.net project ASP
CL1 (Assembly version 5.0.0.1) -> MyCommon.Assembly Filev1.0.0.1, Assembly v1.2.3.4
CL2 (Assembly version 5.0.0.2)-> MyCommon.Assembly Filev1.0.0.2, Assembly v1.2.34
ASP -> CL1,CL2, other projects and references
I want to make an api, which, depending on the url param uses either CL1 or CL2 to get me an object of MyCommonAssembly class and will do further processing on the object
Basically, My intention is : if my calling assembly is CL1 then it should route to Assembly with File version 1.0.0.1 and if calling assembly is CL2 it should route to Assembly with File version 1.0.0.2. However I can't understand how the codebase tag can be used if my Visual Studio is assembly version for both is 1.2.3.4. I tried using the calling assembly version there but that does not work, it throws an error can't locate the assembly.
Note: I have added the following in my ASP project web.config (but how can i refer the v1001 dll file too which has the same assembly version) :
<dependentAssembly>
<assemblyIdentity name="MyCommon.Assembly" culture="neutral" publicKeyToken="abfb4bf3d2fc8c79"/>
<codeBase version="1.2.3.4" href="bin\v1002\MyCommon.Assembly.dll" />
</dependentAssembly>
Following in ASP csproj file:
<ItemGroup>
<Content Include="..\Resources\DllCollectionFolder\v1001\MyCommon.Assembly.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>v1001\MyCommon.Assembly.dll</Link>
</Content>
<Content Include="..\Resources\DllCollectionFolder\v1002\MyCommon.Assembly.dll">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Link>v1002\MyCommon.Assembly.dll</Link>
</Content>
</ItemGroup>
Following in CL1 csproj file :
<Reference Include="MyCommon.Assembly">
<HintPath>..\Resources\DllCollectionFolder\v1001\MyCommon.Assembly.dll</HintPath>
<Aliases>v1001</Aliases>
</Reference>
Following in CL2 csproj file :
<Reference Include="MyCommon.Assembly">
<HintPath>..\Resources\DllCollectionFolder\v1002\MyCommon.Assembly.dll</HintPath>
<Aliases>v1002</Aliases>
</Reference>