Question

I've attempted just about everything to get our ClickOnce VB.NET app to run under Terminal Services as a RemoteApp. I have a batch file that runs the .application file for the app.

This works fine via RDP desktop session on the terminal server. As a TS RemoteApp, however, well... not so much.

I get a quick flash of command prompt (the batch file) on the client system and then... nothing...

Same goes for having it point to the .application file directly (without using a batch file) or even copying the publication locally and having it point to that.

I found a technet.microsoft.com discussion about a similar issue, but there's no resolution to it listed.

For anyone who has run into this before and got it working, what did you have to do?

We currently use RemoteApp's for everything else on that server, so I'm hoping to stick with that if possible.

The current workaround is to build and run an MSI-based installer for the app on our terminal server whenever we publish via OneClick out to the network, but this can be quite a pain at times and is easy to forget to do.

Since the app works fine via Terminal Services when run in full desktop mode but not during RemoteApp, I don't think it's anything specific to Terminal Server permissions so much as ClickOnce requiring something that isn't available when running as a RemoteApp.

Was it helpful?

Solution

The Key to getting it to work is to use Windows Explorer "C:\windows\explorer.exe". This process is the base process when you login to a full session.

If you setup the RemoteApp to use Windows Explorer and the command line argument of the path to the .application file for the ClickOnce application then it will work when launched as a remote application. Windows Explorer will flash for a second when it starts, but it will disappear then the ClickOnce application will launch.

OTHER TIPS

Why does it have to be a ClickOnce application? I would consider just deploying the exe file and assemblies.

I know it only half a solution, but if the application does not change much, it might be a good solution.

I believe your problem is related to the fact that ClickOnce needs to store it's data in a special user folder called the ClickOnce application cache. Apparently because of how Terminal Services sets up user folders ClickOnce can't access this in TerminalServices mode.

See this link for more information.

http://msdn.microsoft.com/en-us/library/267k390a(VS.80).aspx

There may not be a way to do it :(

Can you launch the .exe directly? It's buried under your profile in \AppData\Local\Apps\2.0[obfuscated folders], but you should be able to find it.

That will skip the built-in update process, but if it can be launched that way you could then write code to do a manual update after the application starts.

Faced the same problem this morning and got it resolved by copying the clickonce app's directory from the user settings folder to somewhere like c:\MyApp\ - I know its nasty and not very ideal.. but good enough for me!

We recently ran across this issue and decided to post a bug report on this issue to the Visual Studio development team. Feel free to comment on the bug report. It has to be a bug in ClickOnce caused by some changes in Server 2008.

https://connect.microsoft.com/VisualStudio/feedback/details/653362/net-clickonce-deployment-not-working-as-remoteapp-or-citrix-xenapp-on-server-2008-server-2008-r2

We also have a discussion on the MSDN forums covering this issue:

http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/7f41667d-287a-4157-be71-d408751358d9/#92a7e5d9-22b6-44ba-9346-ef87a3b85edc

Try using RegMon and FileMon when starting the app - You may be able to track it down to a file and/or registry permission issue.

Also maybe check the event logs to see if anything's getting logged when the process fails.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top