Skip to content

reference-list: Expand includes #49168

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

edvilme
Copy link
Contributor

@edvilme edvilme commented May 27, 2025

Fixes #49127

Currently, the command lists references without evaluating them, resulting in MSBuild syntax showing up in the command result.

This attempts to fix that.

@edvilme
Copy link
Contributor Author

edvilme commented May 27, 2025

This uses the same method as sln-add

@@ -44,7 +44,7 @@ public override int Execute()
Reporter.Output.WriteLine(new string('-', CliStrings.ProjectReferenceOneOrMore.Length));
foreach (var p2p in p2ps)
{
Reporter.Output.WriteLine(p2p.Include);
Reporter.Output.WriteLine(p2p.EvaluatedInclude);
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the Project is really evaluated at this point; it looks like it just loaded the XML. You might have to call msbuildProj.GetEvaluatedProject() to get a real Project, from which you can call GetItems("ProjectReference") and iterate through that instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dotnet list reference returns non expanded paths
2 participants