System.Security.SecurityException: System.Security.Permissions.SecurityPermission

V

Victor

Hi all...

Can anyone tell me what means the log below ? I have an application that
is intended to control an USB device and when I start taht application
this error is thrown...

Thanx.
V.




See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Security.SecurityException:
System.Security.Permissions.SecurityPermission
at Test_Microchip_USB.ClassUSBToMicrochip.bMICROCHIP_OpenUSB(String
sVidPid, Boolean bForRead, IntPtr& intPtrHandle)
at Test_Microchip_USB.ClassStroboscopic.bOpenPipeForWrite(String
sVidPid)
at Test_Microchip_USB.Form1.GereOpenWritePipe()
at Test_Microchip_USB.Form1.Form1_Load(Object sender, EventArgs e)
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at
System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32
msg, IntPtr wparam, IntPtr lparam)
The type of the first permission that failed was:
System.Security.Permissions.SecurityPermission
The Zone of the assembly that failed was:
MyComputer


************** Loaded Assemblies **************
mscorlib
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINNT/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
Test Microchip USB
Assembly Version: 1.0.2453.18786
Win32 Version: 1.0.2453.18786
CodeBase: file:///S:/Temp%20VDC/test_usb/Test%20Microchip%20USB.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINNT/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINNT/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
Assembly Version: 2.0.0.0
Win32 Version: 2.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINNT/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 8.0.0.0
Win32 Version: 8.0.50727.42 (RTM.050727-4200)
CodeBase:
file:///C:/WINNT/assembly/GAC_MSIL/Microsoft.VisualBasic/8.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualBasic.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
 
G

Guest

How are you accessing the USB device? Can you display an OpenFileDialog from
within your app and browse to the USB device?
 
V

Victor

How are you accessing the USB device? Can you display an OpenFileDialog from
within your app and browse to the USB device?
Hi CT,

Thanks to your last question I found the solution to my problem...

The app is to be used with a specific USB port (port 0?). In fact, when
I disconnect the device or I connect it to an "invalid" USB port, the
app says something like "ERROR N° : 901 bMICROCHIP_OpenUSB 0"... So I
connected the device to another USB port on my computer, and now... it
works...

Many thanx !!!
and have a nice day !
Victor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top