Getting NETSDK1023 even when xunit.assert isn't implicitly referenced
- [ ] This issue is blocking
- [ ] This issue is causing unreasonable pain
After a130eb4216444f36a8966bd0c7ab97fa0d6ece6d, we're seeing some unusual behavior in the EF Core specification tests (tests that ship as NuGet packages for providers to use).
We have these lines in our csproj:
<Project>
<PropertyGroup>
<IsUnitTestProject>False</IsUnitTestProject>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="xunit.assert" Version="$(XUnitVersion)" />
<PackageReference Include="xunit.core" Version="$(XUnitVersion)" />
</ItemGroup>
</Project>
The error messages that started showing up after the arcade commit are as follows:
D:\efcore.dotnet\sdk\8.0.100-preview.6.23279.4\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.Shared.targets(152,5): error NETSDK1023: A PackageReference for 'xunit.assert' was included in your project. This package is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project. For more information, see https://aka.ms/sdkimplicitrefs [D:\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj] D:\efcore.dotnet\sdk\8.0.100-preview.6.23279.4\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.DefaultItems.Shared.targets(152,5): error NETSDK1023: A PackageReference for 'xunit.core' was included in your project. This package is implicitly referenced by the .NET SDK and you do not typically need to reference it from your project. For more information, see https://aka.ms/sdkimplicitrefs [D:\efcore\test\EFCore.Specification.Tests\EFCore.Specification.Tests.csproj]
However, if I comment out the PackageReferences I get compiler errors saying that it can't find xUnit.net types.
For now, I've worked around the issue by adding <NoWarn>NETSDK1023</NoWarn>, but it would be good to understand why IsImplicitlyDefined="true" is affecting this project when the package reference clearly isn't being added outside of the project.
Release Note Category
- [ ] Feature changes/additions
- [ ] Bug fixes
- [ ] Internal Infrastructure Improvements
Release Note Description
@agocke can you help here?
ping @agocke :)
Could I get a binlog from the efcore build? I looked through the source and the reason wasn't obvious.
@bricelam can you help @agocke help you? :)
Steps:
- Clone dotnet/efcore
- Search for NETSDK1023 and remove it
- Get a binlog