安装项目不会替换程序集文件 [英] Setup Project does not replace assembly files

查看:98
本文介绍了安装项目不会替换程序集文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  1. 我有一个Windows应用程序项目 (A.exe)调用另一个项目 类库(B.dll).

  1. I have a Windows Application project (A.exe) that calls another project Class Library (B.dll).

A.exe具有一个按钮(myButton),该按钮 从B.dll调用方法Method1.

A.exe has a button (myButton) that calls the method Method1 from B.dll.

要安装我创建的应用程序 安装程序项目ASetup.vdproj,其 主要输出是项目A.

To install the application I created a Setup project ASetup.vdproj, whose Primary Output is project A.

编译设置后, 安装运行无任何 问题,当A.exe启动时,我 单击myButton,应用程序将给出 没有错误.

After compiling the setup, the installation runs without any problems, when A.exe starts and I click myButton, the aplication gives no error.

然后我更改了B.dll并添加了一个新 方法Method2.

Then I changed B.dll and added a new method Method2.

myButton现在正在从以下位置调用Method2 B.dll而不是Method1.

myButton is now calling Method2 from B.dll instead of Method1.

我增加了A.exe的版本, 增加版本 ASetup.vdproj,但不要增加 B.dll的版本.

I increased the version of A.exe and increment the version of ASetup.vdproj, but do not increase the version of B.dll.

安装应用程序后,我 注意到我有两个装置 控制面板中的A.exe->添加/ 删除程序.

After installing the application I noticed I had two installations of A.exe in Control Panel -> Add / Remove Programmes.

运行A.exe时,单击 myButton我收到一个错误, 找不到方法Method2 B.dll",则表示安装程序确实 在不替换B.dll的过程中 安装.

When running A.exe and click myButton I obtain an error, "The method Method2 was not found in B.dll", it means that the setup does not replace B.dll during installation.

我运行了卸载,并且注意到了 没有删除文件 从磁盘.

I ran the uninstall and I noticed that the files were not removed from disk.

我的问题是:

第二个安装为什么不更新B.dll? 如果B.dll的版本增加,则在安装过程中将替换B.dll,但是问题是我当前的项目中有许多外部程序集,如果它们没有被修改,则很难控制.基本上,我想要的是在每次安装中都替换所有程序集文件.

Why doesn’t the second installation update B.dll? If the version of B.dll is incremented, B.dll will be replaced during the installation, but the problem is that my current project has many external assemblies, which is difficult to control if they have been modified or not. Basically, what I want is that all assembly files are replaced in each installation.

我等待着大家的反馈. 谢谢您的关注.

I await feedback from all of you. Thank you for all the attention.

推荐答案

添加/删除程序"中的2个条目告诉我,您更改了ProductCode属性,但在升级表中没有有效的行来正确定义主版本.升级. MSI将其视为恰好安装在同一目录中的2种不同产品.卸载两个产品之一时,文件将保留,直到卸载另一个产品.

The 2 entries in Add/Remove Programs tells me that you changed the ProductCode property but didn't have a valid row in the Upgrade Table to properly define a Major Upgrade. MSI treats this as 2 different products that happen to get installed to the same directory. When you uninstall one of the two products the files remain until you uninstall the other product.

没有被覆盖的DLL向我暗示您没有将AssemblyFileVersion属性从一个内部版本更改为另一个内部版本.第一次安装是在1.0.0.0版本中复制的,第二次安装是"1.0.0.0已经存在,在这里什么也不能做",然后跳过它.

The DLL not being overwritten suggests to me that you didn't change the AssemblyFileVersion attribute from one build to another. The first install copies in 1.0.0.0 and the second install says "1.0.0.0 is already there, nothing to do here" and skips it.

这篇关于安装项目不会替换程序集文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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