By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,854 Members | 1,912 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,854 IT Pros & Developers. It's quick & easy.

Help, Strange "An exception 'System.TypeInitializationException'has occurred in ... error.

P: n/a
The program runs well on Local harddisk. But it always popup the
exception if I run it on Netware mapping disk. After debugger say there
is no source code on the exception. Also the following error shows. Very
strange.

Unhandled Exception: System.TypeInitializationException: The type
initializer fo
r "handnetconsole.Monitor" threw an exception. --->
System.Security.SecurityExce
ption: Request failed.
at handnetconsole.Monitor..cctor()

The granted set of the failing assembly was:
<PermissionSet class="System.Security.PermissionSet"
version="1">
<IPermission
class="System.Security.Permissions.EnvironmentPerm ission, mscorl
ib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Read="USERNAME"/>
<IPermission
class="System.Security.Permissions.FileDialogPermi ssion, mscorli
b, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Security.Permissions.FileIOPermissio n,
mscorlib, V
ersion=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Read="G:\SHARED\ENERGY\CAMMS\Handnet\"
PathDiscovery="G:\SHARED\ENERGY\CAMMS\Handnet\"/>
<IPermission
class="System.Security.Permissions.IsolatedStorage FilePermission
, mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
"
version="1"
Allowed="AssemblyIsolationByUser"
UserQuota="9223372036854775807"
Expiry="9223372036854775807"
Permanent="True"/>
<IPermission
class="System.Security.Permissions.ReflectionPermi ssion, mscorli
b, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Flags="ReflectionEmit"/>
<IPermission class="System.Security.Permissions.SecurityPermiss ion,
mscorlib,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Flags="Assertion, Execution, BindingRedirects"/>
<IPermission class="System.Security.Permissions.UIPermission,
mscorlib, Versi
on=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Net.DnsPermission, System,
Version=1.0.5000.0, Cul
ture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Unrestricted="true"/>
<IPermission class="System.Drawing.Printing.PrintingPermission,
System.Drawin
g, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
version="1"
Level="DefaultPrinting"/>
<IPermission class="System.Diagnostics.EventLogPermission, System,
Version=1.
0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1">
<Machine name="."
access="Instrument"/>
</IPermission>
<IPermission
class="System.Security.Permissions.UrlIdentityPerm ission, mscorl
ib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"

Url="file://G:/SHARED/ENERGY/CAMMS/Handnet/handnetconsole.exe"/>

<IPermission
class="System.Security.Permissions.ZoneIdentityPer mission, mscor
lib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
version="1"
Zone="Intranet"/>
</PermissionSet>

--- End of inner exception stack trace ---
at handnetconsole.Monitor.Main(String[] args)
Nov 16 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
I found the following statement cause the problem on Netware mapping
driver only (Local hard disk no problem):

static OleDbConnection conn = new OleDbConnection(connStr);
Nov 16 '05 #2

P: n/a
After I move the statement

static OleDbConnection conn = new OleDbConnection(connStr);

from class member to function variable.

OleDbConnection conn = new OleDbConnection(connStr);

The error changed to:

"An unhandled exception of type 'System.Security.SecurityException'
occurred in Unknown Module.

Additional information: Request failed."

Very strange. Why it occur when run the program on netware mapping drive?
Nov 16 '05 #3

P: n/a
All code under .net framework runs with a set of rights. The code
started from the local harddisk has full rights, while code, loaded from
a network is restricted. You can give more permissions to some assembly
using AdministartiveTools/Microsoft Framework 1.1 Configuration or
Microsoft Framework 1.1 Wizards.

Sunny

In article <uL**************@TK2MSFTNGP11.phx.gbl>, nbdy9
@nospam.hotmail.com says...
After I move the statement

static OleDbConnection conn = new OleDbConnection(connStr);

from class member to function variable.

OleDbConnection conn = new OleDbConnection(connStr);

The error changed to:

"An unhandled exception of type 'System.Security.SecurityException'
occurred in Unknown Module.

Additional information: Request failed."

Very strange. Why it occur when run the program on netware mapping drive?

Nov 16 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.