Skip to content

Fix build of PNSE assemblies with --no-dependencies #6801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 15, 2021

Conversation

ericstj
Copy link
Member

@ericstj ericstj commented Jan 14, 2021

When working on dotnet/runtime#46999 I noticed that dotnet build --no-dependencies didn't work for PNSE assemblies. Basically MSBuild treats this similarly to when building a sln. See conditions here: https://github.com/dotnet/msbuild/blob/9954584470022a3d81401189e78443196ee266f9/src/Tasks/Microsoft.Common.CurrentVersion.targets#L1875

This permits --no-dependencies to work.

@ericstj ericstj requested review from ViktorHofer and Anipik January 14, 2021 22:01
@@ -41,7 +42,7 @@
Projects="@(ProjectReference)"
Targets="GetCompileItems"
Properties="%(ProjectReference.SetTargetFramework)"
Condition="'%(ProjectReference.Identity)' == '$(ContractProject)' and '$(BuildingInsideVisualStudio)' == 'true'">
Condition="'%(ProjectReference.Targets)' == 'GetCompileItems' and ('$(BuildingInsideVisualStudio)' == 'true' or '$(BuildProjectReferences)' != 'true')">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conditioning off the Targets value avoids duplicates when the project is referenced for ResolveMatchingContract.

@ViktorHofer
Copy link
Member

Thanks, happy that we are thinking about edge cases as well :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants