targets a different processor than the application
I get this warning message when I run my project. Can someone explain to me what this means and how I can remove it, or if I need to worry about it.
The message is:
Referenced assembly 'C:\windows\assembly\GAC_32\log4net\1.2.10.0__692fbea5521e1304\log4net.dll' targets a different processor than the application.
:eek2:
Re: targets a different processor than the application
Looks to me like a Target CPU issue. (project properties - compile - advanced compile option - target cpu)
Change it to "any" an see what happens.
Re: targets a different processor than the application
Did you write that dll, or did it come from somebody else?
You can certainly set the Target CPU, but by default it will be set to Any, I think. What the warning means is that your program targets one CPU (x86 or 64) while the dll targets a different CPU. Whether or not that will cause you any trouble is hard to say. I would guess that the dll, if it was not made by you, probably targets x86, but I say that for no other reason than that I think it slightly more common, still. There shouldn't be too much of an issue if this is the case, because a 64-bit system will still run 32-bit software, but if the dll targets 64-bit, while your program targets x86 (32-bit) then that will probably cause you trouble, especially if you try to run the program on a 32-bit computer.
Re: targets a different processor than the application
Thank you for your comments that gives me a better understanding. I have also tried changing the Target CPU but this makes no difference.
Also, I have found when I look for that dll on my machine it does not seem to be there.
I am getting to the stage where I think I might create a new program and import all objects into that and build it up from there. I am getting too many odd things coming that are worrying me for when this get installed on other PC's.
Re: targets a different processor than the application
Given that the path of the log4net assembly is:
Quote:
C:\windows\assembly\GAC_32\log4net\1.2.10.0__692fbea5521e1304\log4net.dll
it is fairly obvious that that is a 32-bit version. Either you need to make your app 32-bit, i.e. target the x86 platform, or else get a 64-bit version of log4net.
Re: targets a different processor than the application
Quote:
Originally Posted by
jmcilhinney
Given that the path of the log4net assembly is:it is fairly obvious that that is a 32-bit version. Either you need to make your app 32-bit, i.e. target the x86 platform, or else get a 64-bit version of log4net.
Thank you for that.
Will this not be ok as 64-bit system will still run 32-bit software as mentioned earlier or are you saying otherwise. Also, how can I tell what part of the system is using that log4net assembly?
Re: targets a different processor than the application
Quote:
Originally Posted by
ConfusedAgain
Will this not be ok as 64-bit system will still run 32-bit software as mentioned earlier or are you saying otherwise.
I'm not sure of the exact question you're asking there but it's like this. If you target x86 then your app will always run in 32-bit mode regardless of the OS. If you target x64 then your app will only run on 64-bit systems and it will run in 64-bit mode. If you target Any CPU then your app will run in 32-bit mode on 32-bit systems and in 64-bit mode on 64-bit systems. Whatever mode your app is running in, all libraries it uses, whether referenced at compile time or loaded dynamically at run time, must be running in the same mode.
Quote:
Originally Posted by
ConfusedAgain
how can I tell what part of the system is using that log4net assembly?
Do you have a log4net section in your config file?
Re: targets a different processor than the application
Quote:
Originally Posted by
jmcilhinney
I'm not sure of the exact question you're asking there but it's like this. If you target x86 then your app will always run in 32-bit mode regardless of the OS. If you target x64 then your app will only run on 64-bit systems and it will run in 64-bit mode. If you target Any CPU then your app will run in 32-bit mode on 32-bit systems and in 64-bit mode on 64-bit systems. Whatever mode your app is running in, all libraries it uses, whether referenced at compile time or loaded dynamically at run time, must be running in the same mode.
Do you have a log4net section in your config file?
There is no reference to log4net in the config file.
Re: targets a different processor than the application
What libraries does your application reference?
1 Attachment(s)
Re: targets a different processor than the application
I have attached a screen print of all references used in the project.