-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Add dependencies from Microsoft.NETCore.App to Microsoft.NETCore.Targets and NETStandard.Library #3574
Comments
FYI @ericstj @nguerrera |
/cc @wtgodbe on the NETStandard.Library suggestion. We may want to make an empty one. I'll submit a change to empty MS.NETCore.Targets. |
I think we should definitely make the empty netstandard 2.1 as well. Let's be consistent here in how these stubs work. I think it will be very confusing to see an actual reference to non-empty netstandard.library 2.0.x injected. It will also cause too much to be downloaded in cases with no legacy refs. |
I think I'm missing some context here, why do we need to ship an empty |
I don't know what Microsoft.Private.Standard is. NETStandard.Library.Ref is the real payload ("targeting pack"). The empty package is a way to short circuit things in nuget while we're currently lacking any other mechanism. |
@nguerrera Microsoft.Private.Standard contains essentially the same bits as Netstandard.Library - I believe Core-Setup currently depends on Microsoft.Private.Standard to get the netstandard bits that it injects into the targeting pack (@dagood can you confirm?). However if we empty out Netstandard.Library, that would break other repos that depend on that package (like corefx), unless we intend for those repos to switch over to Microsoft.Private.Standard. I'm missing some information here, so I'm not sure what the motivation is for this request, or what the guidance is for repos that depend on the packages that are going to become empty. |
I believe the near-term goal is that Core-Setup is the only place referencing dotnet/standard bits, and it does so through the We're still depending on NETStandard.Library here, but it should just be a matter of changing the Long-term, dotnet/standard will produce |
For the moment, should we transition CoreFx to |
Here's the issue for the "empty" Microsoft.NETCore.App implementation that might help with context: https://github.com/dotnet/core-setup/issues/5663. (I don't know about the migration though.) |
/cc @wtgodbe |
@dagood Hold off on this for now, currently we are thinking of not relying on the Microsoft.NETCore.App package. |
Customers are reporting hitting this issue with the latest sdk, and don't like the manual workaround of having to add a reference to the Targets package. This is a regression, @dsplaisted do we plan to fix this for 3.0? |
In case this is weighed against implementation difficulty (although so far it hasn't sounded like it), it's trivial to add workaround package dependencies, they just need to be added to this itemgroup: |
No, we don't plan to fix this for 3.0. We only had one report of the issue, and we analyzed the packages on NuGet.org to try to figure out how common the issue would be. The data seemed to indicate that the issue would be quite rare. We are not using the Microsoft.NETCore.App package anymore, so simply adding these dependencies as @dagood suggests won't fix the issue. Referencing the Microsoft.NETCore.App package had a number of issues, and the one that finally tipped us over to abandoning it was that we had a heuristic to only reference it if there were other PackageReferences, but that didn't work if a project had no direct PackageReferences, but transitive PackageReferences through other ProjectReferences. So to fix the issue, what we would need would be a feature in NuGet: NuGet/Home#7344. Because the impact of the issue appeared to be limited, we opted to go with documentation for now. |
@joperezr Can you point us to where customers are hitting this? I've still only seen the one original bug report. |
Sure, this is the report I got in the iot repo since the customer thought it was related to the package built in that repository: dotnet/iot#646 (comment) |
Do note that the only thing that the user did in order to repro this was:
That alone would get you a repro since the problem happens when |
In that case I think something in the MVC or Blazor package graph needs to be updated, or this may be a different issue. The issue happens when you have contract packages (such as System.IO.FileSystem, etc) from both the 1.0 and 1.1 bands of .NET Core in your package graph. For vanilla 3.0 projects, we shouldn't have any 1.x packages in the graph. |
whether the fix goes on the blazor packages or on the sdk, I do think that something must be fixed for 3.0 since I think that it is pretty broken that you can hit this problem so easily. For reference, here is the error message which has the package tree dependency graph:
|
See also dotnet/sdk#3044 (comment) |
A nestandard2.0 target should be added to Mono.Cecil and Blazor should depend on that. cc @sbomer |
It looks like the code was already moved to netstandard2.0, but no release was pushed to nuget? cc @jbevain |
@davidfowl Can you help push 1.x assets out of |
I cannot reproduce this in preview 8. This didn't trigger it either:
Neither of these have package references. |
I don't think this happens with default projects. The binlog with the failure is linked here. Based on that, the following is a minimal repro: <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RuntimeIdentifier>linux-arm</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Blazor.Server" Version="3.0.0-preview7.19365.7" />
<PackageReference Include="System.Device.Gpio" Version="0.1.0-prerelease.19376.1" />
</ItemGroup>
</Project> For the failure to occur, there need to be dependencies to both 1.0 and 1.1 band contract packages. The Blazor package is bringing in Mono.Cecil which is bringing in 1.0 contracts such as System.IO.FileSystem 4.0.1. The GPIO package is depending on several 1.1 contracts, such as System.Runtime.InteropServices.WindowsRuntime 4.3.0. As Nick suggests, an updated Mono.Cecil package with a .NET Standard 2.0 version of the library would fix this. Updating the GPIO package so that it doesn't depend on the contract packages should also work if that's possible. |
@ericstj and @joperezr pointed me to this issue. I hit this today upgrading ML.NET to 3.0. Restoring this project: <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.11.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
</ItemGroup>
</Project> with the 3.0.100-preview8-013437 SDK results in:
If I literally change any line in the .csproj, it works:
|
Re-opening this issue so it gets noticed. |
I don't think this issue can track a fix. We can't use an empty package for reasons that have been discussed. |
Well, we can have the empty packages, but we can't auto reference them in the SDK. |
dotnet/sdk#3044 tracks the work on the SDK to make these scenarios just work, which after trying many workarounds and failing, is now blocked on NuGet/Home#7344 Both are still open so we should focus there rather than on this workaround issue that won't work. Please link any reports on either of those issues. |
We should add the following package dependencies to the "Empty" Microsoft.NETCore.App package (see #3528):
The text was updated successfully, but these errors were encountered: