-
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
Deps.json should include project references that aren't present in project.assets.json #28963
Conversation
…f the restore to be included in deps.json
(@marcpopMSFT @dsplaisted FYI.) |
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 is looking great, thanks!
if (string.IsNullOrEmpty(projectName)) | ||
{ | ||
return true; | ||
} |
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.
Under what conditions would this be null or empty, and should we be returning true here?
...ests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAnAppWithTransitiveNonSdkProjectRefs.cs
Outdated
Show resolved
Hide resolved
...ests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAnAppWithTransitiveNonSdkProjectRefs.cs
Outdated
Show resolved
Hide resolved
Looks like there are some test failures in CI: Thanks! |
@dsplaisted said:
These should be fixed now - there was an issue with how I resolved some of the comments from the last PR. |
FYI, latest update was to hide the new behavior behind a new MSBuild property. (Note that the test case I added fails without the new switch being provided, but I did not add a negative test). |
@dsplaisted and @marcpopMSFT is this ready to be merged? |
src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Sdk.targets
Outdated
Show resolved
Hide resolved
Deps.json should include project references that aren't present in project.assets.json
Addresses #28891.
Although most projects are included in project.assets.json after a restore takes place, there are some (rare) scenarios when this is not the case. When that happens, project references end up being skipped and excluded from deps.json.
One can work around this by adding a binary Reference, that is inconvenient and can lead to issues when one forgets. Instead, it would be good to check whether the project reference is included in project.assets.json before skipping it when generating the list of dependencies.
Also added a functional test (.NET 6.0 project referencing a .NET Framework project) that failed previously and succeeds now.
(Continues #28892, retargeting release/7.0.2xx)