07-10-2012 11:26 AM
Hi!
I have a LabVIEW project that is referencing a .NET assembly built by my company.
I would like to be able to use a .NET config file with the bindingRedirect attribute to let the application use an updated assembly without having to rebuild.
The LabVIEW project is called Symbol.Net.VI.lvproj so (as detailed at http://digital.ni.com/public.nsf/allkb/9E2C956A7AFBE0458625753D006C38C7), I have created a Symbol.Net.VI.lvproj.config which is as follows:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Electrolux.Symbol.Net" culture="neutral" publicKeyToken="752deb2192887471" />
<bindingRedirect oldVersion="4.0.0.0" newVersion="4.2.4574.28236" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
As you can imagine, the LabVIEW application is built against version 4.0.0.0 of the assembly Electrolux.Symbol.Net and we want to use the version 4.2.4574.28236.
The PROBLEM is that, when opening the project Symbol.Net.VI.lvproj, and double-clicking on the VI that is using the assembly, I get the following warning message (as if the the bindingRedirect is not considered).
D:\muzzoiva\Desktop\NI.Experiments\Symbol.Net.VI\ReadAllSymbols.vi (ReadAllSymbols.vi)
- Expected Assembly "Electrolux.Symbol.Net, Version=4.0.0.0, Culture=neutral, PublicKeyToken=752deb2192887471", but found "Electrolux.Symbol.Net, Version=4.2.4574.28236, Culture=neutral,PublicKeyToken=752deb2192887471."
The same thing happens with both LabVIEW 8.6.1 and 11.0.1.
QUESTION: What am I doing wrong? I expect that warning to disappear when applying the bindingRedirect. Please, let me know! If you need I can give you the application project and the assembly only on one of your FTP servers. (I cannot give it to you as a public attachment)
NOTE: I suggest to add a note to the document at http://digital.ni.com/public.nsf/allkb/9E2C956A7AFBE0458625753D006C38C7 where you highlight the fact that, in order to apply bindingRedirect, the assembly must be strongly named. I noticed that there is this constraint by looking at the NOTE in the following page: http://msdn.microsoft.com/en-us/library/7wd6ex19(v=vs.80).aspx
Thank you very much!
Best Regards
Ivan Muzzolini