Runtime: TargetFramework property isn't defined if there is no Outer-Build

Created on 6 Feb 2020  路  5Comments  路  Source: dotnet/runtime

The new configuration system hooks into DispatchToInnerBuilds which doesn't run always, ie when a Target is directly invoked which doesn't go through the dispatching from outer to inner build procedure.

An example is GenerateReferenceSource target which uses the IntermediateAssembly item which is undefined because the IntermediateOutputPath isn't set correctly: https://github.com/dotnet/runtime/blob/1a1a541954db674980b09efe426d3b6dfd6ae3c9/src/libraries/Directory.Build.targets#L134.

image

cc @Anipik @ericstj

area-Infrastructure-libraries untriaged

Most helpful comment

@Anipik can we hook GenerateReferenceSource into outer/inner dispatch?

Meantime, workaround is to pass in the TargetFramework value when calling GenerateReferencesource.

EG: dotnet msbuild /t:GenerateReferenceSource /p:TargetFramework=netcoreapp5.0

All 5 comments

Does this mean the GenerateReferenceSource task is currently not working? I'm receiving "The assembly field is required."

I see it working in 6766eb748a7 but broke sometime later.

/cc @khellang

Right, targets like GenerateReferenceSource are currently broken.

@Anipik can we hook GenerateReferenceSource into outer/inner dispatch?

Meantime, workaround is to pass in the TargetFramework value when calling GenerateReferencesource.

EG: dotnet msbuild /t:GenerateReferenceSource /p:TargetFramework=netcoreapp5.0

@ericstj I will start working on fixing it.

Meantime, workaround is to pass in the TargetFramework value when calling GenerateReferencesource.

EG: dotnet msbuild /t:GenerateReferenceSource /p:TargetFramework=netcoreapp5.0

For libraries that have OS specific builds the property must contain the OS as well, e.g.: /p:TargetFramework=netcoreapp5.0-Windows_NT.
It depends on the obj directory name of the built lib (e.g.: artifacts\obj\System.Net.Http\netcoreapp5.0-Windows_NT-Debug.)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

GitAntoinee picture GitAntoinee  路  3Comments

Timovzl picture Timovzl  路  3Comments

omariom picture omariom  路  3Comments

yahorsi picture yahorsi  路  3Comments

noahfalk picture noahfalk  路  3Comments