我开发了一个 .net 3.0 应用程序,它是使用 clickonce 部署的。
我想从完全信任转变为部分信任以简化部署。
我在visual studio下我的项目的“安全”选项卡中尝试了“计算权限”工具,答案很清楚:
---------------------------
Microsoft Visual Studio
---------------------------
This application requires full trust to run correctly.
但是,我无法弄清楚为什么需要完全信任。我尝试将安全设置更改为“部分信任”,但应用程序在启动时立即引发 SecurityException :
System.Security.SecurityException {"Request failed.", Action= "System.Security.Permissions.SecurityAction.LinkDemand"
at MyNameSpace.Program.Main(String[] args)
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)
at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData)
at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)
at System.Activator.CreateInstance(ActivationContext activationContext)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
我的软件可能不需要完全信任(我只使用 https 连接到网络服务器,并且仅在用户请求时访问文件系统,用于导入/导出目的)
我怎样才能弄清楚为什么我的应用程序需要完全信任?