2009-11-30 8 views
2

WPF 4 (.NET 4)에서 새 프로젝트를 시작하고 xbap 모드로 실행할 수 있는지 확인하려고했습니다. 완전 신뢰 응용 프로그램을 실행해야하는지 최종 사용자에게 묻는 .NET 4에서 사용할 수있는 새로운 모드로 완전 신뢰로 응용 프로그램을 실행해야합니다.부분 신뢰 WPF 4

"보안"모드를 "완전 신뢰"응용 프로그램으로 설정 했으므로 정상적으로 작동합니다. 실행하면 예외가 발생하고 IE 오류 메시지는 다음 오류를 표시합니다.

주위에 어떤 방법으로 ??

 
Startup URI: T:\projects\Hightech Sources\PayRoll\PayRoll.Web\publish\PayRoll.Web.xbap 
Application Identity: file:///T:/projects/Hightech%20Sources/PayRoll/PayRoll.Web/publish/PayRoll.Web.xbap#PayRoll.Web.xbap, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1d910f49755d2c97, processorArchitecture=msil/PayRoll.Web.exe, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1d910f49755d2c97, processorArchitecture=msil, type=win32 

System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, 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.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks) 
    at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark) 
    at System.Reflection.Assembly.LoadFrom(String assemblyFile) 
    at PayRoll.Web.App.SelectAssemblies() 
    at Caliburn.PresentationFramework.ApplicationModel.CaliburnApplication..ctor() 
    at PayRoll.Web.App..ctor() 
    at PayRoll.Web.App.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.Windows.Interop.PresentationApplicationActivator.CreateInstance(ActivationContext actCtx) 
    at System.Activator.CreateInstance(ActivationContext activationContext) 
    at System.AppDomain.Setup(Object arg) 
    at System.AppDomain.nCreateInstance(String friendlyName, AppDomainSetup setup, Evidence providedSecurityInfo, Evidence creatorsSecurityInfo, IntPtr parentSecurityDescriptor) 
    at System.Runtime.Hosting.ApplicationActivator.CreateInstanceHelper(AppDomainSetup adSetup) 
    at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[] activationCustomData) 
    at System.Windows.Interop.PresentationApplicationActivator.CreateInstance(ActivationContext actCtx) 
    at System.Activator.CreateInstance(ActivationContext activationContext) 
    at System.Deployment.Application.DeploymentManager.ExecuteNewDomain() 
    at System.Deployment.Application.InPlaceHostingManager.Execute() 
    at MS.Internal.AppModel.XappLauncherApp.ExecuteDownloadedApplication() 
    at System.Windows.Interop.DocObjHost.RunApplication(ApplicationRunner runner) 
    at MS.Internal.AppModel.XappLauncherApp.XappLauncherApp_Exit(Object sender, ExitEventArgs e) 
    at System.Windows.Application.OnExit(ExitEventArgs e) 
    at System.Windows.Application.DoShutdown() 
    at System.Windows.Application.ShutdownImpl() 
    at System.Windows.Application.ShutdownCallback(Object arg) 
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 
    at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) 
    at System.Windows.Threading.DispatcherOperation.InvokeImpl() 
    at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(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, Boolean ignoreSyncCtx) 
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
    at System.Windows.Threading.DispatcherOperation.Invoke() 
    at System.Windows.Threading.Dispatcher.ProcessQueue() 
    at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
    at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
    at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 
    at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) 
    at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) 
    at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 
    at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) 
    at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) 
    at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) 
    at System.Windows.Threading.Dispatcher.Run() 
    at System.Windows.Application.RunDispatcher(Object ignore) 
    at System.Windows.Application.StartDispatcherInBrowser(Object unused) 
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 
    at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) 
    at System.Windows.Threading.DispatcherOperation.InvokeImpl() 
    at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(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, Boolean ignoreSyncCtx) 
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) 
    at System.Windows.Threading.DispatcherOperation.Invoke() 
    at System.Windows.Threading.Dispatcher.ProcessQueue() 
    at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
    at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) 
    at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) 
    at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) 
    at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) 
    at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) 
    at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) 
The action that failed was: 
Demand 
The type of the first permission that failed was: 
System.Security.Permissions.FileIOPermission 
+0

비슷한 문제가 여기 http://stackoverflow.com/questions/654392/how-do-i WPF/.NET의 이전 버전에서 작동하지 않습니다 -run-a-full-trust-xbap-on-intranet WPF 4에 대한 자습서를 찾지 못했습니다. –

답변

1

나는 완전 신뢰 자체 서명 된 XBAP 응용 프로그램을 실행하기 위해 찾은 유일한 방법은 (대부분의 시간 가능하지 않을 수 있습니다) 클라이언트의 컴퓨터에 인증서를 추가하거나 사이트의 URL을 추가하는 중입니다 신뢰할 수있는 사이트 목록 나는 후자가 가장 편리하고 응용 프로그램이 신뢰할 수있는 기관이 발급 한 유효한 인증서로 서명 된 것처럼 실행되는 것으로 나타났습니다.

참고이 .NET 4.0에서만 가능하며