Click here to Skip to main content
15,896,207 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
Error	5	File 'log4net.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'	E:\JavedBakup\Qlait30Dec2016\QlaitV1.9\QlaitV1.9.vdproj	QlaitV1.9


What I have tried:

Setup Related Question



<pre>Error	5	File 'log4net.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'	E:\JavedBakup\Qlait30Dec2016\QlaitV1.9\QlaitV1.9.vdproj	QlaitV1.9
Posted
Updated 11-Apr-17 2:33am
Comments
Wessel Beulink 11-Apr-17 7:53am    
Run it x64 instead of x86.
ZurdoDev 11-Apr-17 7:54am    
And fix your title.
CHill60 11-Apr-17 7:55am    
What is your problem? The project's target platform is 'x86'. log4net.dll targets 'AM64'. When is this error happening? Is it a sudden change (i.e. it was working before, nothing has changed, but suddenly stops working)?
Is this from a setup program - is that what you mean by "Setup Related Question"
[no name] 11-Apr-17 8:20am    
"Setup Related Question", where? There isn't any question at all here.

When you build an application for X86 you are building it for a 32bit environment - and while you can run a 32 bit app in a 64 bit environment, you can't "mix-n-match" the two.
The Log4Net assembly you are referencing is a 64 bit file: it was built for x64 instead of x86 - and you can't access 64 bit code from a 32 bit app because all the support code (the memory allocation system for example) is all loaded for the original 32 bit application.

You can change your Assembly properties to build it for x64:
Open your solution in VS.
Open the Solution Explorer pane
Open the project branch, and then double click on "Properties".
In the page that appears, select the "Build" tab on the left, and change "Platform target" to "x64".

Save the page, and rebuild your app.
 
Share this answer
 
You've got a log4net project that's being built as a 64-bit .DLL. You cannot use that library in a 32-bit project (x86).

Either get the 32-bit version of log4net or change your project properties to target 64-bit (x64). Keep in mind that targeting 64-bit only will not allow your code to run on 32-bit Windows.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900