访问私有 Nuget 提要时出错
Getting error while accessing the Private Nuget feed
我在尝试从 Azure 包项目访问私有 NuGet 源时遇到错误。
Install-Package Microsoft.Sdk -version 1.0.0-CI-20191028-053209
The content at 'https://mp.visualstudio.com/Tools/_packaging?_a=feed&feed=Release/FindPackagesById()?id='Microsoft.Sdk'&semVerLevel=2.0.0' is not valid XML.
For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method.
GET https://mp.visualstudio.com/Tools/_packaging?_a=feed&feed=ocpdirectory%40Release/FindPackagesById()?id='Microsoft.Sdk'&semVerLevel=2.0.0
NonAuthoritativeInformation https://mp.visualstudio.com/Tools/_packaging?_a=feed&feed=ocpdirectory%40Release/FindPackagesById()?id='Microsoft.Sdk'&semVerLevel=2.0.0 429ms
Install-Package : Failed to retrieve information about 'Microsoft.Sdk' from remote source 'https://mpneng.visualstudio.com/Tools/_packa
ging?_a=feed&feed=Release/FindPackagesById()?id='Microsoft.Sdk'&semVerLevel=2.0.0'.
The content at 'https://mp.visualstudio.com/Tools/_packaging?_a=feed&feed=Release/FindPackagesById()?id='Microsoft.Sdk'&semVerLevel=2.0.0' is not valid XML.
For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass
the settings into XmlReader.Create method.
At line:1 char:1
+ Install-Package Microsoft.Sdk -version 1.0.0-CI-2019102 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
The content at 'https://mp.visualstudio.com/Tools/_packaging?_a=feed&feed=Release/FindPackagesById()?id='Microsoft.Sdk'&semVerLevel=2.0.0' is not valid XML.
根据错误日志,您似乎使用了错误的URL,我们应该使用'Connect to feed中提供的URL ' 说明。
样本URLlink
https://pkgs.dev.azure.com/{Org name}/{project name}/_packaging/{artifact name}/nuget/v3/index.json
我在尝试从 Azure 包项目访问私有 NuGet 源时遇到错误。
Install-Package Microsoft.Sdk -version 1.0.0-CI-20191028-053209
The content at 'https://mp.visualstudio.com/Tools/_packaging?_a=feed&feed=Release/FindPackagesById()?id='Microsoft.Sdk'&semVerLevel=2.0.0' is not valid XML.
For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass the settings into XmlReader.Create method.
GET https://mp.visualstudio.com/Tools/_packaging?_a=feed&feed=ocpdirectory%40Release/FindPackagesById()?id='Microsoft.Sdk'&semVerLevel=2.0.0
NonAuthoritativeInformation https://mp.visualstudio.com/Tools/_packaging?_a=feed&feed=ocpdirectory%40Release/FindPackagesById()?id='Microsoft.Sdk'&semVerLevel=2.0.0 429ms
Install-Package : Failed to retrieve information about 'Microsoft.Sdk' from remote source 'https://mpneng.visualstudio.com/Tools/_packa
ging?_a=feed&feed=Release/FindPackagesById()?id='Microsoft.Sdk'&semVerLevel=2.0.0'.
The content at 'https://mp.visualstudio.com/Tools/_packaging?_a=feed&feed=Release/FindPackagesById()?id='Microsoft.Sdk'&semVerLevel=2.0.0' is not valid XML.
For security reasons DTD is prohibited in this XML document. To enable DTD processing set the DtdProcessing property on XmlReaderSettings to Parse and pass
the settings into XmlReader.Create method.
At line:1 char:1
+ Install-Package Microsoft.Sdk -version 1.0.0-CI-2019102 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Install-Package], Exception
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PackageManagement.PowerShellCmdlets.InstallPackageCommand
The content at 'https://mp.visualstudio.com/Tools/_packaging?_a=feed&feed=Release/FindPackagesById()?id='Microsoft.Sdk'&semVerLevel=2.0.0' is not valid XML.
根据错误日志,您似乎使用了错误的URL,我们应该使用'Connect to feed中提供的URL ' 说明。
样本URLlink
https://pkgs.dev.azure.com/{Org name}/{project name}/_packaging/{artifact name}/nuget/v3/index.json