另一个 ClickOnce GAC 参考问题

发布于 2024-11-30 05:45:59 字数 646 浏览 1 评论 0原文

我正在尝试部署更新,突然收到有关需要在 GAC 中安装 log4net.dll 版本 1.2.10.0 的消息。这是版本号 38,我将属性设置为 Copy Local = true,并将应用程序文件设置上的值设置为 Include。我什至放弃了,将log4net.dll注册到目标机器上的GAC中。有趣的是,这个更新在另外两台计算机上运行得很好。

我不确定自上次更新以来可能发生了什么变化?

欢呼

鲍勃

编辑:我在 log4net 的清单文件中找到了此条目。它不在我使用 log4net 的其他应用程序的任何其他清单文件中吗?然而,如果我尝试修改该文件,clickonce 就会知道并说安装已损坏。

<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
  <assemblyIdentity name="log4net" version="1.2.10.0" publicKeyToken="692FBEA5521E1304" language="neutral" processorArchitecture="x86" />
</dependentAssembly>

I am trying to deploy an update and all of a sudden I am getting the message about log4net.dll version 1.2.10.0 needing to be installed in the GAC. This is version number 38 and I have property set to Copy Local = true, and set the value to Include on the Application Files setting. I even gave up and registered the log4net.dll into the GAC on the target machine. Funny thing is this update rolls out just fine on two other computers.

I am not sure what might have changed since the last update?

cheers

bob

edit: I found this entry in the manifest file for log4net. It is not in any of the other manifest files for other applications where I use log4net? Yet if I try to modify the file, clickonce knows and says the install is corrupted.

<dependency>
<dependentAssembly dependencyType="preRequisite" allowDelayedBinding="true">
  <assemblyIdentity name="log4net" version="1.2.10.0" publicKeyToken="692FBEA5521E1304" language="neutral" processorArchitecture="x86" />
</dependentAssembly>

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

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

发布评论

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

评论(1

你的心境我的脸 2024-12-07 05:45:59

我最好的猜测是您对 log4net.dll 有两个依赖项。
On 直接来自您的项目,该项目已对其进行引用,其中一个是来自另一个库的隐式引用(通常是为 .net 1.1 编译的库,在我的例子中,它发生在 Crystal Reports 中)。我的猜测是这两个引用指向不同的版本。

  1. 您可以尝试将 log4net 安装在目标计算机上,并从 ClickOnce 项目的应用程序文件中排除它。这样,ClickOnce 安装就不需要它(但我不清楚安装后尝试运行应用程序时会发生什么)。
  2. 如果它不起作用或者在运行时失败,那么也许在引用它的项目中将复制本地和特定版本设置为 false 就可以解决问题。
    但是GAC中的log4net将成为应用程序运行的先决条件,这意味着您需要安装.NET 1.1(或完整的2.0/3.5)。 350MB 的先决条件相当重...
  3. 您在发布后更改清单文件的想法可以
    工作。为了避免 ClickOnce 提示安装已损坏,您
    需要使用 MAGE(清单编辑和
    生成工具,通常可从“开始”菜单组获取
    视觉工作室)。我不知道如果你的申请会发生什么
    在运行时确实需要 log4net 但找不到它。

My best guess would be that you have two dependencies to log4net.dll.
On comes directly from your project, which has it referenced, and one is an implicit reference from another library (typically a library compiled for .net 1.1, in my case it happened with Crystal Reports). My guess is that this two references point to different versions.

  1. You could try leaving log4net installed on your target machine, and Exclude it from Application Files in the ClickOnce project. This way it will NOT be needed by the ClickOnce installation (but it's not clear to me what will happen once installed, when trying to run the application).
  2. If it doesn't work or if it fails at run-time, then maybe setting Copy Local and Specific Version to false in the project that references it would do the trick.
    But then log4net in the GAC will be a prerequisite for the application to run, which means you need to install .NET 1.1 (or 2.0/3.5 full). 350MB of prerequisite is quite heavy...
  3. Your idea of changing your manifest file after publishing could
    work. To avoid ClickOnce saying the installation is corrupted, you
    need to resign the publication using MAGE (Manifest Editing and
    Generation Tool, normally available from the Start Menu group from
    Visual Studio). I don't know what will happen if your application
    really needs log4net at run-time and cannot find it.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文