Skip to content

Avoid adding duplicate metadata references to AbstractProject reference list#26438

Merged
brettfo merged 1 commit intodotnet:dev15.7.xfrom
tmat:DupMetadata
Apr 28, 2018
Merged

Avoid adding duplicate metadata references to AbstractProject reference list#26438
brettfo merged 1 commit intodotnet:dev15.7.xfrom
tmat:DupMetadata

Conversation

@tmat
Copy link
Copy Markdown
Member

@tmat tmat commented Apr 26, 2018

Customer scenario

VS crashes due to a duplicate metadata reference added to the list of references the AbstractProject maintains. The root cause is unknown. This change prevents the crash and reports non-Fatal Watson at the point when the duplicate reference is being added, so that we can diagnose why it's happening.

Bugs this fixes

https://devdiv.visualstudio.com/DevDiv/_workitems/edit/599686

Workarounds, if any

None.

Risk

Small.

Performance impact

Small.

Is this a regression from a previous update?

Root cause analysis

Unknown.

How was the bug found?

Watson report.

Test documentation updated?

@tmat tmat requested a review from a team as a code owner April 26, 2018 23:35
@tmat tmat added this to the 15.7 milestone Apr 26, 2018
@tmat
Copy link
Copy Markdown
Member Author

tmat commented Apr 26, 2018

@jasonmalinowski Please review.

@tmat
Copy link
Copy Markdown
Member Author

tmat commented Apr 27, 2018

test windows_release_vs-integration_prtest please

@tmat
Copy link
Copy Markdown
Member Author

tmat commented Apr 27, 2018

test windows_release_vs-integration_prtest please

{
lock (_gate)
{
if (_metadataReferences.Contains(r => StringComparer.OrdinalIgnoreCase.Equals(r.FilePath, reference.FilePath)))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm, I forget our conversation again: the classic project systems definitely try to consolidate references so I think this is safe. Did we double check what CPS does? I know they had some consolidation logic but I forget where that landed...?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

CPS does that here. I wonder if this is a bug in DTBB in classic csproj.

@brettfo brettfo merged commit 03d348a into dotnet:dev15.7.x Apr 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants