Project-system: VS 2019 v16.3.4 and v16.4.prev2 are unable to build netcoreapp3.0 projects which use custom MSBuild tools targeting netcoreapp3.0

Created on 18 Oct 2019  路  3Comments  路  Source: dotnet/project-system

Visual Studio Version: v16.3.4 and v16.4.prev2

Summary: build of the DjvuNet repo with VS 2019 on Windows 10 x64 fails due to inability to load custom DjvuNet.Git.Tasks.dll MSBuild tasks which by design should target only netcoreapp3.0

Steps to Reproduce:

  1. Clone DjvuNet repo on Windows machine and ensure that you are in the branch with reverted commit 03852b779d Remove .NET Framework support.

  2. run: build -c release -p x64 -f netcoreapp3.0 -Test
    Build and tests should pass.

2.1 VS 2019 build of DjvuNet.sln should succeed for any project selected.

3.1 Drop from repo commit reverting the following one:

commit 03852b779daa06440a951762fad1cdd089c11525
Author: Jacek Blaszczynski <[email protected]>
Date:   Wed Oct 16 23:43:43 2019 +0200

    Remove .NET Framework support
  1. Open DjvuNet.sln in VS 2019 and try to build any of the projects - build will fail with an error indicating that DjvuNet.Git.Tasks.dll targeting netcoreapp3.0 cannot be loaded.

* User impact *

Unable to work with "pure" netcoreapp3.0 projects in VS 2019 - in other words, VS 2019 v16.3 and later do not support .netcoreapp3.0 but support mixed netfx / netcoreapp.30 projects.

Probable cause

My diagnosis is that MSBuild used by project system while building netcoreapp3.0 projects is a MSBuild netfx distribution rather than correctly netcoreapp3.0 distribution what prevents loading of custom MSBuild task assemblies targeting non netfx MSBuild.

Importance - very high

Impact - blocks unhindered creation of pure .netcoreapp3.0 software and is at odds with claims of netcoreapp3.0 support

Resolution-By-Design

All 3 comments

It is deliberate that VS uses .NET Framework build of MSBuild. While longer we want to move away from this, until then, Task authors must provide a .NET Framework version of their library if they run under Visual Studio.

@davkean Thanks for the reply. The news are baaad.

Was this page helpful?
0 / 5 - 0 ratings