Tutorial by Examples

Create a new project.json and example Program.cs: dotnet new Restore needed packages: dotnet restore Compile and run the example: dotnet run
Go to the project.json directory and publish: dotnet publish It will print the output directory of the operation, enter the directory and run the published project: dotnet <project output>.dll The default folder will be: <project root>/bin/<configuration>/<target framewo...
Using dotnet new will scaffold a new console application. To scaffold other types of projects, use the -t or --type flag: dotnet new -t web dotnet restore dotnet run The available templates vary by language. C# Templates console (default) - A console application. web - An ASP.NET Core app...
By default, dotnet new creates C# projects. You can use the -l or --lang flag to scaffold projects in other languages: dotnet new -l f# dotnet restore dotnet run Currently, dotnet new supports C# and F#.
To create a NuGet package from a project, run this command from a directory that contains project.json: dotnet pack The resulting .nupkg file will be named and versioned according to the properties in project.json. If there are multiple frameworks targeted in the project file, the package will s...
Running dotnet test from inside a folder that contains a test project will launch the test runner. The test runner will discover and run the tests in the project. To be compatible with dotnet test, the project.json file must contain a testRunner property and a dependency on a compatible test runner...

Page 1 of 1