Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Processor Architecture Mismatch Warning (MSB3270) During Docker-Compose Build #449

Open
zugzwangm opened this issue Nov 14, 2024 · 1 comment
Labels
workaround-available Apply this label when there is an easy workaround available.

Comments

@zugzwangm
Copy link

zugzwangm commented Nov 14, 2024

Processor Architecture Mismatch Warning (MSB3270) During Docker-Compose Build

Description

When using a Docker Compose project with an ASP.NET Core application (tested on versions 8 and 9), and setting the ASP.NET platform target to x64 (due to the use of native packages), the Docker Compose build phase generates the following warning:

warning MSB3270: There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "<ASPNET project DLL>", "AMD64".

Steps to Reproduce

  1. Create a Docker Compose project with an ASP.NET Core application.
  2. Set the platform target for the ASP.NET project to x64 (typically needed when using native packages).
  3. Build.

Environment

  • Visual Studio: Tested on 17.11.x and 17.12.0
  • ASP.NET Core: Tested on .NET 8 and .NET 9

Additional Information

  • The mismatch is between the docker-compose project architecture ("MSIL"; why is it MSIL?) and the referenced ASP.NET DLL ("AMD64").

Workaround

The workaround provided by @NCarlsonMSFT works great!

@NCarlsonMSFT NCarlsonMSFT added Needs more info Apply this label for the bugs where a some new information is needed from the customer. and removed Needs more info Apply this label for the bugs where a some new information is needed from the customer. labels Nov 14, 2024
@NCarlsonMSFT
Copy link
Member

The warning is harmless as the compose project doesn't have real output referencing the csproj. As a workaround you can change the "platform" of the .dcproj

<PropertyGroup>
  <PlatformTarget>x64</PlatformTarget>
</PropertyGroup>

@NCarlsonMSFT NCarlsonMSFT added the workaround-available Apply this label when there is an easy workaround available. label Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
workaround-available Apply this label when there is an easy workaround available.
Projects
None yet
Development

No branches or pull requests

2 participants