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:
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.
Leave a Response