Home Dashboard Directory Help
Search

Irritating warning from msbuild (?) by thomas_woelfer


Status: 

Closed
 as By Design Help for as By Design


6
0
Sign in
to vote
Type: Bug
ID: 738322
Opened: 4/23/2012 11:07:52 AM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
0
Workaround(s)
view
3
User(s) can reproduce this bug

Description

after installing vs 11 beta, i get a message like the following for each of my c# project that references a c++ project:

===========
66>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 "C:\Statik\kernel\managed\kernel.managed.calculations.profiles\DebugX64\kernel.managed.calculations.profiles.dll", "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.
============

there a so many of these messages, that the error list becomes unusable. i have no idea what vs is trying to tell me, however, the resulting code runs just fine (as it has for several years now). i also noted that i receive the same warning in vs 2010 builds - _after_ i installed vs 11 beta. (thus i assume this is something out of the "updated" msbuild for net 4.5. but i'm just guessing...)
Details
Sign in to post a comment.
Posted by John Calvert on 7/9/2013 at 2:02 PM
It should be possible to suppress MSBuild warnings by number in the project Build properties but it isn't. It would be great if MS would add this capability.
Posted by thomas_woelfer on 5/4/2012 at 5:50 AM
Dan,

yes, i understand what the warning is trying to tell me. however, i don't think my scenario is all that uncommon. we produce a 32bit and a 64bit version of our app: we only compile the c# code once with "AnyCPU", and the c++ code twice: once for 32bit once for 64bit. the bitnes of the application is then decided an install time: everyone gets the msil installed, and on 32bit machines we install the 32bit c++ dlls, on 64bit machines we install the 64bit dlls.

thus, when compiling, the c# code is msil, anyCPU, the c++ code is either 32 or 64 bit. i don't see any other practical way to produce a 32 as well as a 64bit version of an app - or is there? i assume there isn't, and this is why i think that warning is annoying.

if there is no other way, i will try to remove the warning using the propertyGroup you suggested. (also as of now, i have absolutely no idea what exactly is needed in order to "add a property group" in visual studio.)
Posted by Microsoft on 4/27/2012 at 11:40 AM
Hi Thomas,
This is warning you that you may have a runtime failure. Because your exe is MSIL it will run with the bitness of the OS it is run on. On a 32 bit OS it will run as a 32 bit process. Yet you are referencing a 64 bit only reference, and presumably it will therefore fail on a 32 bit OS.
Your options are either to change your exe to be explicitly 64 bit not MSIL, or if you want to disable the warning, add this property to your project.
<PropertyGroup>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
</PropertyGroup>

Thanks
Dan
Posted by MS-Moderator08 [Feedback Moderator] on 4/27/2012 at 3:12 AM
Thank you for submitting feedback on Visual Studio 11 and .NET Framework. Your issue has been routed to the appropriate VS development team for review. We will contact you if we require any additional information.

Posted by MS-Moderator01 on 4/23/2012 at 11:48 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.