我试图获取swagger库,但出现以下错误,即使我创建的新项目也会出现默认错误:
dotnet add package Swashbuckle.AspNetCore --version 2.0.0
个
Writing C:\Users\shubham.shaw\AppData\Local\Temp\tmpoxoxul.tmp
info : X.509 certificate chain validation will use the default trust store selected by .NET for code signing.
info : X.509 certificate chain validation will use the default trust store selected by .NET for timestamping.
info : Adding PackageReference for package 'Swashbuckle.AspNetCore' into project 'C:\Users\shubham.shaw\source\repos\JWTImplementation\JWTImplementation.csproj'.
info : Restoring packages for C:\Users\shubham.shaw\source\repos\JWTImplementation\JWTImplementation.csproj...
info : GET https://packagesource/FindPackagesById()?id='Microsoft.VisualStudio.Azure.Containers.Tools.Targets'&semVerLevel=2.0.0
info : GET https://packagesource/FindPackagesById()?id='Swashbuckle.AspNetCore'&semVerLevel=2.0.0
log : Retrying 'FindPackagesByIdAsyncCore' for source 'https://packagesource/FindPackagesById()?id='Swashbuckle.AspNetCore'&semVerLevel=2.0.0'.
log : No such host is known. (packagesource:443)
log : No such host is known.
log : Retrying 'FindPackagesByIdAsyncCore' for source 'https://packagesource/FindPackagesById()?id='Microsoft.VisualStudio.Azure.Containers.Tools.Targets'&semVerLevel=2.0.0'.
log : No such host is known. (packagesource:443)
log : No such host is known.
info : GET https://packagesource/FindPackagesById()?id='Microsoft.VisualStudio.Azure.Containers.Tools.Targets'&semVerLevel=2.0.0
info : GET https://packagesource/FindPackagesById()?id='Swashbuckle.AspNetCore'&semVerLevel=2.0.0
log : Retrying 'FindPackagesByIdAsyncCore' for source 'https://packagesource/FindPackagesById()?id='Microsoft.VisualStudio.Azure.Containers.Tools.Targets'&semVerLevel=2.0.0'.
log : No such host is known. (packagesource:443)
log : No such host is known.
log : Retrying 'FindPackagesByIdAsyncCore' for source 'https://packagesource/FindPackagesById()?id='Swashbuckle.AspNetCore'&semVerLevel=2.0.0'.
log : No such host is known. (packagesource:443)
log : No such host is known.
info : GET https://packagesource/FindPackagesById()?id='Microsoft.VisualStudio.Azure.Containers.Tools.Targets'&semVerLevel=2.0.0
info : GET https://packagesource/FindPackagesById()?id='Swashbuckle.AspNetCore'&semVerLevel=2.0.0
error: NU1301: Failed to retrieve information about 'Microsoft.VisualStudio.Azure.Containers.Tools.Targets' from remote source 'https://packagesource/FindPackagesById()?id='Microsoft.VisualStudio.Azure.Containers.Tools.Targets'&semVerLevel=2.0.0'.
info : Package 'Swashbuckle.AspNetCore' is compatible with all the specified frameworks in project 'C:\Users\shubham.shaw\source\repos\JWTImplementation\JWTImplementation.csproj'.
error: Value cannot be null. (Parameter 'version')
Usage: NuGet.CommandLine.XPlat.dll package add [options]
Options:
-h|--help Show help information
--force-english-output Forces the application to run using an invariant, English-based culture.
--package Id of the package to be added.
--version Version of the package to be added.
-d|--dg-file Path to the dependency graph file to be used to restore preview and compatibility check.
-p|--project Path to the project file.
-f|--framework Frameworks for which the package reference should be added.
-n|--no-restore Do not perform restore preview and compatibility check. The added package reference will be unconditional.
-s|--source Specifies NuGet package sources to use during the restore.
--package-directory Directory to restore packages in.
--interactive Allow the command to block and require manual action for operations like authentication.
--prerelease Allows prerelease packages to be installed.
我试图判断包源的配置,但没有观察到一些问题.