在部署使用ClickOnce C#解决方案外部文件 [英] Deploy external file in c# solution with clickonce

查看:627
本文介绍了在部署使用ClickOnce C#解决方案外部文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经与Visual Studio Express的2010 C#版中的问题。
我已经引用一个DLL的项目。这个DLL有标记为
生成操作外部Excel文件=内容
复制到输出目录=一直拷贝

I've a problem with Visual Studio Express 2010 c# edition. I've a project that reference a DLL. This DLL has an external Excel file marked as Build Action = Content Copy to Output Directory = Copy Always

当我构建解决方案,这Excel文件被正确地复制到BIN\release解决方案文件夹。

When I build the solution, this Excel file is correctly copied into BIN\release solution folder.

但是,如果我尝试部署同样的解决方案,与发布向导,Excel文件未在复制安装目录。

BUT if I try to deploy the same solution, with Publish wizard, the Excel file is not copied in the install directory.

请,任何人都可以帮我吗?

Please, could anyone help me?

推荐答案

您说该Excel文件由要包括在项目中的DLL只引用?这是一个次要的参考,而的ClickOnce不会看到它,并自动包含文件。

Are you saying that the Excel file is referenced only by the dll you are including in your project? That is a secondary reference, and ClickOnce will not see it and automatically include the file.

首先,在您的DLL,我假设它是由您的项目中直接引用。如果是这样,那么可以肯定你已经把它添加到您的项目,并设置生成操作为none和复制到输出目录到不要复制。然后删除您参考,并重新添加它,它指向现在包含在你的项目的版本。将复制本地属性设置为真。这将确保本身已被正确部署该dll。

First, on your dll, I'm assuming it is referenced directly by your project. If so, then be sure you have added it to your project and set the Build Action to "none" and "copy to output directory" to "do not copy". Then delete your reference to it and re-add it, pointing it to the version now included in your project. Set the "copy local" property to "true". This will ensure the dll itself gets deployed correctly.

有关Excel文件,你将不得不将其添加到您的项目。设置构建行动内容,并设置复制到输出目录为复制总是。这将是因为它是对的ClickOnce应用程序的辅助参考无法自动列入,如DLL不是直接/主要参考。

For the Excel file, you are going to have to add it to your project. Set the build action to "content" and set "copy to output directory" as "copy always". It will not be included automatically because it is a secondary reference to the ClickOnce app, not a direct/primary reference like the dll is.

这篇关于在部署使用ClickOnce C#解决方案外部文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆