15

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?

8
  • 1
    Are the project files "old" .csproj files or "SDK" project files? Commented Jun 27, 2018 at 1:20
  • @vcsjones They are old style csproj. One of them even has WPF ! Commented Jun 27, 2018 at 1:28
  • 1
    dotnet command is exclusive for .NET Core projects. Stick to MSBuild please. Commented Jun 27, 2018 at 1:39
  • 2
    MSBuild 15 (part of VS2017) can definitely build all kinds. Install VS2017 on your build server and call MSBuild 15 from the right path, and then you are done. Commented Jun 27, 2018 at 1:50
  • 1
    Install VS2017 on build server for that? Will install of Build Tools for Visual Studio 2017 work? Commented Jun 27, 2018 at 1:55

1 Answer 1

6

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.