ClickOnce-覆盖内容文件 [英] ClickOnce - Overwriting content files

查看:98
本文介绍了ClickOnce-覆盖内容文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a solution that is deployed using ClickOnce.

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

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.

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

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

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

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

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

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参考-> LibLLC.dll,LibDataLayer.dll, LibLLCExtenders.dll
加载于 运行时-> LibComposites.dll(其中 还引用了LibLLC.dll)

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

我需要将新版本的LibComposites.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

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

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

推荐答案

好的,我遇到了相同的问题.这是我解决的方法(可能不是理想的方法,但是它能起作用.

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

1)如果解决方案中包含您的dll或文件,我将其取下并重新添加. 2)进入项目的属性,然后选择发布和应用程序文件.您需要在此处保存文件,然后选择再次包含"(不是自动" ...).

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

这篇关于ClickOnce-覆盖内容文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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