Skip to content

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

Open

Description

@zugzwangm

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 Nathan Carlson (@NCarlsonMSFT) works great!

Activity

  1. added
    Needs more info
    and removed
    Needs more info
    on Nov 14, 2024
  2. NCarlsonMSFT commented on Nov 14, 2024

    @NCarlsonMSFT
    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>
  3. added
    workaround-available
    on Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    workaround-available

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions