07-13-2016 02:46 AM
I use LabVIEW 2015 on a Windows 10 system. When selecting a user .NET DLL in the .NET constructor I get the message 'An error occurred trying to load the assembly.'
On another PC with the same configuration the assembly can be loaded though without problems.
I tried the solution with the config XML file, but it didn't work. Any suggestions?
07-13-2016 04:24 AM - edited 07-13-2016 04:24 AM
Hi,
It looks like a .NET framework conflict. I got the same issue in past
Please check weather this link helps : http://digital.ni.com/public.nsf/allkb/567F6EFFC5669C348625739B003739CD
07-13-2016 06:34 AM
Thanks. I tried all different kind of config files in the LabVIEW folder and the project folder. It didn't help.
07-14-2016 04:25 AM - edited 07-14-2016 04:27 AM
Hi,
This happened when an older version of .NET is already in memory. You can check by going to view > .NET Assemblies in Memory. Remember if you want to clean this memory, you need to completly stop LabVIEW and restart it. Other things, you need to create a project and then create the VI. I guess you already tried http://digital.ni.com/public.nsf/allkb/4742EB60B64BE22186257BCE0053B8FD?OpenDocument ?
Hope that helps.
07-21-2016 02:42 AM
Thanks for all the tips. Until now I tried the following:
- place a config file in the LabVIEW folder and the project folder with the following content:
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0 5.1"/>
</startup>
<runtime>
<loadFromRemoteSources enabled="true" />
</runtime>
</configuration>
I also tried different runtime versions and other properties which were suggested in the different posts.
- Check if .NET assemblies are in memory (there weren't any)
I just found out that my .NET assembly was built for the x86 architecture. Could that be the reason when I try to access it from a 64bit LabVIEW installation?
-
07-21-2016 02:46 AM
@david_liechti wrote:
[..]
I just found out that my .NET assembly was built for the x86 architecture. Could that be the reason when I try to access it from a 64bit LabVIEW installation?
-
The bitness of a DLL (C/C++ and .NET is the same stuff here) has to be the same as the calling application. Hence calling a DLL from a 64bit application, the DLL has to be 64bit. If the calling application is 32bit (running in WoW64), the DLL must be 32bit as well.
However, this does NOT apply to driver DLLs running in the kernel mode (hence they are not part of the application data space).
Norbert
07-21-2016 02:50 AM
Thanks a lot! I think this is the problem.