VS2017中Service Fabric选ASP.NET Core2.0却生成.NET4.6.1项目的疑问
Hey there! I totally get why this confusion hits—let’s break down exactly what’s going on with your Visual Studio 2017 setup:
Early Service Fabric template design choices
Back when Visual Studio 2017 was the current release, Service Fabric’s ASP.NET Core service templates were built to run on top of the .NET Framework, not the cross-platform .NET Core runtime. Even though you selected "ASP.NET Core 2.0", this referred to the ASP.NET Core framework version, not the underlying runtime. The template leaned on .NET Framework because Service Fabric’s Windows runtime had deeper, more stable integration with it at that time.Template option ambiguity
That "ASP.NET Core 2.0" dropdown in the wizard can be misleading. It doesn’t switch the project to use .NET Core as the runtime; instead, it sets up an ASP.NET Core 2.0 application that runs on .NET Framework 4.6.1. Pure .NET Core-based Service Fabric service templates didn’t roll out until later versions of Visual Studio (like 2019 and beyond).Technical compatibility constraints
Back then, some core Service Fabric features—certain communication APIs, service discovery hooks, and runtime integrations—weren’t fully supported on the .NET Core runtime. Microsoft stuck with .NET Framework 4.6.1 as the default to make sure your Service Fabric services had access to all features without stability gaps.
If you want to build Service Fabric services using the cross-platform .NET Core runtime, you’ll need to upgrade to a newer Visual Studio version (2019 or later) paired with the updated Service Fabric SDK—those templates include explicit options for .NET Core/.NET 5+ as the underlying runtime.
内容的提问来源于stack exchange,提问作者aroratheneo

