Application requires that assembly log4net

When I attempt to install my application via ClickOnce, I get this message:

Unable to install or run the application. The application requires that assembly log4net Version 1.2.10.0 be installed in the Global Assembly Cache (GAC) first.

I've tried installing on 3 machines, all Windows 7 64-bit. When I look in C:\Windows\assembly\ I see the file:
log4net   1.2.10.0    692fbea5521e1304    AMD64
 
The installation works on one machine. In its GAC I see the log4net  as above and I also see:
log4net   1.2.10.0    692fbea5521e1304    x86

So maybe, I need to install log4net 32 bit on these other machines.
If so, how do I do this?
LVL 1
allelopathAsked:
Who is Participating?
 
Naman GoelSoftware engineer 1Commented:
check each and every dll with coreflag tool

Please use tool CorFlags.exe to view the header of the DLL to identify
which target platform it is compiled to. Following are the instructions:
1. Open Visual Studio command prompt.
2. Type "CorFlags.exe <Assembly File Path>".
3. You will see its output like this:
Version : v2.0.50727
CLR Header : 2.5
PE : PE32
CorFlags : 11
ILONLY : 1
32BIT : 1
Signed : 1
4. The PE and 32BIT flags can be used to determine the type of the
assembly, please look up the following table:
anycpu: PE = PE32 and 32BIT = 0
x86: PE = PE32 and 32BIT = 1
64-bit: PE = PE32+ and 32BIT = 0

For more information, please refer to following links:

Moving from 32-bit to 64-bit application development on .NET Framework:
http://blogs.msdn.com/gauravseth/archive/2006/03/07/545104.aspx
0
 
Naman GoelSoftware engineer 1Commented:
To install a strong-named assembly into the global assembly cache using the Global Assembly Cache tool (Gacutil.exe)


At the command prompt, type the following command:

gacutil –I <assembly name>

In this command, assembly name is the name of the assembly to install in the global assembly cache.

http://msdn.microsoft.com/en-us/library/dkkx7f79.aspx
0
 
Easwaran ParamasivamCommented:
As Log4net is already signed assembly you could simply drag and drop to the folder 'C:\Windows\Assembly' folder.
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

 
allelopathAuthor Commented:
>>As Log4net is already signed assembly
How do you know this?

>>you could simply drag and drop to the folder 'C:\Windows\Assembly' folder.
drag from where?
0
 
Naman GoelSoftware engineer 1Commented:
Log4Net is signed assembly as it is apache API and it is coming as pre-signed Assembly.
You can drag from your project install location. from where you reference path of log4net in your project.
0
 
allelopathAuthor Commented:
>>At the command prompt, type the following command:
>>gacutil –I <assembly name>
log4net 64 bit is already installed. I would need to install log4net 32 bit.
How do I distinguish these?
0
 
Naman GoelSoftware engineer 1Commented:
you can check by using corflag.exe


      

You can use the corflags CLI tool to determine the status of an assembly, based on its output and opening an assembly as a binary asset you should be able to determine where you need to seek to determine if the 32BIT flag is set to 1 (x86) or 0 (Any CPU or x64, depending on PE):

Option    | PE    | 32BIT
----------|-------|---------
x86       | PE32  | 1
Any CPU   | PE32  | 0
x64       | PE32+ | 0

The blog post x64 Development with .NET has some information about corflags.

Even better, you can use Module.GetPEKind to determine whether an assembly is PortableExecutableKinds value PE32Plus (64-bit), Required32Bit (32-bit and WOW), or ILOnly (any CPU) along with other attributes.
0
 
allelopathAuthor Commented:
Not sure how to use corflags. First I go to the assembly directory. I see that there are log4net directories:

c:\Windows\assembly> dir /s /b log4net
c:\Windows\assembly\GAC_32\log4net
c:\Windows\assembly\GAC_64\log4net

Then...

c:\Windows\assembly\GAC_32>corflags log4net
Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  4.0.30319.1
Copyright (c) Microsoft Corporation.  All rights reserved.

corflags : error CF002 : Could not open file for reading

So I'm not doing something right.
0
 
allelopathAuthor Commented:
>>You can drag from your project install location.
Drag what? In that folder, it is all .deploy files.
0
 
Naman GoelSoftware engineer 1Commented:
open visual studio command prompt for me log4net.dll is in c:\

I typed following command
C:\>corflags log4net.dll

and output is :

Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  4.0.30319.1
Copyright (c) Microsoft Corporation.  All rights reserved.

Version   : v2.0.50727
CLR Header: 2.5
PE        : PE32
CorFlags  : 1
ILONLY    : 1
32BIT     : 0
Signed    : 0
0
 
allelopathAuthor Commented:
ok, got it:

c:\Development\Coal 2.2\Coal 2.2\bin>corflags log4net.dll
Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  4.0.30319.1
Copyright (c) Microsoft Corporation.  All rights reserved.

Version   : v2.0.50727
CLR Header: 2.5
PE        : PE32+
CorFlags  : 9
ILONLY    : 1
32BIT     : 0
Signed    : 1

64-bit: PE = PE32+ and 32BIT = 0
0
 
Naman GoelSoftware engineer 1Commented:
so it's 64 bit dll and what about other supporting dll's and GAC Dll all should be of 64 bit compilation .
0
 
iwstechuserCommented:
I had a similar issue with a desktop application and I was able to resolve it by going into Visual Studio - Publish/'Prerequisites' and clicking the box next to 'SAP Crystal Reports Runtime Engine for .NET Framework'.  The user on the other machine then installed the application, which first installed the Crystal Reports files and the printing now works.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.