ClickOnce - 覆盖内容文件

发布于 2024-07-09 01:25:20 字数 952 浏览 9 评论 0原文

我有一个使用 ClickOnce 部署的解决方案。

它由一个应用程序、几个引用的程序集组成 和 SQL Server Compact 数据库。

还有一个程序集没有被主应用程序引用, 但只是在运行时加载。 该程序集需要与 应用程序,与应用程序二进制文件位于同一目录中。

我设置 Visual Studio 将“插件”程序集复制到 \bin\debug (或 \bin\release) 编译后的UI项目目录。

然后我将该文件添加到 UI 项目中, 不作为参考,而只是作为文件。 我将构建操作设置为“内容”,这 它在 UI 项目的“属性/发布”对话框中显示的方式。

当我第一次发布该应用程序时,它非常有效。 但后来我更新了插件程序集,甚至给了它不同的版本号 再次发布,却发现程序集没有更新,而是第一个 曾经上传的一个仍在使用。 (即使是在没有事先安装的干净计算机上)。

我做了一些挖掘,发现程序集(LibComposites.dll)被复制 到 clickonce 应用程序存储二进制文件的目录 作为存储数据文件的目录。

在这两种情况下,都是第一个发布的版本。

总的来说,我有一个引用一些程序集的应用程序:

Control.exe 引用 --> LibLLC.dll、LibDataLayer.dll、 LibLLCExtenders.dll
负载于 运行时 --> LibComposites.dll(其中 还引用了 LibLLC.dll)

我需要将新版本的 LibComposites.dll 部署到同一目录 作为各自发布的应用程序。

为什么该程序集的第一个发布版本仍在使用中

如何强制 LibComposites.dll 被每次发布覆盖?

I have a solution that is deployed using ClickOnce.

It consists of an application, several referenced assemblies
and a SQL Server Compact database.

There is also an assembly which is not referenced by the main application,
but simply loaded at runtime. This assembly needs to be deployed along with
the application, in the same directory as the application binaries.

I set up Visual Studio to copy the "plugin" assembly to the \bin\debug (or \bin\release)
directory of the UI project after compilation.

I then added the file to the UI project,
not as a reference but simply as a file. I set the build action to "Content", this
way it shows up in the Properties/Publish dialogs of the UI project.

When I first published the application, it worked like a charm.
But then I updated the plugin assembly, even gave it a different version number
and published again, only to find the assembly had not been updated but the first
one ever uploaded was still being used. (Even on a clean computer with no prior install).

I did some digging and found that the assembly (LibComposites.dll) was copied
to both the directory where clickonce applications store their binaries
as the directory where they store the data files.

In both cases, the first ever published version.

In overview, I have an application that references some assemblies:

Control.exe references -->
LibLLC.dll, LibDataLayer.dll,
LibLLCExtenders.dll
loads at
runtime --> LibComposites.dll (which
also references LibLLC.dll)

I need to deploy a new version of LibComposites.dll to the same directory
as the application which each publish.

Why is the first ever published version of that assembly still being used

How can I force LibComposites.dll to be overwritten by every publish?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

递刀给你 2024-07-16 01:25:20

好吧,我也遇到了同样的问题。 这是我解决它的方法(可能不是理想的,但它有效。1

)如果您的 dll 或文件在解决方案中,我会将其取下并重新添加。
2) 进入项目属性并选择“发布和应用程序文件”。 您需要将文件放在那里并再次选择“包含”(而不是“自动”...)。

然后您就可以使用新的发布了。 我不知道为什么如果我不这样做它就不起作用,但每次发布时,我都必须执行这些步骤才能获得最新版本......

Alright, I had the SAME problem. Here is how I solve it (might not be the ideal but it works.

1) If your dll or file is inside the solution, I would take it off and re-add it.
2) Go inside the property of your project and select Publish and Application Files. You need to have your file there and to select AGAIN "Include" (not the Auto one...).

Than you will be able to publish with the new one. I do not know why it doesn't work if I do not do that but each Publish, I have to do these steps to be able to get the last version...

别在捏我脸啦 2024-07-16 01:25:20

让我澄清一下:您正在使用 Visual Studio 的发布功能来创建和部署 ClickOnce 包吗?

祝你好运。

您最好使用 Mage 构建自己的 ClickOnce 包

我开始走 Visual Studio 路线,很快发现这是一条通往痛苦的道路。 了解如何使用 Mage,然后查看一些用于“自动化”此操作的 MSBuild 选项。

Let me get this right: you're using Visual Studio's publish feature to create and deploy the ClickOnce package?

Good luck with that.

You might be better off building your own ClickOnce packages using Mage.

I started down the Visual Studio route, and quickly discovered it was the path to misery. Learn how to use Mage, and then look at some of the MSBuild options for "automating" this.

猫卆 2024-07-16 01:25:20

我遇到过同样的问题。 问题是我的 dll 位于应用程序的根目录中,并且它们位于项目中。

解决方案很简单,只需从项目中排除 dll 文件,这个问题就消失了。

I had the same issue. The issue was that I had the dll's in the root directory of the application and they were "in" in the project.

Solution is easy, just exclude the dll files from the project and this issue goes away.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文