简体   繁体   中英

Unable to find package Microsoft.Extensions.SecretManager.Tools with version (>= 2.1.0) While Upgrading to .Net Core 2.1

I am attempting to upgrade to my project from 2.0 to .Net Core 2.1.

I am using the following link as guide though it was for preview:

I am currently aware that the Microsoft.Extensions.SecretManager.Tools package is only at version 2.0.2 based on the nuget link: nuget package link

For more details, please see the issue I logged on the .Net Core GitHub page here

Note:

  1. .Net Core 2.1 is installed: .Net核心版本
  2. All DotNetCLIReferences were removed

Questions:

  1. Why is there no 2.1.0 version of the Microsoft.Extensions.SecretManager.Tools nuget package after an official release of .Net Core 2.1.0?
  2. Is it possible to resolve this error or do I have to roleback my project to .Net Core 2.0?

You can remove most of your DotNetCliToolReference's in your csproj file in 2.1. Many of the tools such as secretmanager are now global tools which you'll have if you're running the 2.1 SDK. They no longer need to be referenced and brought into your project.

See also: https://docs.microsoft.com/en-us/aspnet/core/migration/20_21?view=aspnetcore-2.1

So I figured it out

Apparently I had referenced the Microsoft.Extensions.SecretManager.Tools package twice, as a DotNetCliReference and as a regular package reference. When I finally removed both references and the secret key information the error was resolved.

I ended up with this because the error initially was complaining that I needed to add the Microsoft.Extensions.SecretManager.Tools version greater or equal to 2.1.0, which clearly does not exist

See screenshots below:

Part 1:

解决方案屏幕截图1

Part 2:

解决方案屏幕截图2

Thanks to everyone in the comments, their comments ultimately assisted me in thinking about the error and double checking.

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