LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.NET assembly cannot be loaded

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?

0 Kudos
Message 1 of 7
(5,202 Views)

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

0 Kudos
Message 2 of 7
(5,187 Views)

Thanks. I tried all different kind of config files in the LabVIEW folder and the project folder. It didn't help.

0 Kudos
Message 3 of 7
(5,173 Views)

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. 

Certified LabVIEW Architect (CLA)
0 Kudos
Message 4 of 7
(5,142 Views)

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?

 

0 Kudos
Message 5 of 7
(5,081 Views)

@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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 7
(5,077 Views)

Thanks a lot! I think this is the problem.

0 Kudos
Message 7 of 7
(5,073 Views)