相关疑难解决方法(0)

为什么我的.NET应用程序在从网络驱动器运行时崩溃?

从网络驱动器运行时我的.NET应用程序失败,即使同一个可执行文件从本地硬盘运行完全正常运行?

我尝试检查"完全信任",如下所示:

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." );
}
Run Code Online (Sandbox Code Playgroud)

但是,这没有帮助,我的意思是应用程序启动并且永远不会输入catch块.但是,调试版本显示抛出的异常是由InheritanceDemand引起的SecurityException.有任何想法吗?

.net c# networking securityexception permissionset

31
推荐指数
3
解决办法
2万
查看次数

标签 统计

.net ×1

c# ×1

networking ×1

permissionset ×1

securityexception ×1