首页 > 解决方案 > 应用程序直接运行,但在 Clickonce 发布后不运行

问题描述

我编写了一个演示应用程序,稍后将扩展为一个实际的应用程序(现在的演示是它只是 UI,还没有任何内容)。我试图发布它,但在让发布的版本运行时遇到问题,即使在我开发它的机器上也是如此。

当我在 Visual Studio 下运行该应用程序时,没有任何问题。同样,如果我在工作室关闭时从 bin\debug 或 bin\release 文件夹运行它,也没有问题。

发布它(更多下文)并运行安装后,它会安装,但不会运行。如果我转到实际安装应用程序的位置(c:\users]\steveb\appdata\local\apps\2.0\gibberish1\gibberish2\reallylonggibberish\tmg.exe),它也可以从那里很好地运行。但是,从它给我的链接中,它拒绝运行,并且在系统事件查看器中我得到两个事件:

第一个:网络运行时 - 事件 ID 1026

Application: applaunch.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.Security.SecurityException
   at TMG.UserForm..ctor()
   at TMG.Program.Main()
   at System.AppDomain._nExecuteAssembly(System.Reflection.RuntimeAssembly, System.String[])
   at System.Runtime.Hosting.ManifestRunner.NewThreadRunner()
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
   at System.Threading.ThreadHelper.ThreadStart()


followed by:

Application error – event ID 1000

Faulting application name: applaunch.exe, version: 4.7.3056.0, time stamp: 0x5a8e5805
Faulting module name: KERNELBASE.dll, version: 10.0.17134.441, time stamp: 0x428de48c
Exception code: 0xe0434352
Fault offset: 0x000000000003a388
Faulting process id: 0x2cb0
Faulting application start time: 0x01d49dd862272806
Faulting application path: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\applaunch.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: cf77cf44-c3b4-44a3-b7ae-956e11898c98
Faulting package full name:
Faulting package-relative application ID:

这一切都在我自己的机器上。我曾尝试将设置放在其他机器上,但它在那里也无法正常工作,但我没有在那里进行这种级别的调试,尽管我希望它是相同的。

任何帮助表示赞赏。

标签: c#visual-studio-2017clickoncepublishing

解决方案


akseli - your comment was correct - it was in partial trust mode, which I assume translates as "don't run this anywhere including where it was written". Thanks for the help.


推荐阅读