Home Dashboard Directory Help
Search

New VS2010 project compiler warning since installing DotNet4.5/VS2011 beta by SamCPP


Status: 

Closed
 as Fixed Help for as Fixed


24
0
Sign in
to vote
Type: Bug
ID: 728995
Opened: 3/5/2012 9:35:05 PM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
2
Workaround(s)
view
22
User(s) can reproduce this bug

Description

Since installing Dot Net 4.5 beta and VS2011 beta, one of my VS2010 projects receives this warning when compiling for every reference in the solution:

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1546,5): warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "log4net, Version=1.2.10.0, Culture=neutral, PublicKeyToken=1b44e1d426115821, processorArchitecture=MSIL", "AMD64". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.
Details
Sign in to post a comment.
Posted by John J. Hughes II on 8/17/2012 at 7:46 AM
I am using the "Uninstall VS 2012 RC" and reinstall .NET 4.0 solution. With all the other problems with VS2012 I am starting to wonder if there is even a reason to get the new version, very sad!
Posted by Microsoft on 4/19/2012 at 10:54 AM
That's correct. The issue and corresponding fix was in .NET 4.5, not VS11 Beta.
Posted by Pete Mac on 4/18/2012 at 3:18 PM
Note: this does not require installation of VS2011 beta. Simply installing .NET 4.5 will break MSIL builds that are "side by side" with x64.
Posted by Microsoft on 4/13/2012 at 1:07 PM
Correction to message on 4/12 11:32am: this issue will be fixed in the RTM release of .NET 4.5.
Posted by Microsoft on 4/13/2012 at 11:32 AM
Thanks for all the feedback. This issue will be fixed in the next release of .NET 4.5.
Posted by juFo on 4/13/2012 at 1:14 AM
also have this since installing .NET4.5 a,d VS11 beta
Posted by Microsoft on 4/6/2012 at 12:33 PM
The warnings are real in many cases. The bug was that even though some projects were targeting the same architecture, the warnings were being displayed.
Posted by Matthew Watson on 4/5/2012 at 5:55 AM
I'm not sure this is a bug.

I've started receiving this warning on a lot of our projects. However, when I look at them, I can see that some of the projects are indeed x86 and others are AnyCPU. So for me at least, the warnings are real.
Posted by Microsoft on 3/30/2012 at 1:08 PM
Sorry. Try <PlatformTarget>. Does that work?
Posted by AndyDent on 3/30/2012 at 12:15 AM
WHERE do you put the addition to the vcxproj file?

<PropertyGroup>
<TargetPlatform>x86</TargetPlatform>
</PropertyGroup>?

I can't get this to make any difference.

Also, is it TargetPlatform or PlatformTarget? The workarounds tab here and other references suggest PlatformTarget
Posted by SamCPP on 3/29/2012 at 9:59 PM
Workaround 3 working locally but unfortunately has to be set on a project by project basis.

Workaround 2 is not practical if you wish to generate a single build that is to be deployed on a 32-bit or 64-bit environment.

Currently using Workaround 1!
Posted by Microsoft on 3/29/2012 at 9:24 AM
If anyone hitting this error still gets it after applying the workaround below, please let us know..
Posted by Microsoft on 3/16/2012 at 2:32 PM
Thank you for your feedback. This is happening because the targets are not setting the <TargetPlatform> property which is leading MSBuild to assume the project is MSIL and thus popping the warning. We will use a separate internal bug to look into what can be done post-Beta to solve this issue.

For Beta, you can either:
1. Ignore the warning, or
2. Set the following property in the project file to make MSBuild realize the project platform is x86:
<PropertyGroup>
<TargetPlatform>x86</TargetPlatform>
</PropertyGroup>
3. Set the following property in the project file to turn the warning off altogether:
<PropertyGroup>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>
Posted by ga2006 on 3/10/2012 at 10:09 PM
I get this too. I started after installation of VS 11 Beta.
Posted by James C. Papp on 3/8/2012 at 4:13 PM
We get this too. We made no changes to our solution; the warning just started firing after installing Visual Studio 11 Beta
Posted by chathaway on 3/8/2012 at 11:58 AM
I'm also getting this error in VS2010 and VS2011. Warning in VS2010, Fatal build error in VS2011
Posted by Matthew Saunier on 3/6/2012 at 4:45 PM
I have also encountered this problem when adding a reference to VideoLan DotNet to a new Metro app, warning me that the reference is compiled against x86 and my processor target is MSIL, even though my project is set to target x86 only in the properties.
Posted by VBA Derks on 3/6/2012 at 1:17 PM
I have also observed this problem. It seems to be introduced with msbuild 4.0.30319.17379.

It is very easy to reproduce when adding a reference to a C++/CLR project to another C++/CLR project.
Posted by Alastair Maw on 3/6/2012 at 8:48 AM
Bug ID 728901 is probably also related to this.
Posted by Alastair Maw on 3/6/2012 at 8:47 AM
There is more info on this here: http://social.msdn.microsoft.com/Forums/is/vssetup/thread/785cbab8-8d52-4ce8-a1bb-ab6fe69c606f
Posted by MS-Moderator09 [Feedback Moderator] on 3/6/2012 at 2:33 AM
Thanks for reporting the issue.
In order to fix the issue, we must first reproduce the issue in our labs. We are unable to reproduce the issue with the steps you provided.

Could you please attach /v:diag log file to this feedback through our site to help us investigate the issue?

You can get them easily by going to Tools/Options, Projects/Solutions, Build/Run, and setting the MSBuild verbosity to "Diagnostic" in both dropdowns. Then, just copy from the Output Window in the IDE, paste it into a text file and send a copy of it to us. For command line, you can pass in "/v:diag" switch to MSBuild.EXE and it will produce a diagnostic-level log.


Thanks again for your efforts and we look forward to hearing from you.
Posted by MS-Moderator01 on 3/6/2012 at 1:12 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by Pete Mac on 4/18/2012 at 3:19 PM
Uninstall the beta, reinstall .NET 4.0
Posted by VBA Derks on 3/6/2012 at 1:19 PM
For C++/CLR projects the solution is to add <PlatformTarget>x86</PlatformTarget> to the 'configuration' section (or x64 when building a 64-bit solution).
File Name Submitted By Submitted On File Size  
diag.log (restricted) 3/16/2012 -