views:

1407

answers:

7

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.

A: 

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.

Thomas Jespersen
The code base changes fairly regularly. We use it within our intranet as well. By using ClickOnce, we can ensure all of the clients always get the latest code, have any prerequisite libraries, etc. all with very little hassle.
Kevin Fairchild
+1  A: 

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 :(

Don
When run as a remote desktop session, the ClickOnce deployment does work, however... When run as a RemoteApp, there's a quick flash on the client system of it checking for prerequisites and then nothing.
Kevin Fairchild
A: 

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.

DJ
Keep in mind, this is as a RemoteApp as opposed to a full remote desktop session, which works just fine.
Kevin Fairchild
A: 

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

Don
Unfortunately, there don't seem to be any event logs generated for the error. Just events you'd see associated with any other typical login.
Kevin Fairchild
A: 

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.

whatknott
Yes. The application DOES start via that method. The main limitation is that it only works if the user has started the app at least once already, I guess... But, still, I guess it's a start...
Kevin Fairchild
I went ahead and gave you the bounty, since your solution at least got it to load. Now I just need to figure out a way to handle that first launch... Logging in as the user probably isn't practical.
Kevin Fairchild
So each user needs to link to their .exe? Could everyone link to one .exe? There may be security issues that arise when trying to do that though. Sorry for all the questions but TS RemoteApps are barred from my work computer.
whatknott
Also, tyvm for the bounty even though I only got you half-way there.
whatknott
I doubt linking to a single .EXE would work, but your suggestion has at least narrowed things down a bit... Drives me nuts, though. Using the same credentials, it should either work using full desktop and RemoteApp or not work. But working with one way and not the other is a pain...
Kevin Fairchild
+1  A: 

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!

A: 

I'm writing a python script that takes the .application file as an argument, enumerates it and then finds the application and runs it.

It's a tremendously ugly kludge but it will work fairly universally (I have the same issue with XenApps).

I plan to package it with py2exe, but I suspect it will be somewhat dependant upon the user having run the application at least once natively.

If someone with experience with the .Net deployment process wants to give me a hand, feel free to email me- [email protected]

Richo