Skip to content
Advertisement

.net core in Linux – build C#

Linux Environment – Ubuntu 16.04 LTS. i have installed .net core 2.1300 (latest, with sdk).

I am trying to build (dotnet build) a .csproj file in C#.

JavaScript

But the error is:

JavaScript

What possible solutions exists?

maybe change .csproj ?

Advertisement

Answer

You are trying to build a full .NET (v4.6.1) application on a .NET Core platform and that is not supported.

You need to create a new project (or solution) that targets .NET Core and not .NET 4.6.1 framework.

If you need to share code libraries between a .NET framework (in your case 4.6.1) and .NET Core you should use a .NET Standard library since this can be used by both.

Note that not everything in 4.6.1 will be supported in .NET Core (which is why it’s called ‘core’ because it’s only the core functions). This includes any GUI components you may be using.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement