Open the project in Visual Studio. Right-click on the project's References folder and select Add Reference to open the Add Reference dialog box. Locate the new assembly version in the Add Reference dialog for each Infragistics assembly listed in your References folder.
In the Project Designer, click the References tab. Click the Add button to open the Add Reference dialog box. In the Add Reference dialog box, select the tab indicating the type of component you want to reference. Select the components you want to reference, and then click OK.
Reference assemblies are a special type of assembly that contain only the minimum amount of metadata required to represent the library's public API surface.
One of the most important things to know is that "Specific Version" is a property that takes effect at compile-time and not at runtime.
When a project is built, the project's assembly references need to be resolved in order to find the physical assemblies that the build system should use. If the "Specific Version" check is performed (see section "When is "Specific Version" checked?"), it affects the outcome of the assembly resolution process:
The order in which the assembly resolution process locates potential assemblies appears to be this:
<HintPath>
element in the .csproj fileNote that if several versions of the assembly exist in the GAC, the resolution process first attempts to resolve to the assembly with the highest version. This is important only if the "Specific Version" check is not made.
Visual Studio bases its decision whether to perform the "Specific Version" check on two pieces of information found in the .csproj file:
<SpecificVersion>
element, and its value (if it is present)This is how a typical assembly reference with version information looks like:
<Reference Include="Foo, Version=1.2.3.4, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>True</SpecificVersion>
<HintPath>..\..\Bar\Foo.dll</HintPath>
</Reference>
And this is how the assembly reference looks like without version information:
<Reference Include="Foo">
[...]
The following table shows when the "Specific Version" check is performed, and when it is not.
| Version information
| Present Not present
-------------------+------------------------------
<SpecificVersion> |
- Present(=True) | 1.Yes 2.Yes (check always fails)
- Present(=False) | 3.No 4.No
- Not present | 5.Yes 6.No
The surprising thing here is that no check is performed if both <SpecificVersion>
and version information are absent (case 6). I would have expected the check to be performed and to always fail (same as case 2) because in my understanding the absence of <SpecificVersion>
implies the default value "True". This may be a quirk of Visual Studio 2010 where I did my tests.
When you examine the properties of an assembly reference in the Visual Studio UI (select the reference and hit F4), the value you see for the "Specific Version" property tells you whether or not Visual Studio is going to perform the "Specific Version" check. In case 6 the UI will show "True", although the <SpecificVersion>
element is not present in the .csproj file.
If the "Copy Local" property is set to "True" but the assembly resolution process fails because of the "Specific Version" check, no assembly is copied.
When you add a reference then Visual Studio records the [AssemblyVersion] of the assembly in the project file. This is important. If you, say, create a bug fix a year later then you want to make sure that you rebuild the project with the exact same version of the reference so it is a true drop-in. You'll get an error if the reference assembly has changed.
But that isn't always desirable. Some programmers let the assembly version automatically increment, generating a new version every single time they rebuild. Even though the public interface of the assembly never changed. Some configure their project by using Nuget to obtain libraries and let it automatically update the library when there's a new release available. They will like to set the Specific Version property to False to suppress the compile error.
Pretty important to understand the consequence, you do need to redeploy the entire build of the program to avoid accidents. Version mismatches at runtime crash the program and can only be suppressed with a <bindingRedirect>
in the .config file which is risky.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With