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.
The console app publishes or gives a meaningful error.
error MSB4062 as above.
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
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.
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?
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?