Open kabaogluemre opened 3 months ago
PackageReference
items need to be available in project evaluation in order to display in the dependencies tree. You cannot synthesize them in targets, in the way you are doing, and have it work in VS.
What are you trying to achieve with your CustomProjectReference
items? Can you use ProjectReference
with some metadata instead?
Visual Studio Version
17.9
Summary
I have a Target which calculates PackageReferences to be added and it runs right before
CollectPackageReferences
target. Newly added packages are successfully restored and the project is successfully built onMSBuild
anddotnet cli
. But they are not displayed under Dependency Tree.Here is the code;
The idea is to pull referenced project as package if the active/current build configuration is not specified in
BuildConfigurations
metadata. Otherwise it will be added asProjectReference
. In this case,MaterialBalance
andPricing
should be pulled as package.As you can see from screenshot of![Capture](https://github.com/dotnet/project-system/assets/23010894/e1cc5339-7549-4a13-a44d-b1b5cae93c2d)
ResolvePackageDependenciesDesignTime
target, added package references are presenting;It presents on Package Manager screen as well;![Capture2](https://github.com/dotnet/project-system/assets/23010894/6098c6bb-db5f-4c01-9134-b902eb709d41)
But it is not displayed under Dependency Tree;![Capture4](https://github.com/dotnet/project-system/assets/23010894/428ff49d-955e-4ef5-b6f5-5e58034d19c4)
Expected Behavior
Added PackageReference under Target should be displayed on Packages Dependency Tree.
Actual Behavior
Added PackageReference under Target is not displayed on Packages Dependency Tree while the packages are restored and the project is built successfully.
I have provided a repo that the issue is reproduced with minimum steps.