Repository navigation
Build and run .NET applications with the CLI: new sample on .NET 10 - #2287
Merged
Conversation
New folder dotnet-cli/BuildAndRunWithTheCli for the article "dotnet build and dotnet run: Using the .NET CLI". It holds the solution the article builds one command at a time: the HelloWorld console app (Flurl 4.0.0, a project reference to HelloWorldCore), the HelloWorldCore class library with a Greeter class, and an NUnit test project that tests it. All three projects target net10.0. The solution is HelloWorldSolution.sln, created with dotnet new sln --format sln, because CI looks for a .sln. The README carries the article's walkthrough as captured on SDK 10.0.302 on 2026-10-11. Test packages lifted from the dotnet new nunit template versions to what NuGet serves on 2026-10-11: NUnit 5.0.0, NUnit.Analyzers 4.15.0, NUnit3TestAdapter 6.3.1, Microsoft.NET.Test.Sdk 18.10.1, coverlet.collector 10.1.0.
…-run-net-applications
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New sample folder
dotnet-cli/BuildAndRunWithTheClifor the article dotnet build and dotnet run: Using the .NET CLI. The article has never had a sample; this folder is the solution its walkthrough builds one command at a time.What is in it:
HelloWorld: console app,net10.0,Flurl4.0.0, a project reference toHelloWorldCore.Program.csis the article's four lines.HelloWorldCore: class library,net10.0, oneGreeterclass.HelloWorldTests: NUnit test project,net10.0, referencesHelloWorldCore, one real test ofGreeterin place of the template's placeholder.HelloWorldSolution.sln: created withdotnet new sln --format sln. The .NET 10 SDK creates.slnxby default (which is what the article shows), but the PR build looks for a.sln.README.md: the article's walkthrough as captured on SDK 10.0.302 on 2026-10-11, so a reader can compare their own output.Package versions, re-queried on NuGet on 2026-10-11 (latest listed stable). The test project was generated by
dotnet new nunitand lifted from the template's versions:Checked locally on SDK 10.0.302, runtime 10.0.10:
dotnet build -c Release0 warnings, 0 errors;dotnet testpassed 1 of 1;dotnet list package --vulnerable --include-transitivereports no vulnerable packages in any of the three projects. No test name containsLive, so CI runs the test.Only
dotnet-cli/BuildAndRunWithTheClichanges.