关于使用ClickOnce部署的wpf应用程序的错误

问题描述 投票:0回答:1

我在wpf应用程序中使用Prism.Unity Template Pack。当我在Visual Studio中运行代码时,一切正常。但是在部署之后,在启动应用程序时会抛出以下错误。尝试环顾四周,但不了解如何解决验证异常。

由于棱镜在库中集成了Unity,因此我无法对其进行调试。我也从github看了源代码,没有发现任何线索。

事件日志:

应用程序:applaunch.exe框架版本:v4.0.30319说明:由于未处理的异常,进程已终止。异常信息:System.Security.VerificationException在Unity.Storage.Registrations..ctor(Int32)在Unity.UnityContainer..ctor()在Prism.Unity.PrismApplication.CreateContainerExtension()在Prism.PrismApplicationBase.Initialize()在Prism.PrismApplicationBase.InitializeInternal()在System.Windows.Application。 b__1_0(System.Object)在System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate,System.Object,Int32)在System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object,System.Delegate,System.Object,Int32,System.Delegate)在System.Windows.Threading.DispatcherOperation.InvokeImpl()在MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)在System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,布尔值)在System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,布尔值)在System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object)在MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext,System.Threading.ContextCallback,System.Object)在System.Windows.Threading.DispatcherOperation.Invoke()在System.Windows.Threading.Dispatcher.ProcessQueue()在System.Windows.Threading.Dispatcher.WndProcHook(IntPtr,Int32,IntPtr,IntPtr,布尔ByRef)在MS.Win32.HwndWrapper.WndProc(IntPtr,Int32,IntPtr,IntPtr,布尔ByRef)在MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)在System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate,System.Object,Int32)在System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object,System.Delegate,System.Object,Int32,System.Delegate)在System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority,System.TimeSpan,System.Delegate,System.Object,Int32)在MS.Win32.HwndSubclass.SubclassWndProc(IntPtr,Int32,IntPtr,IntPtr)在MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)在System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)在System.Windows.Application.RunDispatcher(System.Object)在System.Windows.Application.RunInternal(System.Windows.Window)在PrismUploadUI.App.Main()在System.AppDomain._nExecuteAssembly(System.Reflection.RuntimeAssembly,System.String [])处在System.Runtime.Hosting.ManifestRunner.NewThreadRunner()在System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,布尔值)在System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object,布尔值)在System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext,System.Threading.ContextCallback,System.Object)在System.Threading.ThreadHelper.ThreadStart()

wpf prism unity-container clickonce
1个回答
0
投票

[如果有人遇到此问题,我将其解决,与棱镜模板无关,也与棱镜统一性无关,这是由于.csproj文件中的几个标签导致了此问题。

删除<TargetZone>LocalIntranet</TargetZone>解决了我的问题,但是即使在项目的应用程序属性中将其设置为完全信任之后,我仍然不明白如何删除此标记。还有一件事是,我确实将清单设置设置为不带清单的创建应用程序,但在csproj中却发现此标记为<GenerateManifests>true</GenerateManifests>。然后我把它弄错了。

所以人们也要检查csproj文件是否添加了文件。

© www.soinside.com 2019 - 2024. All rights reserved.