Skip to content
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

Consider Enhancing MSB5009 To Indicate Which Project Was Incorrect #4836

Closed
aolszowka opened this issue Oct 21, 2019 · 2 comments · Fixed by #5835
Closed

Consider Enhancing MSB5009 To Indicate Which Project Was Incorrect #4836

aolszowka opened this issue Oct 21, 2019 · 2 comments · Fixed by #5835
Assignees
Labels
Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. Area: Solution (.sln) Issues related to parsing .sln files or building solutions triaged
Milestone

Comments

@aolszowka
Copy link

MSBuild can throw MSB5009 from this piece of code:

https://github.com/microsoft/msbuild/blob/e0116872ef1bf48f1f527d69de64ad58cb7453e0/src/Build/Construction/Solution/ProjectInSolution.cs#L371-L372

Please consider throwing the project name or at very least ParentProjectGuid of the invalid project. It would assist those trying to find the invalid project (and would have made discovery of #4835 much easier).

As it stands the best way (beyond looking at the VCS History to figure out how it was introduced) is to attach the debugger, capture the exception, and then investigate this to determine the project, from there you can work backwards to the GUID in question.

@livarcocc livarcocc added this to the MSBuild 16.5 milestone Oct 21, 2019
@rainersigwald rainersigwald added Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. Area: Solution (.sln) Issues related to parsing .sln files or building solutions help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. labels Oct 22, 2019
@BartoszKlonowski
Copy link
Contributor

@rainersigwald Please assign me to this item.

@rainersigwald rainersigwald removed the help wanted Issues that the core team doesn't plan to work on, but would accept a PR for. Comment to claim. label Oct 20, 2020
@rainersigwald
Copy link
Member

@BartoszKlonowski all yours--please let us know if you have any trouble!

rainersigwald pushed a commit that referenced this issue Nov 20, 2020
Changes introduced in this delivery extends the MSB5009 with additional information about the incorrectly nested project within the solution. Additional details are:

* incorrectly nested project's name (without the full path, unique name only),
* incorrectly nested project's GUID

New unit test covering the enhanced MSB5009 error checks whether:
 - MSB5009 error is thrown for incorrectly nested project in solution
 - error contains the name of incorrectly nested project
 - error contains the GUID of incorrectly nested project

NOTE: The solution file used for this unit test is the original solution
file given as an example of the original error which these changes fix.
Please see: #4835

Fixes #4836
@AR-May AR-May added the triaged label Feb 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Debuggability Issues impacting the diagnosability of builds, including logging and clearer error messages. Area: Solution (.sln) Issues related to parsing .sln files or building solutions triaged
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants