Bob Cummings
Bob Cummings

Reputation: 422

Yet another ClickOnce GAC reference question

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>

Upvotes: 3

Views: 2509

Answers (1)

Evren Kuzucuoglu
Evren Kuzucuoglu

Reputation: 3885

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.

Upvotes: 2

Related Questions