LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.net assembly promoted to later version

and how do we do that?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 11 of 12
(1,083 Views)

Bringing this thread back from the dead yet again as a solution is in place.

 

.NET uses a config file to specify dll versions if multiple versions are available in the GAC (Where .NET assemblies are registered). You can add a config file to your LabView project as well to accomplish the same thing.

 

1. Close LabView

2. Create a config file matching the name and extension of your project. So for a Labview project named "testProject.lvproj", create the file "testProject.lvproj.config"

2. Place the file in your project folder, alongside your .lvproj file

3. Open the config file and paste in the following XML:

<?xml version="1.0"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">

<probing privatePath="relativeAssemblyPath\ver2"/>
<dependentAssembly>
<assemblyIdentity name="AssemblyName"
publicKeyToken="ccc0b22700e2ae72"
culture="Neutral"/>
<!-- assembly versions can be redirected in application, publisher policy, or machine configuration files-->
<bindingRedirect oldversion="1.5.7" newVersion="1.5.12"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

4. Replace the "probing privatepath" value with the path to your assembly relative to your project file. If you know the assembly is in the GAC, remove this tag.

5. replace the "assemblyIdentity name" value with the exact name of your assembly

6. replace the "publicKeyToken" value with the public key of your assembly. The public key is a unique code used to identify your assembly. If the assembly is in the GAC, you can see the public key token as part of the assembly folder name.

7. Replace the "old version" and "New version" values with the version you're upgrading from, and the version you are upgrading to. You should be able to specify a version range in the "old version" tag, but I haven't confirmed this.

8. Save and close the file.

9. Relaunch your project.

10. You may get a browser window to find your assembly by path.* Select the appropriate version of your assembly.

11. Your project files referencing .NET assemblies will need to be saved, as they have updated their location to referenced files.

12. Close and reopen your project to confirm that you do not see a browser window again, thus confirming that your assembly reference has been properly updated.

13. build and release your update.

 

*the fact that I received a browser prompt makes me think I didn't complete the steps as Labview may have intended. But the steps above will work to update your references without having to access or delete all of your constructors.

**For each single assembly you're updating, I believe you make a copy of the "dependentAssembly" tag. I have not confirmed this.

***It is possible to place a config file alongside your executable file with the name "yourExecutable.exe.config" and force a direct to the dll. However, this is not recommended or necessary. Your project will update its references and the build will reflect this change. Furthermore, everytime you launch your application with the config file, you'll get a browser window as the reference doesn't match your source anymore. And finally, I would consider providing an assembly redirect so readily in your release to be a bit of a security risk.

 

Using Labview 2022, Windows 10
Message 12 of 12
(635 Views)