Assembly generation -- Referenced assembly 'mscorlib.dll' targets a different processor
-
Thursday, June 02, 2011 11:50 PM
I received the warnings below when trying to build a WPF x64 release build in Win7 x64 using VS 2010 x64.
- Warning 1 Assembly generation -- Referenced assembly 'mscorlib.dll' targets a different processor
- Warning 2 Assembly generation -- Referenced assembly 'PresentationCore.dll' targets a different processor
- Warning 3 Assembly generation -- Referenced assembly 'System.Data.dll' targets a different processor
I hit these warnings because my debug build is x32. I tried the solutions provided in other threads below and none of them work.
(1) Use "Any CPU" instead of "Mixed Platforms" in the Configuration Manager. The thing is that no executable was generated in my bin folder if Any CPU was selected. I guess this is a VS 2010 bug. Does anyone know?
(2) In the Project\ project Properties tab. Go to Build tab. Click Advanced button. Check "Don't reference mscorlib.dll" It returns compilation error "Error 1 Predefined type 'System.Object' is not defined or imported"
Does anyone know how to get rid of these warnings?
thanks in advance.
All Replies
-
Friday, June 03, 2011 7:07 AM
Hi chengma,
Check two things:
1. Check your project file and the referenced assemblies: 'mscorlib.dll' 'PresentationCore.dll' 'System.Data.dll' path, if they are referenced to x64 framework or x86 framework.
2. Check if you have installed the x64 framework, and your installed framework may not store the 32-bit assemblies in the GAC. You could try to reinstall it.
Suggestion on it. Specify the target to "x64" or "x86" instead of "Any CPU". Any .Net application require the mscorlib.dll assembly, you cannot remove it.
And please view this thread which has the similar problem. http://social.msdn.microsoft.com/Forums/en-US/netfx64bit/thread/0264b645-f80b-4140-940c-4db7debe2a7a/
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

-
Friday, June 03, 2011 6:54 PM
I did specify the target to "x64" and "Mixed platform" instead of "Any CPU".
I noticed that the presentationCore is referencing the Path C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\v3.0\PresentationCore.dll. I didn't see the Frameworkx64\v3.0\PresentationCore.dll in the Reference list.
Do you know how to reinstall the x64 framework?
thanks
-
Monday, June 06, 2011 5:29 AM
x64 at "C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0", "C:\Program Files (x86)" is an x86 fodler. Please try to reference this assemblies and test again.
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

- Marked As Answer by chengma Tuesday, June 07, 2011 12:31 AM
-
Tuesday, June 07, 2011 12:34 AM
Thanks. I was able to build x64 build successfully after referencing the PresentationCore.dll at Add Reference\Browse\Specify the path "C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0"
-
Monday, February 13, 2012 11:09 PM
I was not. :(
The reference to mscorlib is implicit in any project and I am unable to update it.
My only workaround is to set the target to Any CPU which is less than ideal for web projects.
Any advice please??
If at first you don't succeed, ask an MVP.
-
Sunday, September 23, 2012 3:58 AM
x64 at "C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.0", "C:\Program Files (x86)" is an x86 fodler. Please try to reference this assemblies and test again.
Bob Bao [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

Thanks Mr. Bob Bao . i just solve my problem by changing to any CPU. thanks a lot
- Edited by Munibpk Sunday, September 23, 2012 4:59 AM
-
Sunday, September 23, 2012 4:55 AMHi, Just replace 'x86' to 'any CPU' . and it will solve the problem using VS 2010

