Skip to content

Conversation

@ericstj
Copy link
Member

@ericstj ericstj commented Jul 28, 2021

Without this any SLN that contained one of these libraries would fail to build, as it's src project would be missing the contract assembly for non-NetCoreAppCurrent builds, or the ref would be missing from some project up stack.

ericstj added 2 commits July 28, 2021 14:04
Ref projects are needed if for packages since they will have TargetFrameworks
that aren't covered by an up-front build of libs subset.
@ghost
Copy link

ghost commented Jul 28, 2021

Tagging subscribers to this area: @Anipik, @safern, @ViktorHofer
See info in area-owners.md if you want to be subscribed.

Issue Details

Without this any SLN that contained one of these libraries would fail to build, as it's src project would be missing the contract assembly for non-NetCoreAppCurrent builds, or the ref would be missing from some project up stack.

Author: ericstj
Assignees: -
Labels:

area-Infrastructure-libraries

Milestone: -

<!-- Include CompilerServices.Unsafe as it's a transitive test dependency. -->
<IncludeInSolutionFile Condition="'$(IsNETCoreAppRef)' == 'true' and '$(MSBuildProjectName)' == 'System.Runtime.CompilerServices.Unsafe'">true</IncludeInSolutionFile>
<!-- Don't include shared framework projects except the leaf's project and OOBs. -->
<IncludeInSolutionFile Condition="'$(IsNETCoreAppRef)' == 'true' and '$(MSBuildProjectName)' != '$(SlnGenMainProject)' and '$(IsNETCoreAppPackage)' != 'true'">false</IncludeInSolutionFile>
Copy link
Member Author

Choose a reason for hiding this comment

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

After doing this I realize that another condition that might work is '$(TargetFrameworks)' != '$(NetCoreAppCurrent)' since this will also catch references that didn't build in the up-front build pass. Let me know what makes more sense to use.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, I would prefer that over the static list (which we likely need anyway for another change but probably not here) as the existence of another TargetFramework than $(NetCoreAppCurrent)* should indicate that the reference project should be present in the solution file.

@ericstj
Copy link
Member Author

ericstj commented Jul 28, 2021

I reverted every sln that only had guid changes, so this should only be the ones with actual changes. @jeffkl would it be possible to get stable guids here? Are we running it wrong that it churns guids every time?

@ericstj
Copy link
Member Author

ericstj commented Jul 28, 2021

would it be possible to get stable guids here? Are we running it wrong that it churns guids every time?

Answering my own question. Looks like today the answer is no: https://github.com/microsoft/slngen/blob/04b9e981a2651f3b4aa7cbea9adeb855db927732/src/Microsoft.VisualStudio.SlnGen/SlnFolder.cs#L29

But there is precedent for preserving Guids elsewhere:
https://github.com/microsoft/slngen/blob/d261186bcd01b3a0c8c350b2a19611032778fd17/src/Microsoft.VisualStudio.SlnGen/SlnFile.cs#L92

Seems like the same could be done for folders. Opened microsoft/slngen#238

@ViktorHofer
Copy link
Member

I noticed that many solution file format updates were due to two unnecessary P2Ps in TestUtilities.csproj. I submitted #57483 to replace this PR and used the newer version of slngen. Hope that's ok.

@ericstj ericstj closed this Aug 16, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Sep 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants