LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

.Net dll dosen't load in Application EXE

Solved!
Go to solution

Hallo All,

I am currently developing Cryptographic algorithm for Smartcards. I use VS 2012 C#.net Express Edition to code the Algorithm, along with BouncyCastle.dll.

 

BouncyCastle.dll for .net is developed under .net2.0

 

My program works perfectly in LV 2011 Environment, but when I build the Application EXE, the program searches for the .dll.

Before using the .net dll in Labview, I have done the following soultion suggested by NI: (Labview.exe.Config)

<?xml version ="1.0"?>
<configuration>
   <startup useLegacyV2RuntimeActivationPolicy="true">
      <supportedRuntime version="v4.0.30319"/>
   </startup>
</configuration>

 

I used the same solution for the Application EXE but it always promts a dialog for the .net DLL.

I have attached the snapshot of the Application folder and its Data folder.

Experts suggetion is kindly adviced.

 

Thank You

Raj

0 Kudos
Message 1 of 6
(2,846 Views)
Solution
Accepted by topic author Aapthan

When you run a VI in the IDE, LabVIEW.exe is the process hosting the CLR. When you build an executable that is the application that is hosting the CLR. So the advice given to edit/create "LabVIEW.exe.config" for development in the IDE, as you indicated, needs to be applied to "Signature_Gen.exe.config" for your runtime application.

 

I see you have a "Signature_Gen.config" file but it needs to be "Signature_Gen.exe.config", just like the LabVIEW example.

0 Kudos
Message 2 of 6
(2,810 Views)

Thank you tyk007,

I realised this after a few minutes that .exe was missing.

 

Thank you

Raj

0 Kudos
Message 3 of 6
(2,794 Views)

Can you post the step you used to use the DLL in labview ?

 

Did u just use the import DLL wizard ?

0 Kudos
Message 4 of 6
(32 Views)

@Ray.Abram wrote:

Can you post the step you used to use the DLL in labview ?

 

Did u just use the import DLL wizard ?


Take a note - this is 7 years old thread.

 

Technically we talking about .net here, so the DLL Import Wizard is not applicable.

 

In very short words, you have to place .net constructor on the BD:

Screenshot 2024-11-08 08.49.59.png

Then, if we talking about very recent versions (Bouncy Castle C# .NET release for .NET 6.0 & LabVIEW 2024) you can select .net Core Constructor:

Screenshot 2024-11-08 08.51.59.png

 

Then select BouncyCastle.Cryptography.dll and choose appropriate constructor:

Screenshot 2024-11-08 08.53.32.png

Follow Bouncy Castle doc from this point, but take a note that .NET Core support added to the latest LV is "experimental", could have some issues.

 

Refer to the Help Using .NET with LabVIEW and examples located in "<LabVIEW>\examples\Connectivity\Dot NET" and "examples\Connectivity\Dot NET Core" folders as "getting started".

0 Kudos
Message 5 of 6
(21 Views)

And unless that bouncyCastle dll is a much much newer version, I would posit that using a .Net DLL that was current when .Net 2.0 was the state of the art is absolutely certainly worse than not using any cryptography. In cryptography, what was top notch 5 years ago is just about enough now and will be obsolete in another 3 years. You better use no security than bad and outdated security!

Rolf Kalbermatter
My Blog
Message 6 of 6
(18 Views)