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

Deps.json should include project references that aren't present in project.assets.json #29095

Merged
merged 3 commits into from
Nov 29, 2022

Conversation

marcpopMSFT
Copy link
Member

@marcpopMSFT marcpopMSFT commented Nov 17, 2022

Description

Port of #28963
Fixes #28891

When there is a reference to a project that is not included in the project.assets.json file for some reason (e.g. it has opted out of nuget restore), it does not get included into deps.json.

This fix is to include all references in the deps.json file even those not in the project.assets.json. In 7.0.2xx the change is on by default but for 6.0.4xx, we are leaving it as opt-in so as to reduce risk.

Customer Impact

While rare and not the default, this will result in the application not being able to find all of it's dependencies at runtime and fail to run. This particular case came because of using internal build tools when referencing a cppCLI project and those tools were disabling nuget restore for those projects by default.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Verification

  • Manual (required)
  • Automated

Port of #28963

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)

Deps.json should include project references that aren't present in project.assets.json
@marcpopMSFT
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

Successfully merging this pull request may close these issues.

1 participant