10-03-2024 04:27 AM - edited 10-03-2024 04:40 AM
Hi everyone,
I'm starting to use LabView. I've been tasked in refactoring an existant (old) project where I have to do some improvement.
I must use LabView 2013 SP1.
My first activity is to use an external .NET assembly to handle Excel protection of report files.
The assembly, coded in Visual Studio (c#, .net 3.5), is pretty simple it just define a class ReportLocker with 3 methods Lock, Unlock, IsLocked.
Everything worked fine until I added the last method (IsLocked).
This method is not recognized by LabView, it just show the first two methods Lock, Unlock.
I tried to:
...nothing works .. it just keep showing only the old methods.
What's the problem? There's an hidden cache somewhere? Methods must have a specific signature (parameter types ...)?
I tried also to add another method with a more canonical return type and parameter list.. but it's not listed.
Please note that I'm using the same assembly into a .NET executable and everything works correctly (all assembly methods are correctly called).
I'm attaching:
P.S. In the VI block diagram the Check action is bound to a static factory of the assembly ..
Bes regards,
Mike
Solved! Go to Solution.
10-03-2024 06:23 AM - edited 10-03-2024 06:35 AM
I found the problem: as reported in Constructor Node Help LabView relies on system manager policies to select which Assembly need to be loaded. This involve checking the assembly release number and choose the correct assembly according to the policies.
In my case I did two errors:
1) the first time I used the Constructor node I pointed it to the debug assembly (into the assembly project folder) then I pointed it to the local release assembly into the .vi folder;
2) I forgot to update the version of the assembly when I added the third method.
As a matter of fact LabView kept using the first (debug) selected assembly until I made a version change, when the version change had become evident a message was prompted since LabView insisted to use the older assembly version (probably according to some specific security policy). This triggered my attention and allowed to fix the problem.
Once I updated the assembly version I needed also to close LabView, clear GAC downloaded assembly cache with gacutil /cdl (from an elevated command prompt), then restarted LabView.
Best regards,
Mike
10-04-2024 03:11 AM - edited 10-04-2024 03:13 AM
Tthis's probably not a fault attributable to LabView but it should be noted that selecting a new assembly by the Constructor node doesn't trigger any warning message when it actually should.
This happens only if there's a version conflict between the original pointed assembly and the newly selected ...and anyway in my case this lead to keep the older one in use (but this may dependes on sysadmin policies).