Click here to Skip to main content
15,889,595 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello guys,

I've app that I want to deploy it on 32bit. When I change to 32 bit, it gave me this error:

File 'log4net.dll' targeting 'AMD64' is not compatible with the project's target platform 'x86'
Posted
Comments
Sergey Alexandrovich Kryukov 31-Mar-13 21:27pm    
I don't know where you got "AMD64". .NET usually use the term "x86-64" for this instruction-set architecture, in contrast to "Itanium" (another 64-bit this instruction-set architecture). You cannot mix them in one process; it never ever works.
—SA

1 solution

Please see my comment to the question. Compile all the assemblies used in your process to the same target instruction-set architecture (http://en.wikipedia.org/wiki/Instruction_set[^]).

Prefer using the target "AnyCPU", them the actual target will be determined by the platform when the application is loaded. If one of the components (.NET assemblies or unmanaged code modules) still have to be compiled for some particular architecture, the final architecture is defined by targeting the entry assembly of the application.

With Visual Studio, please see the project properties window.

—SA
 
Share this answer
 
Comments
Member 8584763 1-Apr-13 7:47am    
I used in my project x86 and for deployment I used the same x86.

when I used x64 and for deployment I used the same x64. It didn't give me any error, but I need it to work on x86?

That's when I get the error.
Sergey Alexandrovich Kryukov 1-Apr-13 9:15am    
Is you need to work on x86, you need to build your entry assembly of the application to the target x86, and all other assemblies can be "AnyCPU" or x86, but nothing else. The thing is: OS will support two targets: one is its native x86-64 (or Itanium), the second one is compatibility x86 which can be executed on WoW64. You need to tell OS about it, that's why you need to have the entry assembly built to a certain target (not "AnyCPU").

But why not having deployment for x86-64? Of course, if some of your customers uses x86, you would need to support it. Usually, it is done via "AnyCPU", unless you have some CPU-specific (unmanaged) modules.

I would also advise to build everything from source; don't use pre-built DLL or something...

—SA
Member 8584763 1-Apr-13 9:51am    
I tried to put "Any CPU" and for the deployment I put x64 it works, but when I put x86, it didn't work?

Do you think the problem is CR?
Sergey Alexandrovich Kryukov 1-Apr-13 10:36am    
You need to take into account each and every of the factors I mentioned before.
You should know targets of all assemblies of your project and the platform's. You you cannot analyze it by your self, list them all.
—SA
Member 8584763 1-Apr-13 11:47am    
There're as followings:

stdole.dll
log4net.dll
Microsoft.VisualC.STLCR.dll
CrystalDecisions.Data.AdoDontNetInterop.dll
CrystalDecision.Shared.dll
CrystalDecision.ReportSource.dll
CrystalDecision.ReportAppServer.Prompting.dll CrystalDecision.Enterprise.Viewing.ReportScource.dll

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