Difference between revisions of ".NET Core"

From ArchWiki
Jump to navigation Jump to search
m (→‎Telemetry: Fix template error.)
Line 16: Line 16:
== Telemetry ==
== Telemetry ==
Telemetry is enabled by default but can be disabled by [[setting environment variable|Environment variables]] {{ic|DOTNET_CLI_TELEMETRY_OPTOUT=1}}。
Telemetry is enabled by default but can be disabled by [[Environment variables|setting environment variable]] {{ic|1=DOTNET_CLI_TELEMETRY_OPTOUT=1}}。
== Troubleshooting ==
== Troubleshooting ==

Revision as of 03:31, 15 July 2019

.NET Core is a new FOSS software framework from Microsoft for C#, Visual Basic, and F#. It is designed to be cross-platform, modular and apt for modern applications, as opposed to its predecessor, the .NET Framework.


If you only want to run .NET Core managed applications, install the dotnet-runtime package.

To build apps with .NET Core, install dotnet-sdk as well.

Microsoft recommends using Visual Studio Code , their Electron-based FOSS IDE, to build & debug .NET Core apps.


Telemetry is enabled by default but can be disabled by setting environment variable DOTNET_CLI_TELEMETRY_OPTOUT=1


"the required library libhostfxr.so could not be found" error

Some of the dotnet SDK tools (for example libman, dotnet-watch etc.) may expect you to have the environment variable DOTNET_ROOT pre-configured. If it's not, an error like this one could be observed: [1]

A fatal error occurred, the required library libhostfxr.so could not be found.
If this is a self-contained application, that library should exist in [/home/my_user/.dotnet/tools/.store/microsoft.web.librarymanager.cli/1.0.172/microsoft.web.librarymanager.cli/1.0.172/tools/netcoreapp2.1/any/].
If this is a framework-dependent application, install the runtime in the default location [/usr/share/dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location.

The workaround is to manually export DOTNET_ROOT in your shell:

export DOTNET_ROOT=/opt/dotnet

SDK specified could not be found

This is believed to caused by a conflict between the Mono and MSBuild SDK libs and the dotnet core ones. To fix this export the path manually in your shell (replacing the version number as necessary) e.g:

export MSBuildSDKsPath="/opt/dotnet/sdk/2.2.105/Sdks/";

See also