Bobillier Posted June 17, 2022 Report Share Posted June 17, 2022 Hi I have created one program who call a DotNet assembly component (.NET4 system.dll) and all ok in my LV2011 development ide. But when I create EXE with it, each time I run the program it calls me .Net ddl path. I do that on the same PC. If I indicate the path, the program loads it and runs correctly. It's a bit painful and not very professional to do that each time. To solve this, I have tried lots of work around but without success. 1) Add Dll caller Vi directly in project folder . (intialy in my user folder) 2) Add a specific .ini file where I have added a key for the search path (viSearchPath= "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089") to Help LV to found assembly. 3) Add DLL in my exe construction in data folder 4) etc etc... I have read and test lots of things on NI website but it's not always clear for me. If someone can give me a good procedure it will be christmas for me. Eric Quote Link to comment
Rolf Kalbermatter Posted June 17, 2022 Report Share Posted June 17, 2022 1 hour ago, Bobillier said: Hi I have created one program who call a DotNet assembly component (.NET4 system.dll) and all ok in my LV2011 development ide. But when I create EXE with it, each time I run the program it calls me .Net ddl path. I do that on the same PC. If I indicate the path, the program loads it and runs correctly. It's a bit painful and not very professional to do that each time. To solve this, I have tried lots of work around but without success. 1) Add Dll caller Vi directly in project folder . (intialy in my user folder) 2) Add a specific .ini file where I have added a key for the search path (viSearchPath= "C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089") to Help LV to found assembly. 3) Add DLL in my exe construction in data folder 4) etc etc... I have read and test lots of things on NI website but it's not always clear for me. If someone can give me a good procedure it will be christmas for me. Eric What System DLL? If it is a strongly named assembly and resides in the Global Assembly Cache, something is wrong. If it doesn't reside there it is NOT a system assembly for sure! If adding it to your directory where the exe file itself resides does not help it depends on other DLLs/assemblies and you need to find out which and add them to your exe directory too. Quote Link to comment
Bobillier Posted June 17, 2022 Author Report Share Posted June 17, 2022 Hi Rolf It's first time I use .NET and I'm newbee about those technology . At start I just want send email through SMTP TLS in old application LV2011. Like secure SMTP is not present in LV2011, I have found one example who use them with .NET Like I said before this example run OK (with my own account (not ggogle)), but just in my LV IDE. I 'm not sure to understand what is signification of "strongly named" but when I use the Labview tool to identify "Assembly .NET in memory" I obtain this link: 2 hours ago, Bobillier said: C:\Windows\Microsoft.NET\assembly\GAC_MSIL\System\v4.0_4.0.0.0__b77a5c561934e089\System.dll" I think it's in GAC but i'm not sure and If it's the case , like you said "Something is wrong" , but what ? Quote Link to comment
VDB Posted June 17, 2022 Report Share Posted June 17, 2022 Did you already try this? https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019L3hSAE&l=de-DE Quote Link to comment
ShaunR Posted June 17, 2022 Report Share Posted June 17, 2022 LV 2011 uses .NET 3.5. Do you have that installed? Quote Link to comment
Bobillier Posted June 17, 2022 Author Report Share Posted June 17, 2022 5 minutes ago, ShaunR said: LV 2011 uses .NET 3.5. Do you have that installed? On my machine I have V1.0, V1.1, V2.0, V3.0, V3.5 and V4.0.30319 installed. But If LV 2011 use 3.5,why I have the Labview tool to identify "Assembly .NET in memory" who refer to V4.0 ? 44 minutes ago, VDB said: Did you already try this? https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019L3hSAE&l=de-DE Wonderful It's exactly the problem origine. Like said ShaunR if LV2011 needs 3.5, and if IDE refers to 4.0, I will need to add the Application.exe.config file in the application folder to force exe to use 4.0. Thanks to all Quote Link to comment
Bobillier Posted June 17, 2022 Author Report Share Posted June 17, 2022 To be more efficient with the workaround, follow this procedure: 1) Copy the file "Your Application Name.exe.config" and Post-build Action.vi in your project folder. 2) Rename "Your Application Name.exe.config" with the good name of your application 3) Add it to your project. 4) In executable construction windows, add "Your Application Name.exe.config" to the source files\ always include list 5) In executable construction windows, select Post-build Action.vi in "Pre and Post build Action 6) Run construction. The post build vi is just to move "Your Application Name.exe.config" from data folder to those parent application folders automatically. Without it let it to data folder and you need to move it manually Post-Build Action.vi Your Application Name.exe.config Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.