LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW, .NET, and the GAC walk into a bar...

Has anyone else noticed that when LabVIEW interacts with a .NET assembly in the GAC (C:\WINDOWS\assembly) the assembly gets copied to a "Download" directory (C:\WINDOWS\assembly\Download)?  You can see this for yourself by running the "NET Event Callback for DataWatcher.vi" example VI that is shipped with LabVIEW 8.2.  After running this VI, the "EventExample" assembly will be moved to the "Download" directory.  Stranger still, the assembly doesn't get moved back into the GAC after the VI is done.  I have noticed that this doesn't happen when other programming languages (Visual C, etc.) interact with the same assemblies. 
 
For now, this behavior isn't causing a problem...it's just a mild curiosity.  As far as I know this behavior could be a strange characteristic of the GAC or a result of the interaction between LabVIEW and .NET.
 
Using LabVIEW 8.2.1 and .NET Framework 2.0...

Chris_Mitchell
Product Development Engineer
Certified LabVIEW Architect

0 Kudos
Message 1 of 2
(2,955 Views)
I was really hoping for a punchline there Smiley Very Happy

Oh well...

The behavior you are seeing is called shadow copying. It is an inherint but optional part of loading .NET assemblies that LabVIEW happens to use. I believe the advantage of shadow copying is that you can concurrently use and develop a .NET assembly. Whenever LabVIEW loads a .NET assembly, it makes this shadow copy in a special directory. I'm a little confused by the second part of your question about putting the assembly back into the GAC. LabVIEW never removes the assembly from its original location as far as I know, it just makes a temporary copy.

I googled this and found this link from a blog on MSDN. Seems to have the basics.

Jarrod S.
National Instruments
0 Kudos
Message 2 of 2
(2,947 Views)