JimS-CLT
JimS-CLT

Reputation: 675

What is the path to an installed ClickOnce application?

I wrote a "Hallo world" type Windows Forms application in C# to test authentication issues. I'm going to be running the eventual application from a server periodically, so I want to be sure I can get to the resources, and fix that before committing to the whole application.

So, in Visual Studio 2010, I choose Publish....

It says "Where?", and I specify a folder on a shared file system.

It says "How will your users install", and I say, "URL" or something like that.

It says "Where", and I give it a URL in the same shared file system, different folder.

All is right with the world....

Now, I install it on my server by double-clicking "setup" on the shared file system where I published the application.

Now, I find a shortcut in my start menu, all good.

Now, I want to set it up so SQL Server Agent executes it periodically (and tests authentication...) so, what is the URL I give it to execute? I've been trying everything, but not going so well. I don't understand the publish method much at all....

How can I fix this problem?

Upvotes: 1

Views: 18265

Answers (1)

Igby Largeman
Igby Largeman

Reputation: 16747

Look at the Start menu shortcut for your installed application and you'll see that it points to a "ClickOnce Application Reference" (.appref-ms) file buried deep within your user folder. You can start the application by executing that file.

Example:

Process.Start(@"C:\Users\Igby\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Microsoft\MyClickOnceApp.appref-ms");

I don't know anything about SQL Server Agent, but try giving it this path.

Upvotes: 3

Related Questions