简体   繁体   中英

Microsoft.Azure.KeyVault.Core doesn't Restore with NETStandard20

I've got a NetStandard20 project Microsoft.Bot.Builder.Azure that pulls in storage dependencies to Azure (CosmosDB, Storage.Common, Blob). I'm on the latest version of each of those dependencies.

No matter what I've tried, I get this warning on build:

Warning NU1701  Package 'Microsoft.Azure.KeyVault.Core 1.0.0' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETStandard,Version=v2.0'. This package may not be fully compatible with your project.    Microsoft.Bot.Builder.Azure C:\git\botbuilder-dotnet\libraries\Microsoft.Bot.Builder.Azure\Microsoft.Bot.Builder.Azure.csproj

Now, from what I can tell, the Nuget package for Microsoft.Azure.Storage.Common seems to support NetStandard2. Via Nuget.Org :

.NETStandard 2.0
Microsoft.Azure.KeyVault.Core (>= 1.0.0)
NETStandard.Library (>= 2.0.1)
Newtonsoft.Json (>= 10.0.2)

Likewise, Keyvault.Core says it supports NetStandard > 1.6.1 ( Nuget Link here )

This has been bugging me for ages! What am I doing wrong, and how can I fix this?

As the warning shows that you install the package Microsoft.Azure.KeyVault.Core 1.0.0 which has no dependencies.

I suggest that you could install Microsoft.Azure.KeyVault.Core at version 3.0.3 to follow SEMVER conventions .

For more details, you could refer to this issue .

The KeyVault.Core package ( GitHub Repo here ), picked up as a transitive dependency of the Azure Storage libraries doesn't yet support NetStandard20. I confirmed with the Azure Storage team that this warning is fine, and can be suppressed.

[12:20 PM] (Azure SDK Owner) So, our only dependency on that is the definitions of two interfaces, which are stable. Not the implementation. The warning should be ignorable in that case.

It does appear the Azure SDK team is "in-process" of supporting NetStandard20 as seen in this Commit .

We cannot apply the no-warn suppression directly to the package links below as they're not picked up across transitive dependencies. See this GitHub Issue for details.

The result: I've had to suppress this warning for the entire assembly:

<PropertyGroup>
  <NoWarn>$(NoWarn);NU1701</NoWarn>
</PropertyGroup>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM