A stateless service made in Core 3.1 requires a Nuget package that is being problematic. If my csproj looks like the default of:
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsServiceFabricServiceProject>True</IsServiceFabricServiceProject>
<ServerGarbageCollection>True</ServerGarbageCollection>
<RuntimeIdentifier>win7-x64</RuntimeIdentifier>
<TargetLatestRuntimePatch>False</TargetLatestRuntimePatch>
<Configurations>Debug;Release;Staging</Configurations>
</PropertyGroup>
The application fails to run locally due to a System.BadImageFormatException: 'An attempt was made to load a program with an incorrect format. (0x8007000B)
Modifying the csproj to look like:
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<IsServiceFabricServiceProject>True</IsServiceFabricServiceProject>
<ServerGarbageCollection>True</ServerGarbageCollection>
<TargetLatestRuntimePatch>False</TargetLatestRuntimePatch>
<Configurations>Debug;Release;Staging</Configurations>
<Platforms>x64</Platforms>
</PropertyGroup>
Allows it to work correctly when deployed to my local cluster on my machine for testing.
Once deployed to Azure however, it's failing. I can't determine the source or error message. None of my logging is being invoked, so I assume it's failing at a very early point. Service Fabric Explorer is giving a very unhelpful, generic error message of There was an error during CodePackage activation.Container failed to start for image, exit code: 2147516547.
Why is local vs Azure behaving differently and is it possible to make some change to get Azure to work like the local cluster so that this runs?