-
Notifications
You must be signed in to change notification settings - Fork 674
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
Make ProjectNames.FromDTEProjectAsync more reliable #3776
Conversation
src/NuGet.Clients/NuGet.VisualStudio.Common/ProjectSystems/ProjectNames.cs
Show resolved
Hide resolved
8722c5c
to
8cf4d7b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, one quick question.
} | ||
} | ||
|
||
projectGuid = vsSolution5.GetGuidOfProjectFile(fullName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This probably needs moved to the top method instead right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"unique name" is usually just the relative path to the project file from the solution. Every test I've tried so far returns the exact string that's in the project file. I feel like that's probably more likely to be reliable, hence I preferred it over DTE.FullName. But which of the two is tried first doesn't really matter to me. I can change it if you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good as long as it's consistent.
} | ||
} | ||
|
||
projectGuid = vsSolution5.GetGuidOfProjectFile(fullName); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All good as long as it's consistent.
Bug
Fixes: https://github.com/NuGet/Client.Engineering/issues/602
Regression: Yes
Fix
Details: EnvDTE.Project is implemented by project systems, not a generic implemented by the VS platform itself. Therefore, some project systems might have incomplete or buggy implementations. Try multiple ways to get the project GUID.
Testing/Validation
Tests Added: No
Reason for not adding tests: Problems only occurs on custom & 3rd party project systems that don't fully implement EnvDTE.Project
Validation: Need to insert into VS and monitor telemetry.