-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
sln-add: Get project DefaultProjectTypeGuid #47661
base: release/9.0.2xx
Are you sure you want to change the base?
sln-add: Get project DefaultProjectTypeGuid #47661
Conversation
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.
Pull Request Overview
This PR updates the handling of retrieving the project type GUID when adding a project to a solution by using the default project type GUID if the primary method returns null.
- Moved the instantiation of ProjectInstance before the try-catch block.
- Updated GUID retrieval to fallback to the default project type GUID.
- Removed duplicate instantiation of ProjectInstance.
Further update: One of these is skipped, while the other one must only matter when it can't find either the project type guid or the default project type guid |
Also addresses #522 |
Fixes #47638
Description and impact
When adding a new project that is not known for the SDK or MSBuild, it should read the
DefaultProjectTypeGuid
property from the project file.Regression
Yes - this worked before 9.0.2xx
Risk
Low – Currently it errors when adding unknown project types, unless the
ProjectTypeGuid
is specified on the project itself, or on the solution file.Testing
Unit tests on this were ambiguous, so they were renamed to better match their cases.
I was also able to reproduce the bug...
Existing behavior

Expected behavior
