What is the path to an installed ClickOnce application?

本秂侑毒 提交于 2019-12-08 04:26:09

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/9436888/what-is-the-path-to-an-installed-clickonce-application

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!