1

アプリを初期化するこのフェーズで問題が発生しました。

public static void Initialise()
    {
        Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); //throwing exception here
        Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
        AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
    }

私はウェブ設定を持っています

<trust level="full"/>

メッセージは次のとおりです。

Request for the permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

スタックトレースは次のとおりです。

at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)
at System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.Windows.Forms.Application.add_ThreadException(ThreadExceptionEventHandler value)
at Chronos.Shared.ErrorHandler.Initialise()
at Chronos.TeamLeader.Program.Main()
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.nExecuteAssembly(RuntimeAssembly 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.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

誰かがそれについてもっと情報が必要な場合は私に知らせてください。

4

1 に答える 1

3

このセキュリティ例外を渡すのに苦労していました。たくさんのブログを読んで、議論に参加しましたが、何もうまくいきませんでした。

最後に、msdnで「ClickOnceセキュリティ設定を有効にする」が見つかりました。これらの手順を実行し、プロジェクトプロパティのセキュリティ設定を無効にしました。

これがいくつかの助けになることを願うリンクは次のとおりです:http://msdn.microsoft.com/en-us/library/1sfbfyk0.aspx

于 2013-02-13T14:07:05.583 に答える