User Tools

Site Tools


notes:tools:netcore

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
notes:tools:netcore [2018/09/12]
leszek
notes:tools:netcore [2018/10/11] (current)
leszek
Line 2: Line 2:
  
 Create a console app called '​ConsoleApp':​ Create a console app called '​ConsoleApp':​
-<​code ​dos>+<​code ​text>
 md ConsoleApp md ConsoleApp
 cd ConsoleApp cd ConsoleApp
 dotnet new console dotnet new console
 </​code>​ </​code>​
 +
 +Create a library called '​ClassLib':​
 +<code text>
 +md ClassLib
 +cd ClassLib
 +dotnet new classlib
 +</​code>​
 +
 +Create an NUnit3 test project:
 +<code text>
 +md TestProj
 +cd TestProj
 +dotnet new nunit
 +</​code>​
 +
 +Add a project reference:
 +<code text>
 +cd TestProj
 +dotnet add reference "​..\ConsoleApp\ConsoleApp.csproj"​
 +</​code>​
 +
 +Show help on how to add references:
 +<code text>
 +dotnet add reference -h
 +dotnet add package -h
 +</​code>​
 +
 +Run tests:
 +<code text>
 +cd TestProj
 +dotnet test
 +</​code>​
 +
  
 dotnet commands: dotnet commands:
-<​code ​dos>+<​code ​text>
 dotnet --version dotnet --version
 +dotnet --help
 +dotnet run                       # build and execute .csproj in the current folder
 dotnet <​command>​ -h              # get CLI help dotnet <​command>​ -h              # get CLI help
 dotnet help <​command> ​           # get on-line help dotnet help <​command> ​           # get on-line help
 dotnet <​command>​ -v diag         # run diagnostics dotnet <​command>​ -v diag         # run diagnostics
 dotnet add app.csproj reference lib.csproj ​ # add p2p reference to app.csproj dotnet add app.csproj reference lib.csproj ​ # add p2p reference to app.csproj
 +</​code>​
 +
 +<code text>
 +# FDD - framework-dependent deployment
 +dotnet publish -c Release ​       ​
 +
 +# SCD - self-contained deployment; publish a self-contained package for a specific platform
 +# RID - runtime identifier: [os].[version]-[arch]
 +# RID has to be also specified in csproj'​s RuntimeIdentifier or RuntimeIdentifiers element.
 +dotnet publish -c Release -r ubuntu.16.04-x64
 +</​code>​
 +
 +Install prerequisites for SCD on Ubuntu:
 +<code text>
 +apt update
 +apt install -y libunwind8 libunwind8-dev gettext libicu-dev liblttng-ust-dev libcurl4-openssl-dev uuid-dev unzip
 </​code>​ </​code>​
  
Line 25: Line 76:
   * Linux: /​usr/​bin/​dotnet/​sdk (error???: "​dotnet - not a directory";​ maybe because it's in a container)   * Linux: /​usr/​bin/​dotnet/​sdk (error???: "​dotnet - not a directory";​ maybe because it's in a container)
   * Mac: /​usr/​local/​share/​dotnet/​sdk   * Mac: /​usr/​local/​share/​dotnet/​sdk
 +
 +Location of .NET Core installations
 +  * Windows: C:\Program Files\dotnet\shared
 +  * 2.0.7, 2.0.9, 2.1.2
  
 Links Links
notes/tools/netcore.1536807220.txt.gz ยท Last modified: 2018/09/12 by leszek