Hello there! At my current workplace we write applications in .NET (C#), and I am running into some issues when having multiple .NET SDKs installed.
I created a very simple hello-world
web-api using .NET 8, which works great when .NET 9 is not installed. However if I install .NET 9 I wont be able to run .NET 8 applications anymore, as it complains about dynamically linked binaries, .NET 9 apps will run fine though. I have attempted to look into nix-ld
, but I can’t wrap my head around it, and also why it should be required depending on which SDKs I have installed.
without dotnetCorePackages.sdk_9_0
installed
with dotnetCorePackages.sdk_9_0
installed
I have .NET installed through home-manager with the following configuration
{ pkgs, lib, config, ... }:
{
options = {
dotnet.enable = lib.mkEnableOption "enable dotnet";
};
config = lib.mkIf config.dotnet.enable {
home.packages = with pkgs; [
netcoredbg
(with dotnetCorePackages; combinePackages [
sdk_7_0_3xx
sdk_8_0_2xx
sdk_9_0
])
];
};
}
So why don’t I just use nix shell
, direnv
and flakes for each project?
I have not really found a way to work it into my workflow yet with also using Rider, and also I am the only developer on my team using Nix, so the files in our version control for our project would only make sense to me.
I hope someone can enlighten me as to what is happening, such that I can have multiple versions of the SDK installed without weird issues.
Thanks in advance!