CLI
dotnet
- CLI = command line interface
- create projects
- run applications
- test applications
dotnet new <type>
- Program.cs - main entrypoint code
dotnet run - compile application
- create output
- run Program.cs
- dotnet and c# is compiled
- creates
bindirectory (binaries)code . - code opens vscode
- . opens current directory
(in vscode) - change
- save
- f5 -> c# add dependency
dotnet add <project> reference <dependent project>add package- `dotnet add package run a project
dotnet run --project <project>
New Project
- make solution: ``dotnet new sln -o BuberBreakfast`
- make contracts (request/response):
dotnet new classlib -o BuberBreakfast.Contracts - make web server:
dotnet new webapi -o BuberBreakfast dotnet build- add contracts and apis to solution:
dotnet sln add BuberBreakfast.Contracts BuberBreakfast- (
ls -r **/*.csprojfor recursive)
- (
- add contracts to web server code as dependency:
dotnet add BuberBreakfast reference BuberBreakfast.Contracts - build:
dotnet build - run:
dotnet run BuberBreakfast