I have a logic that imports a targets file if a certain property is True. I can clearly see the targets are imported, but searching for the property under the project node returns nil. I know for sure the property is not globally set - it is determined from another targets file based on the csproj file contents.
Exhibit 1

This tells us the property IsUnitTestProject is indeed set to true.
Exhibit 2

The property only shows up under certain projects (but not the one I am interested in!) and only in the context of the restoration phase. This is when msbuild is invoked in a separate context (to the best of my limited understanding) and it presents a picture as if the property IsUnitTestProject is global. But it is not, which is easily proved by examining the top level solution node.
Exhibit 3

The property IsUnitTestProject is defined in Tests.props, which is clearly loaded under the project in question - see the next exhibit.
Exhibit 4

The binary log is attached.
P.S.
It would be nice if we could use quotes when searching for $import to indicate the project name exactly.
msbuild.zip
I have a logic that imports a targets file if a certain property is True. I can clearly see the targets are imported, but searching for the property under the project node returns nil. I know for sure the property is not globally set - it is determined from another targets file based on the csproj file contents.
Exhibit 1

This tells us the property
IsUnitTestProjectis indeed set totrue.Exhibit 2

The property only shows up under certain projects (but not the one I am interested in!) and only in the context of the restoration phase. This is when msbuild is invoked in a separate context (to the best of my limited understanding) and it presents a picture as if the property
IsUnitTestProjectis global. But it is not, which is easily proved by examining the top level solution node.Exhibit 3

The property
IsUnitTestProjectis defined in Tests.props, which is clearly loaded under the project in question - see the next exhibit.Exhibit 4

The binary log is attached.
P.S.
It would be nice if we could use quotes when searching for
$importto indicate the project name exactly.msbuild.zip