Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A .deploy file is not deploying an XML file

I'm developing an application using MS Visual C# 2008 Express that uses the ClickOnce deployment functionality. I publish the application to a a server where users can download it.

Upon running the application, it throws a file not found exception - it cannot find the XML file that the application pulls data from (Instructions.xml).

When I go to the server and into the Application Files folder, I see .deploy files. One of them is for Instructions.xml.deploy.

Why is Instructions.xml not being included in the user's download?

Of course, if I manually copy Instructions.xml to my personal copy of the program, the program works fine. But the publishing process is supposed to (via Instructions.xml.deploy?) copy / deploy this file automatically.

like image 427
Anthony Avatar asked Feb 26 '10 18:02

Anthony


1 Answers

The XML file is probably in the ClickOnce data directory (XML files are automatically marked as data files).

Read Accessing Local and Remote Data in ClickOnce Applications (MSDN). It explains how data files are used and accessed using ClickOnce. If you want to publish the XML file as an application file (you want it published to the same directory as the application), follow the steps below:

  1. Go into your Project's properties
  2. Go to the publish tab.
  3. Click "Application Files"
  4. Find your XML file in the list and change the "Publish Status" of your file to "Include".
  5. Change "Download Group" to "Required".

If you want to use it as a data file, there is an example in the mentioned article.

like image 92
dugas Avatar answered Nov 06 '22 04:11

dugas