DotNET: Difference between revisions

imported>MakiseKurisu
No edit summary
imported>Abowen
Add example with Rider
Line 105: Line 105:
== Global Tools ==
== Global Tools ==


Local instalation of .NET global tools is fully supported and preferred when possible - more info [https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools#install-a-local-tool in the Microsoft docs].
Local installation of .NET global tools is fully supported and preferred when possible - more info [https://learn.microsoft.com/en-us/dotnet/core/tools/global-tools#install-a-local-tool in the Microsoft docs].


For globally installing .NET tools, search if they are available as Nix packages - they are packaged as any other normal
For globally installing .NET tools, search if they are available as Nix packages - they are packaged as any other normal
Line 112: Line 112:
Note that Nix-packaged .NET tools use a special wrapper (toggled by <code>useDotnetFromEnv</code> option in <code>buildDotnetModule</code>) that automatically picks up .NET install from the user environment. If you want to use a
Note that Nix-packaged .NET tools use a special wrapper (toggled by <code>useDotnetFromEnv</code> option in <code>buildDotnetModule</code>) that automatically picks up .NET install from the user environment. If you want to use a
different SDK version with a Nix-packaged .NET tools than the default, make sure the <code>dotnet</code> CLI of your wanted SDK version is installed and available.
different SDK version with a Nix-packaged .NET tools than the default, make sure the <code>dotnet</code> CLI of your wanted SDK version is installed and available.
== Example: Running Rider with dotnet & PowerShell ==
<syntaxHighlight lang=nix>
with import <nixpkgs> {};
mkShell {
  name = "dotnet-env";
  packages = [
    (with dotnetCorePackages; combinePackages [
      sdk_6_0
      sdk_7_0
      sdk_8_0
    ])
    powershell
  ];
}
</syntaxHighlight>
To execute Rider
<syntaxHighlight lang=bash>
nix-shell ./dotnet.nix --run 'nohup rider &'
</syntaxHighlight>
This can be added as an alias to your shell if you update the reference to an absolute address, such as location within your home directory. e.g. `~/nix/dotnet.nix`


== Example: multi-SDK installation with local workload installation enabled ==
== Example: multi-SDK installation with local workload installation enabled ==