My .NET application fails when run from a network drive even when the very same executable runs perfectly fine from a local hard drive?
I tried checking for "Full trust" like so:
try
{
// Demand full trust permissions
PermissionSet fullTrust = new PermissionSet( PermissionState.Unrestricted );
fullTrust.Demand();
// Perform normal application logic
}
catch( SecurityException )
{
// Report that permissions were not full trust
MessageBox.Show( "This application requires full-trust security permissions to execute." );
}
However, this isn't helping, by which I mean the application starts up and the catch block is never entered. However, a debug build shows that the exception thrown is a SecurityException caused by an InheritanceDemand. Any ideas?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…