Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I think there are a couple solutions to your problem depending on the intent of your XML file.</p> <p><strong>Option #1</strong> If you are desiring to copy and XML file to the root install directory of your application each time that you publish the application, all you need to do is open your projects Properties dialog, go to the Publish tab and open the "Application Files..." dialog.</p> <p>By default, when an XML file is included with a project, ClickOnce specifies that these files should be published as a "Data File" (under the Publish Status option.)</p> <p>Change the Publish Status to Include, and the XML file will be copied to your installation folder, instead of the data folder.</p> <p><strong>Option #2</strong> If you are looking to create an XML file that will be used for caching user-specific settings which should persist across application updates, I recommend outputing a default XML file as mentioned in step #1, however, when the application starts check to see if the XML file is in a settings folder that you have created within the User's Profile folder. The first time that the application launches you will also need to check and see if your folder exists within the User's Profile. If not, create it and copy your default XML file.</p> <p>Within your application, you can obtain the user's data folder with the following line of code:</p> <pre><code>string folder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.UserProfile); </code></pre> <p>You should have full access to the user's profile folder for creation of folders and copying content, so you should have to worry about admin or special priviledges.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload