question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problems publishing dotnet 4.6.2 console app

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
Sean-Browncommented, Jan 19, 2018

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

2reactions
jmrnilssoncommented, Mar 8, 2019

Jupp, same here.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Problems publishing dotnet 4.6.2 console app · Issue #8919
Run dotnet publish from command line, error: C:\Program Files\dotnet\sdk\2.0.3\Microsoft.Common.CurrentVersion.targets(3861,5): error MSB4062: ...
Read more >
Error in building default .NET Core console application ...
I run into trouble when I try to target the .NET Framework 4.6.2 in the same application. From what I have read, I...
Read more >
Fix .NET Framework 'This application could not be started'
When you attempt to run a .NET Framework application, you may receive the "This application could not be started" error message.
Read more >
Troubleshoot .NET Framework targeting errors
NET Framework applications, follow these steps: Open Solution Explorer. Select Show All Files, and then edit the app.
Read more >
dotnet publish command - .NET CLI
dotnet publish - Publishes the application and its dependencies to a folder for deployment to a hosting system.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found