Service Fabric System.BadImageFormatException

后端 未结 2 2006
后悔当初
后悔当初 2021-01-05 13:33

I downloaded the latest version of Service Fabric SDK 2.4.164 and try to create a new simple stateless service. Build succeeded but when I run it to debug I got:

相关标签:
2条回答
  • 2021-01-05 13:55

    Azure Service Fabri only supports x64 platform. It seems you're using some x86 tools. If you have installed dotnet (CLI) tools for x64 and x86 then check Path environment variable. The first one should be path to the x64 components, it helped me to solve the same issue

    0 讨论(0)
  • 2021-01-05 14:06

    All Service Fabric assemblies are compiled to x64. Make sure your project is also targeting x64, and not AnyCPU.

    The best way to do this is to go into Configuration Manager in Visual Studio, create x64 build configurations for each project, and then delete all of the AnyCPU build configurations. That's how the Service Fabric project templates in Visual Studio are set up. But if you create a project from a different template, like Console Application or Class Library, it will be created with an AnyCPU build configuration - you need to change that to x64 if you reference any Service Fabric assemblies.

    0 讨论(0)
提交回复
热议问题