04-23-2020 11:55 PM - edited 04-24-2020 12:49 AM
I have stumble upon an interesting behavior where .NET dll calls works when the applications' project file is opened. However it doesn't work when I try to run the application as standalone. The application is designed to run standalone and it is not path dependent. Only path dependent part is the .NET Constructor.
The error message is saying that it can't find the assembly files when I try to run the vi without opening the project. I have opened the vi and manually the mapped the *.dll directory using the .NET Constructor as you can see in the word document. I am still getting the same error message.
Is there a way to statically load the .NET Constructor? Maybe it will recognize all the dependencies that way. Any insight into this issue would be greatly appropriated. I did come across the following link, but it just made me even more confuse.
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019LDcSAM&l=en-US
I did further investigation and I found out when I run the VI in standalone, all the *.dll does not get loaded to the ".NET Assemblies in Memory" as shown in the attached document. I also added LabVIEW.exe.config file into the LabVIEW.exe directory as mentioned in the above link.
Solved! Go to Solution.
04-24-2020 03:05 AM
That happened to me too, if memory serves i ended up placing the DLL in the .exe folder else it wouldn't be found. I think i had to move it similarly in the development too so the ref was the same.
04-24-2020 06:17 AM
IMO, a VI that belongs to a project should not be opened without the project, let lone run in that environment. One consequence you have already discovered - it doesn't always load dependencies from the expected place.
04-24-2020 06:27 PM
Thanks Yamaeda for the suggestion. I will give this a go.
05-10-2020 07:10 PM
I finally got the chance to build an executable of my program and copied all the necessary DLLs into the .exe folder. The program was able to open up all the .NET libraries and ran without any errors.
Off to my next adventure..