I am not trying to target a specific version of a DLL but I am not sure how I have assembled Options on the properties of the special edition have been set to false, although if I try to run the application and the version of the requested assembly is the last one, then I get it:
FileLoadException: The file or assembly could not be loaded Then is when referencing the version of the DLL is not exactly matches the current one. I believe this issue is on the way to refer to this assembly.
In general, if you are trying to use a specific version of an assembly below Does not really apply, you just need the version that you need.
However, sometimes you can run in a situation where you have it:
Assembly X - Assembly version 1.2.1
Assembly - Version 1.2.2 of the assembly version
But your project requires both assembly X and assembly.
So how do you solve it? You can either put 1.2.1 and 1.2.2 in assembly C in GAC, or if you are certain that there are no compatibility issues then you can use assembly ribbing. Here's an example (this is in your Web.config or App.config file):
& lt; Configuration & gt; & Lt; Order & gt; & Lt; Assembly binding xmlns = "karash: schema-microsoft-com: asm.v1" & gt; & Lt; DependentAssembly & gt; & Lt; Assembly name = "myAssembly" publicKeyToken = "32ab4ba45e0a69a1" culture = "neutral" /> & Lt; Compulsive Redirect Old Version = "1.0.0.0" newVersion = "2.0.0.0" /> & Lt; / DependentAssembly & gt; & Lt; / AssemblyBinding & gt; & Lt; / Order & gt; & Lt; / Configuration & gt; What it basically says is that if any solution in your solution is my 1.0.0.0 reference of the Legislative Assembly, then they should actually use version 2.0.0.0. And you are expected to have version 2.0.0.0 in the path.
A hack that you can always use when you want to use a special version, to specify the version range, such as:
& depend ; Assembly & gt; & Lt; Assembly name = "MyAssembly" PublicKiton = "B7567367622062C6" culture = "neutral" /> & Lt; Compulsive Redirect Old Version = "0.0.0.0-3.0.0.0" newVersion = "1.2.1.0" /> & Lt; / DependentAssembly & gt; This will force MyAssembly version 1.2.1.0 to be used between 0.0.0.0 and 3.0.0.0 for any version reference of MyAssembly.
Comments
Post a Comment