Sdk: Problems publishing dotnet 4.6.2 console app

Created on 4 Dec 2017  路  6Comments  路  Source: dotnet/sdk

Steps to reproduce

  • Create .NET Framework 4.6.2 console app in Visual studio
  • Run dotnet build from command line (success)
  • Run dotnet publish from command line, error: C:\Program Files\dotnet\sdk\2.0.3\Microsoft.Common.CurrentVersion.targets(3861,5): error MSB4062: The "Microsoft.Build.Tasks.ResolveManifestFiles" task could not be loaded from the assembly Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

I have a sample project here: https://github.com/bjnoel/ConsoleTest with a 4.6.2 class library and 4.6.2 console app. The class library builds/publishes fine, the console app only builds.

I have tried publishing with the -f net462 flag and it makes no difference.

Expected behavior

The console app publishes or gives a meaningful error.

Actual behavior

error MSB4062 as above.

Environment data

dotnet --info output:

.NET Command Line Tools (2.0.3)

Product Information:
Version: 2.0.3
Commit SHA-1 hash: 12f0c7efcc

Runtime Environment:
OS Name: Windows
OS Version: 10.0.16299
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.0.3\

Microsoft .NET Core Shared Framework Host

Version : 2.0.3
Build : a9190d4a75f4a982ae4b4fa8d1a24526566c69df

Other information

We have a large solution that mostly contains .NET core 2, .Net standard 2 libraries, this legacy .net framework console app is causing issues with our CI server. Publishing through visual studio works ok.

Most helpful comment

I'm encountering the same issue, wouldn't it make sense to be able to tell the cli to ignore "unsupported" projects?

All 6 comments

These are not SDK based projects. They are old style csproj projects. And as such, they are not supported by the CLI and there is not concept of publish for them, which is why publish fails for you.

I'm encountering the same issue, wouldn't it make sense to be able to tell the cli to ignore "unsupported" projects?

These are not SDK based projects. They are old style csproj projects. And as such, they are not supported by the CLI and there is not concept of publish for them, which is why publish fails for you.

So how do we publish the artifacts instead? Use the "old way" by having a copy task perform the work instead?

Jupp, same here.

Hey, I have the same error. Need to build from command line a .NET Framework app.

Did anyone ever find a solution to this?

Was this page helpful?
0 / 5 - 0 ratings