DotNET: Difference between revisions
No edit summary |
Lord-Valen (talk | contribs) m Use the correct command name. |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 4: | Line 4: | ||
Example build file: | Example build file: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix" line="1" start="1"> | ||
{ | { | ||
, dotnetCorePackages | buildDotnetModule, | ||
, | dotnetCorePackages, | ||
}: | }: | ||
buildDotnetModule | buildDotnetModule { | ||
pname = " | pname = "hello"; | ||
version = " | version = "0.1"; | ||
src = | src = ./.; | ||
projectFile = " | projectFile = "Hello/Hello.csproj"; | ||
dotnet-sdk = dotnetCorePackages.sdk_8_0; | dotnet-sdk = dotnetCorePackages.sdk_8_0; | ||
dotnet-runtime = dotnetCorePackages.runtime_8_0; | dotnet-runtime = dotnetCorePackages.runtime_8_0; | ||
nugetDeps = ./deps. | nugetDeps = ./deps.json; | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
If the <code>fetch-deps</code> script isn't working for whatever reason, you can manually run <code>nuget-to- | If the <code>fetch-deps</code> script isn't working for whatever reason, you can manually run <code>nuget-to-json</code>: | ||
<syntaxhighlight lang=" | <syntaxhighlight lang="shell-session"> | ||
dotnet restore --packages=packageDir ./SomeProject.csproj | $ dotnet restore --packages=packageDir ./SomeProject.csproj | ||
nuget-to- | $ nuget-to-json packageDir > deps.json | ||
rm -r packageDir | $ rm -r packageDir | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Line 255: | Line 244: | ||
* https://learn.microsoft.com/en-us/dotnet/core/introduction | * https://learn.microsoft.com/en-us/dotnet/core/introduction | ||
[[Category:Languages]] | [[Category:Languages]] |