Development
Now Reading
Azure Service Fabric warnings about mismatched processor architecture
0

Azure Service Fabric warnings about mismatched processor architecture

While developing an application that will be hosted on Azure Service Fabric and adding a .NET Standard library or project, Visual Studio might display a warning like this one:

Warning MSB3270 There was a mismatch between the processor architecture of the project being built “MSIL” and the processor architecture of the reference “C:\[…]”, “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.

Turned out that the problem is that the only supported platform for Azure Service Fabric is x64 so you receive that warning when your target CPU for building is AnyCPU. The library will probably work anyway but to solve that problem you must either choose x64 as a target in the Build section

or set the target processor architecture inside the .csproj file:

<PropertyGroup>
    <TargetFramework>netcoreapp2.0</TargetFramework>
    <PlatformTarget>x64</PlatformTarget>
    <RootNamespace>Microsoft.*.Tests</RootNamespace>
</PropertyGroup>

Save the file and build the library again: you should not see those warnings anymore.

Switching target processor architecture obviously makes that library unusable in 32bit context, something that you should be aware of.

What's your reaction?
Love It
0%
Interested
0%
Meh...
0%
What?
0%
Hate it
0%
Sad
0%
Laugh
0%
Sleep
0%
Wow !
0%
About The Author
The Server-Side Technology Staff
You must unlearn what you have learned.

Leave a Response