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#.

So $: dotnet build CarLibTool.2010.csproj

But the error is:

/usr/share/dotnet/sdk/2.1.300/Microsoft.Common.CurrentVersion.targets(1179,5): error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.6.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies

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