09-20-2012 02:36 AM
Hi,
I'm trying to load a .NET 4.0 assembly in labview.
I read all the knowledge bases about this topic.
.NET 3.5 is not a problem, 4.0 is.
I tried adding the labVIEW.exe.config next to the labview exe to enable loading .NET 4.0 assemblies, but I still keep on receiving an error:
An error occurred trying to load the assembly.
Any ideas???
The .NET assembly is the simplest assembly there is just to test!
Thanks
Kim
Solved! Go to Solution.
09-20-2012 06:01 AM
Kim,
what version of LV are you running?
It seems to be an issue not connected to LV. Look into this blog, it should answer your question.
hope it helps,
Norbert
09-20-2012 06:15 AM
I tried it in LabVIEW2009 32 bit, LabVIEW2009 64 bit and LabVIEW2012 64 bit.
Thanks, I'll check the link right now.
09-20-2012 06:26 AM
If I enable loadFromRemoteSources following error is displayed:
The selected file is not a .NET assembly, type library or automation execuatble.
09-20-2012 06:28 AM
Kim,
are you sure that the assembly (DLL-extension?) is running properly at all? So does it work if being called by e.g. C#?
Norbert
09-20-2012 06:31 AM
It's a simple dll made by a colleague in C#. To test if I can use more complicated dll's in the future.
He built different version. With framework 3.5 and 4.0.
The 3.5 can be loaded, the 4.0 returns errors.
09-20-2012 06:34 AM
Maybe it makes sense to upload this assembly here. I expect it to not contain any confidential information....
Norbert
09-20-2012 06:41 AM
He made 4 different assemblies, all give the same result
09-20-2012 06:43 AM
THis is the (same) working 3.5 version
thanks for your help!
09-20-2012 06:59 AM
Kim,
using your attached LvTestLib40d.dll and LvTestLib40r.dll (running Win 7, 32bit), i managed to create and configure the constructor node without any error. Obviously, there is only one exported method called "DoeIets()". It returns the string "Dit is een .NET4 assembly." during runtime.
Here is my LabVIEW.exe.config content:
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0.30319"/>
</startup>
<runtime>
<loadFromRemoteSources enabled="true" />
</runtime>
</configuration>
I hope you restarted LV completly after making changes to that file.
Norbert