App runs directly but not after Clickonce publishing

0

I have written a demo application, which will be expanded later into an actual app (the demo for now is that it is only UI without any meat behind it yet). I tried to publish it, and am having problems getting the published version to run, even on my machine, where it was developed.

When I run the app under visual studio, there are no issues. Likewise, if I run it from the bin\debug or bin\release folder when studio is closed, there is also no problem.

After publishing it (more below), and running the install, it installs, but doesn't run. If I go to where the application is actually installed (c:\users]\steveb\appdata\local\apps\2.0\gibberish1\gibberish2\reallylonggibberish\tmg.exe), it runs nicely from there as well. However, from the link it makes me, it refuses to run, and in the system event viewer I get two events:

First: Net Runtime – event 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:

All this is on my own machine. I have tried putting the setup on other machines, and it is not working there as well, but I didn't get to this level of debugging there, although I expect it is the same.

Any help appreciated.

c#
visual-studio-2017
clickonce
publishing
asked on Stack Overflow Dec 27, 2018 by Steven Burck

1 Answer

0

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.

answered on Stack Overflow Dec 31, 2018 by Steven Burck

User contributions licensed under CC BY-SA 3.0