Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Using daqmx in C#

Hi,

 

I have a Problem using Nidaq-DLLs within my application

on a network drive.

Calling my application on a local directory, everything works fine,

but from  a network drive I get the following error:

 

************** Exception Text **************
System.IO.FileLoadException: Could not load file or assembly 'NationalInstruments.DAQmx, Version=8.7.20.11, Culture=neutral, PublicKeyToken=4544464cdeaab541' or one of its dependencies. Failed to grant minimum permission requests. (Exception from HRESULT: 0x80131417)
File name: 'NationalInstruments.DAQmx, Version=8.7.20.11, Culture=neutral, PublicKeyToken=4544464cdeaab541' ---> System.Security.Policy.PolicyException: Required permissions cannot be acquired.
   at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission)
   at System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission)
   at VML_Zielanzeige.VML_Zielanzeige.WriteDigitalLine(Int32 iLine, Int32 iData)
   at VML_Zielanzeige.VML_Zielanzeige.OnTimerVerriegeln(Object sender, EventArgs e)
   at System.Windows.Forms.Timer.OnTick(EventArgs e)
   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

 

It seems that I don´t have the permisson to call a Function from the DLL.

What can I do?

 

 

 

Thanks, Juergen

 

 

0 Kudos
Message 1 of 2
(3,482 Views)

Hi Jürgen,

I have not been able to reproduce the issue with a standard DAQmx Application here. Where exactly are the various assemblies located when you run the program? What permissions do you have to run programs from those folders?

 

I did some research regarding the error and found that hresult 0x80131417 refers to zone permissions, as stated on this MSDN page. You can try and adjust the settings mentioned there. 

 

Hope this helps.

 

Regards

--
Peter A.
Field Sales Engineer, NI Germany
0 Kudos
Message 2 of 2
(3,447 Views)