If you have multiple versions of the same assembly on your machine, you must specify which version of the assembly to use in the following situations:
To guarantee that a LabVIEW project or built application refers to a specific version of a .NET assembly, close the project and create a .NET configuration file similar to the following example, replacing the italicized code according to the table later in this topic:
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="Assembly\ver2"/>
<dependentAssembly>
<assemblyIdentity name="AssemblyName"
publicKeyToken="xee7d93a67000dr7"
culture="Neutral" />
<bindingRedirect oldVersion="oldVersionNumber" newVersion="newVersionNumber" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
Code to Replace | Guidelines |
---|---|
probing privatePath="Assembly\ver2" | Specifies the directory within the project from which LabVIEW must load the assembly. If you can guarantee that the assembly is in the Global Assembly Cache (GAC), omit this line from the configuration file. Otherwise, this line forces LabVIEW to search in this directory before anywhere else. |
AssemblyName | Represents the name of the assembly with multiple versions. |
xee7d93a67000dr7 | Uniquely identifies the assembly. Generate this key using the Strong Name tool, available on the Microsoft Developer Network (MSDN). |
oldVersionNumber | Refers to the version of the assembly that LabVIEW is currently using in the form n.n.n.n. To prevent LabVIEW from using multiple different versions of the assembly, specify a range of versions here using the form n.n.n.n - n.n.n.n. |
newVersionNumber | Refers to the version of the assembly that you want LabVIEW to use instead of oldVersionNumber. |
For examples of using .NET configuration files with LabVIEW, refer to the KnowledgeBase at ni.com.