simple hello world

This commit is contained in:
2025-11-11 10:20:13 +01:00
parent bf484a2f81
commit 80bc441e36
5 changed files with 79 additions and 4 deletions

3
.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
result
*/bin
*/obj

2
console/Program.cs Normal file
View File

@@ -0,0 +1,2 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");

10
console/console.csproj Normal file
View File

@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net9.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

34
dotnet-nix-testing.sln Normal file
View File

@@ -0,0 +1,34 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "console", "console\console.csproj", "{DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Debug|x64.ActiveCfg = Debug|Any CPU
{DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Debug|x64.Build.0 = Debug|Any CPU
{DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Debug|x86.ActiveCfg = Debug|Any CPU
{DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Debug|x86.Build.0 = Debug|Any CPU
{DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Release|Any CPU.Build.0 = Release|Any CPU
{DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Release|x64.ActiveCfg = Release|Any CPU
{DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Release|x64.Build.0 = Release|Any CPU
{DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Release|x86.ActiveCfg = Release|Any CPU
{DA7E69E4-09C2-45F5-9D98-D477D3B5B6FD}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -23,13 +23,40 @@
pkgs,
system,
...
}: {
}: rec {
# Per-system attributes can be defined here. The self' and inputs'
# module parameters provide easy access to attributes of the same
# system.
# Equivalent to inputs'.nixpkgs.legacyPackages.hello;
packages.default = pkgs.hello;
packages.default = packages.console;
packages.console = with pkgs;
buildDotnetModule {
pname = "dotnet-nix-testing";
version = "0.1";
src = ./.;
projectFile = "dotnet-nix-testing.sln";
# nugetDeps = ./deps.json; # see "Generating and updating NuGet dependencies" section for details
# buildInputs = [
# referencedProject
# ]; # `referencedProject` must contain `nupkg` in the folder structure.
dotnet-sdk = dotnetCorePackages.sdk_9_0;
dotnet-runtime = dotnetCorePackages.runtime_9_0;
executables = ["console"]; # This wraps "$out/lib/$pname/foo" to `$out/bin/foo`.
# executables = []; # Don't install any executables.
# packNupkg = true; # This packs the project as "foo-0.1.nupkg" at `$out/share`.
# runtimeDeps = [ffmpeg]; # This will wrap ffmpeg's library path into `LD_LIBRARY_PATH`.
meta.mainProgram = "console";
};
devShells.default = with pkgs;
mkShell
{
@@ -38,7 +65,6 @@
(
with dotnetCorePackages;
combinePackages [
sdk_8_0
sdk_9_0
]
)