Results 1 to 10 of 10

Thread: targets a different processor than the application

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2010
    Location
    UK
    Posts
    288

    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.

    One day I found VB.
    Now I live in the state of Confusion.

  2. #2
    PowerPoster Radjesh Klauke's Avatar
    Join Date
    Dec 2005
    Location
    Sexbierum (Netherlands)
    Posts
    2,244

    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.


    If you found my post helpful, please rate it.

    Codebank Submission: FireFox Browser (Gecko) in VB.NET, Load files, (sub)folders treeview with Windows icons

  3. #3
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    38,988

    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.
    My usual boring signature: Nothing

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2010
    Location
    UK
    Posts
    288

    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.
    One day I found VB.
    Now I live in the state of Confusion.

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: targets a different processor than the application

    Given that the path of the log4net assembly is:
    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.

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2010
    Location
    UK
    Posts
    288

    Re: targets a different processor than the application

    Quote Originally Posted by jmcilhinney View Post
    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?
    One day I found VB.
    Now I live in the state of Confusion.

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: targets a different processor than the application

    Quote Originally Posted by ConfusedAgain View Post
    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 View Post
    how can I tell what part of the system is using that log4net assembly?
    Do you have a log4net section in your config file?

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2010
    Location
    UK
    Posts
    288

    Re: targets a different processor than the application

    Quote Originally Posted by jmcilhinney View Post
    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.
    One day I found VB.
    Now I live in the state of Confusion.

  9. #9
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,299

    Re: targets a different processor than the application

    What libraries does your application reference?

  10. #10

    Thread Starter
    Hyperactive Member
    Join Date
    Jul 2010
    Location
    UK
    Posts
    288

    Re: targets a different processor than the application

    I have attached a screen print of all references used in the project.
    Attached Images Attached Images  
    One day I found VB.
    Now I live in the state of Confusion.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width