Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dotnet build not compiling .NET Framework 4.6.1 Application

I am trying to compile a solution using dotnet build on command line. This solution unfortunately has projects which target different frameworks. Most of these have been migrated to target .NET Standard 2.0 and .NET Core 2.0.

However due to reasons out of my control the solution still has two project which target .NET Framework 4.6.1.

If I compile the solution in VS2017 then everything is compiled and I see bin and obj folders getting generated.

However using dotnet build on command line to compile the solution leaves the 2 projects targeting .NET Framework 4.6.1 untouched. The rest of the projects are compiled fine.

Funny thing is that doing a dotnet test in the 2 given project folder actually does generate the bin and obj folders. Just an observation.

Will upgrading the projects to .NET 4.6.2 help?

If you need any details please let me know and I will update the question with the same.

like image 392
NotAgain says Reinstate Monica Avatar asked Jun 27 '18 00:06

NotAgain says Reinstate Monica


Video Answer


1 Answers

It is definitely because of old-style project format

New sdk format projects has to be used for dotnet build

I've reproduced it here https://github.com/oleksabor/verbose-engine

like image 128
oleksa Avatar answered Oct 10 '22 11:10

oleksa