Skip to content

Build and run .NET applications with the CLI: new sample on .NET 10 - #2287

Merged
vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/101361-dotnet-using-the-cli-to-build-and-run-net-applications
Oct 12, 2026
Merged

vladimir-pecanac-main merged 2 commits into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/101361-dotnet-using-the-cli-to-build-and-run-net-applications

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

New sample folder dotnet-cli/BuildAndRunWithTheCli for 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, Flurl 4.0.0, a project reference to HelloWorldCore. Program.cs is the article's four lines.
  • HelloWorldCore: class library, net10.0, one Greeter class.
  • HelloWorldTests: NUnit test project, net10.0, references HelloWorldCore, one real test of Greeter in place of the template's placeholder.
  • HelloWorldSolution.sln: created with dotnet new sln --format sln. The .NET 10 SDK creates .slnx by 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 nunit and lifted from the template's versions:

  • Flurl 4.0.0
  • NUnit 5.0.0 (template 4.3.2)
  • NUnit.Analyzers 4.15.0 (template 4.7.0)
  • NUnit3TestAdapter 6.3.1 (template 5.0.0)
  • Microsoft.NET.Test.Sdk 18.10.1 (template 17.14.0)
  • coverlet.collector 10.1.0 (template 6.0.4)

Checked locally on SDK 10.0.302, runtime 10.0.10: dotnet build -c Release 0 warnings, 0 errors; dotnet test passed 1 of 1; dotnet list package --vulnerable --include-transitive reports no vulnerable packages in any of the three projects. No test name contains Live, so CI runs the test.

Only dotnet-cli/BuildAndRunWithTheCli changes.

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.
@vladimir-pecanac-main
vladimir-pecanac-main merged commit 300a33b into CodeMazeBlog:main Oct 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant