From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
|
设计Shadowing Copy这种特性目的在于,当运行一个.NET程序集的一个副本时,允许在该程序集上进行并行开发。这种特性也被用在标准的ASP.NET开发环境中。如果要在LabVIEW 2011或以后版本中禁用该特性,在LabVIEW目录下的LabVIEW.ini文件中添加AppDomainSetup_ShadowCopyFiles=False可以实现。对于以前版本的LabVIEW,您无法关闭该特性,但您可以在.NET程序集中执行Shadowing Copy,这样就可以在正确的目录下引用配置文件。
有两种方式来引用.NET程序集在硬盘中的位置,可以使用程序集中的Location属性和CodeBase属性,这两个属性都是隶属于System.Reflection名字空间的。Location属性引用的硬盘上的位置是正在被执行的DLL副本所在的位置,这个属性返回的是DLL的Shadow Copy所在的位置。您也可以使用程序集的Codebase属性来获取DLL在被复制之前所在的位置,这样您可以获取包含程序集配置文件的原始目录。
对于CodeBase属性和Location属性,以及LabVIEW中调用.NET程序集,更多信息请参阅下面的链接。
在LabVIEW 2011中,您可以使用.NET Assemblies in Memory对话框来确认LabVIEW加载程序集的位置。
|