deploy文件未部署XML文件

deploy文件未部署XML文件

本文介绍了.deploy文件未部署XML文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MS 开发应用程序使用ClickOnce部署功能。我将应用程序发布到服务器上,用户可以在该服务器上下载它。

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.

在运行该应用程序时,它会引发文件未找到异常-无法找到该应用程序所包含的XML文件从( Instructions.xml )中提取数据。

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).

当我进入服务器并进入Application Files文件夹时,我看到了.deploy文件。其中之一是 Instructions.xml.deploy

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

为什么 Instructions.xml 不会包含在用户的下载文件中吗?

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

当然,如果我手动复制 Instructions.xml 到我的程序的个人副本,该程序运行正常。但是发布过程应该(通过 Instructions.xml.deploy ?)自动复制/部署此文件。

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.

推荐答案

XML文件可能位于ClickOnce数据目录中(XML文件会自动标记为数据文件)。

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

读取 (MSDN )。它说明了如何使用ClickOnce使用和访问数据文件。如果要将XML文件发布为应用程序文件(希望将其发布到应用程序所在的目录),请按照以下步骤操作:

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. 进入项目的属性

  2. 转到发布选项卡。

  3. 单击应用程序文件

  4. 在列表中找到XML文件,并将文件的发布状态更改为包含。

  5. 将下载组更改为必需。

  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.

这篇关于.deploy文件未部署XML文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 21:55