tags:

views:

84

answers:

1

I am deploying a solution to a networking share using ClickOnce. There are some resources (xml files) that should remain on the network drive and be shared among users - i.e. I do not wish for a local copy of these files to be made.

How can I achieve this without hard-coding the ClickOnce deployment path into my project?

Thanks,

Daniel

A: 

You can't include the files in the ClickOnce publishing to the file share and not include them in the deployment to the client. The only way to do that is to put the files there yourself.

The difficulty lies in getting the location of the deployment. I vaguely remember that the activationURI is only available if the user runs it by calling the link to the application file in the browser or the application is online-only. You could try making your app online only and retrieving that property and see if it's not null.

The one you're interested in in ApplicatoinDeployment.CurrentDeployment.ActivationUri.

Have you considered including them as an embedded resource?

RobinDotNet

RobinDotNet
Could an embedded resource be shared centrally?
Daniel Skinner
No. But if you embed the html, the user can't go track down the files and use them. Are they huge? Is that why you don't want to just deploy them with the application? Or do you want to be able to go edit them on the server?
RobinDotNet
Some data needs to be stored and shared centrally. The files aren't big.
Daniel Skinner
I guess I'm trying to figure out WHY the data HAS to be shared centrally. If you're not modifying it on the server, and the files aren't big, why not just deploy them with the application? If they change, you can change them in the project and deploy a new version. If you really want to have them on the server in a shared location, you can't include them in your project and deploy them and not have them install on the user's computer. You'll have to find another way to store them and access them.
RobinDotNet