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

Report a meaningful error when MSBuild references are missing, or ExcludeAssets properties are not set correctly. #178

Open
safesparrow opened this issue Nov 14, 2022 · 1 comment
Labels
enhancement good first issue Issue for new contributors

Comments

@safesparrow
Copy link
Contributor

safesparrow commented Nov 14, 2022

Is your feature request related to a problem? Please describe.
A few times when using ProjInfo I ran into the issue where loadSln yielded 0 project results.
Using ProjectLoader.getProjectInfo yielded a cryptic MSBuild-related error.
Often the root cause for the error was that MSBuild references were either missing or they didn't have the right ExcludeAssets attributes set.

Describe the solution you'd like
I would like ProjInfo APIs to detect the above cases and report a clear error which instructs the user to add appropriate MSBuild references to the project, ideally with a link to some online instructions (eg. a GitHub page).

Describe alternatives you've considered
Keeping it as is - can take the user a lot of time to figure out what's happening.

@baronfel
Copy link
Collaborator

The two cases can both be detected from reading the deps.json file for the loading application/library. targets.<runtime name>.<dependency name and version> for the Microsoft.Build.* dependencies should A) be present, and B) not have a runtime child property. If they are not present, the message should tell the user to add the required dependency with ExcludeAssets="runtime" set. If the runtime node is present, the message should tell the user to add ExcludeAssets="runtime" to the existing dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue Issue for new contributors
Projects
None yet
Development

No branches or pull requests

3 participants