Search code examples
c#dependenciesdependency-management

Why does my .NET 6 application require .NET 6 SDK to run?


I created a video game with a custom game engine in C# and I recently migrated everything to .NET 6. All of my projects have the TargetFramework "net6.0-windows" or "net6.0" and all works really well for me. However, my players told me, they needed to install .NET 6 SDK on their computers although .NET 6 was already installed. I do not understand where the dependency to the SDK comes from. Is there any settings I need to set that the non-SDK libraries are being used?

I have a few dependencies in my projects which also could lead to the SDK dependency of my game:

  • gRPC (i.e. Google.Protobuf, Grpc.AspNetCore, Grpc.Net.Client, Grpc.Tools)
  • Database stuff (System.Data.SQLite)
  • Logging (log4net)
  • Some basics (Newtonsoft.Json, System.Drawing.Common, System.Management)

Any tips on how to find the dependency?


Solution

  • What they really need to install (because your application targets net6.0-windows and probably uses Winforms or WPF) is not the SDK, but the ".NET 6.0 desktop runtime". This is a separate download on the .NET download page that is easily overlooked. It's on the right column here, the second heading (".NET Desktop Runtime 6.0.7" is the latest, as of now).

    Of course, installing the SDK includes the parts from the desktop runtime, so that works as well, even though it includes more than what the clients would actually need.