You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using dotnet sdk >= 2.2.100 adding a reference to Microsoft.AspNetCore.App in paket.dependencies/paket.references for a project results in a warning:
/usr/local/share/dotnet/sdk/2.2.100/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.DefaultItems.targets(153,5): error NETSDK1071: A PackageReference to 'Microsoft.AspNetCore.App' specified a Version of `2.1.6`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs [/xxx/xxx.csproj]
Known workarounds
Possibly add DisableImplicitFrameworkReferences to the .csproj, this will require explicitly referencing other implicits (netstandard). Update: DisableImplicitFrameworkReferences cannot be used to suppress the warning in this case.
Or add a PackageReference for Microsoft.AspNetCore.App without a version specified to the .csproj. You might have to now reference other packages in paket.dependencies/paket.references for paket to resolve dependencies that you were implicitly using through Microsoft.AspNetCore.App.
Adding <AllowExplicitVersion>true</AllowExplicitVersion> to the generated PackageReference in Paket.Restore.targets is enough to suppress the warning and control the version of the package.
Activity
seanamosw commentedon Jan 16, 2019
Adding
<AllowExplicitVersion>true</AllowExplicitVersion>to the generatedPackageReferenceinPaket.Restore.targetsis enough to suppress the warning and control the version of the package.