dotnet [build|publish] not persisting serviceable attribute for packages in deps file
Tasks
- [ ] Fix bug
- [x] Undo dotnet/cli#2491 EDIT was never merged, so nothing to undo.
- [ ] Verify and Close issue
Steps to reproduce
dotnet new dotnet restore dotnet publish
Expected behavior
CoreCLR and other assemblies are marked serviceable in the libraries section in the project.lock.json
Actual behavior
CoreCLR package and other serviceable assembly packages are marked as "serviceable": false
Environment data
dotnet --info output:
1.0.0-rc2-002374
Following up on PR dotnet/cli#2491, Assigning to @anurse, feel free to reassign to the right person. This is a NuGet restore issue.
Cc @piotrpMSFT @gkhanna79 @ericstj @yishaigalatzer
Filed https://github.com/NuGet/Home/issues/2556. It's up to @yishaigalatzer to triage and figure out what to do. Then we take a NuGet build when there's a fix.
As mentioned in the NuGet issue: We should do this when generating the deps file instead to avoid opening assemblies during restore.
I'll look at this after my current task (#2511)
Is publish the only concern here? Do we need to have the same for build?
We've solved this issue for RC2 by simply always writing the serviceable attribute to the deps file. Post RC2 we are going to look at the right solution for specifying this value.
@brthor, edited the title, whoever produces deps file should be consistent. In this case yes, build needs to be fixed as well.
@anurse, can this be looked into now? Have you given some thought around how the packages should be tagged or marked serviceable? /Cc @ericstj
I've marked this for Preview 2 when the runtime packages are going to be RTM.
There are a lot of moving parts to get figured out here so I don't have any immediate plans. I'm not exactly sure who's driving this functionality post RC2.
Chatted with @glennc and @leecow and they confirmed driving this ahead. Assigned to @leecow to do so.
The current state of this issue:
- The host respects whatever "serviceable" value is written into the deps.json file.
- NuGet does not currently write the "serviceable" value into the project.lock.json file: https://github.com/NuGet/Home/issues/2556
- Since the CLI doesn't know which value it should use for "serviceable", it always writes "serviceable = true" in the deps.json file for NuGet packages for
preview2: https://github.com/dotnet/cli/blob/rel/1.0.0/src/Microsoft.DotNet.ProjectModel/DependencyContextBuilder.cs#L118-L120
When NuGet's bug is fixed, the CLI can take the "serviceable" value from the project.lock.json file and put the correct value into the deps.json file.
Moving this bug to preview3 since NuGet's bug will not be fixed in time for preview2.
Update: the NuGet bug is now being tracked as https://github.com/NuGet/Home/issues/2923
Moving out of RTM as the NuGet issue is still open.
Closing this issue as it is obviously not going to happen any time soon. We can re-open it if the underlying NuGet change ever makes it into the product.