Updated: 24 January 2023
Consider
Foo[] array; List<Foo> list;
Freelance software engineer United Kingdom
Updated: 24 January 2023
Consider
Foo[] array; List<Foo> list;
Updated: 24 January 2023
Try .NET In-Browser and enter focus mode.
Updated: 29 January 2023
.NET is an open source developer platform (i.e. the Languages & Libraries) for building different types of apps. The supported languages are C#, Visual Basic and F#.
Target platforms are:
https://docs.microsoft.com/dotnet
https://aka.ms/dotnethelloworld
A container which offers built-in services:
.NET 6 offers Generic DefaultHost
which can be configured for the application use cases.
A service which performs work in the background. Any reference type object which implements IHostedService
is a background / hosted / worker service.
Class dependencies can be registered in a service container.
.NET provides a built-in service container, IServiceProvider
. Services are typically registered at the app’s start-up and appended to an IServiceCollection
. Once all services are added BuildServiceProvider
is used to create the service container.
Dependency Injection injects the service into the constructor of the class where it’s needed. The framework takes on the responsibility of creating an instance of the dependency and disposing of it when it’s no longer needed.
Updated: 21 June 2023
Build a project and its dependencies using Release configuration
dotnet build --configuration Release
Build and test the Release version of a console application
dotnet run --configuration Release
Run the tests in the project in the current directory
dotnet test
Publishes the application and its dependencies to a folder for deployment to a hosting system.
dotnet publish
Build the project and its dependencies into a set of binaries. The binaries include the project’s code in Intermediate Language (IL) files with a .dll extension.
dotnet build
Clean up the output of the previous build. Both intermediate (obj) and final output (bin) folders are cleaned.
dotnet clean
Restores the dependencies and tools for a project i.e. external libraries in NuGet packages. All dependencies become available in a local cache and can be used by the .NET CLI to build and run the application.
dotnet restore