如何解决nuget“软件包完整性检查失败”错误?

发布于 2025-02-11 12:35:34 字数 15438 浏览 3 评论 0 原文

我的开发环境如下:

  • Windows 10 Enterprise 64位
  • Visual Studio 2022 Professional
  • .NET 6.0

我是使用Nuget的新手。我的nuget无法安装错误的问题“软件包完整性检查失败”。

这些步骤将在我的系统上持续重现错误:

  1. 启动VS,选择C# / Windows / Console的“创建新项目”
  2. 过滤器,然后选择控制台应用程序(不是.NET Framework One)
  3. 框架:.NET 6(长期支持)
  4. 一旦VS完成创建项目,请右键单击“解决方案资源管理器”中的项目,然后
  5. 在搜索框中选择“管理Nuget软件包...”,单击浏览,输入“ Microsoft.data.sqlclient”,然后选择Microsoft.data.data.sqlclient物品。截至今天,最新的稳定版本为4.1.0。单击安装。我的软件包源是“ https://api.nuget.org/v3/index.json”,“如果这很重要,则
  6. 在输出窗口中显示了许多Nuget消息,总是以NU3008错误结尾。对于冗长的性格表示歉意,我不确定其中有多少相关:
Restoring packages for d:\dev\CoreConsoleTest\CoreConsoleTest.csproj...
  GET https://api.nuget.org/v3-flatcontainer/microsoft.data.sqlclient/index.json
  OK https://api.nuget.org/v3-flatcontainer/microsoft.data.sqlclient/index.json 122ms
  GET https://api.nuget.org/v3-flatcontainer/microsoft.data.sqlclient/4.1.0/microsoft.data.sqlclient.4.1.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/microsoft.data.sqlclient/4.1.0/microsoft.data.sqlclient.4.1.0.nupkg 742ms
  GET https://api.nuget.org/v3-flatcontainer/azure.core/index.json
  GET https://api.nuget.org/v3-flatcontainer/microsoft.identity.client.extensions.msal/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.memory/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.text.json/index.json
  GET https://api.nuget.org/v3-flatcontainer/microsoft.identity.client/index.json
  GET https://api.nuget.org/v3-flatcontainer/microsoft.identitymodel.jsonwebtokens/index.json
  GET https://api.nuget.org/v3-flatcontainer/microsoft.win32.registry/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.buffers/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.configuration.configurationmanager/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.diagnostics.diagnosticsource/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.runtime.caching/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.text.encoding.codepages/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.text.encodings.web/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.security.cryptography.cng/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.security.principal.windows/index.json
  OK https://api.nuget.org/v3-flatcontainer/azure.core/index.json 46ms
  GET https://api.nuget.org/v3-flatcontainer/azure.core/1.6.0/azure.core.1.6.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/microsoft.identity.client.extensions.msal/index.json 123ms
  OK https://api.nuget.org/v3-flatcontainer/system.text.json/index.json 133ms
  GET https://api.nuget.org/v3-flatcontainer/microsoft.identity.client.extensions.msal/2.16.5/microsoft.identity.client.extensions.msal.2.16.5.nupkg
  GET https://api.nuget.org/v3-flatcontainer/system.text.json/4.6.0/system.text.json.4.6.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/system.memory/index.json 173ms
  GET https://api.nuget.org/v3-flatcontainer/system.memory/4.5.3/system.memory.4.5.3.nupkg
  OK https://api.nuget.org/v3-flatcontainer/microsoft.identity.client/index.json 190ms
  GET https://api.nuget.org/v3-flatcontainer/microsoft.identity.client/4.22.0/microsoft.identity.client.4.22.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/microsoft.win32.registry/index.json 208ms
  GET https://api.nuget.org/v3-flatcontainer/microsoft.win32.registry/5.0.0/microsoft.win32.registry.5.0.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/microsoft.identitymodel.jsonwebtokens/index.json 226ms
  GET https://api.nuget.org/v3-flatcontainer/microsoft.identitymodel.jsonwebtokens/6.8.0/microsoft.identitymodel.jsonwebtokens.6.8.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/system.buffers/index.json 246ms
  GET https://api.nuget.org/v3-flatcontainer/system.buffers/4.5.1/system.buffers.4.5.1.nupkg
  OK https://api.nuget.org/v3-flatcontainer/system.diagnostics.diagnosticsource/index.json 271ms
  GET https://api.nuget.org/v3-flatcontainer/system.diagnostics.diagnosticsource/5.0.0/system.diagnostics.diagnosticsource.5.0.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/system.text.encoding.codepages/index.json 294ms
  OK https://api.nuget.org/v3-flatcontainer/system.configuration.configurationmanager/index.json 310ms
  GET https://api.nuget.org/v3-flatcontainer/system.text.encoding.codepages/5.0.0/system.text.encoding.codepages.5.0.0.nupkg
  GET https://api.nuget.org/v3-flatcontainer/system.configuration.configurationmanager/5.0.0/system.configuration.configurationmanager.5.0.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/system.security.cryptography.cng/index.json 319ms
  OK https://api.nuget.org/v3-flatcontainer/system.runtime.caching/index.json 327ms
  GET https://api.nuget.org/v3-flatcontainer/system.security.cryptography.cng/5.0.0/system.security.cryptography.cng.5.0.0.nupkg
  GET https://api.nuget.org/v3-flatcontainer/system.runtime.caching/5.0.0/system.runtime.caching.5.0.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/system.text.encodings.web/index.json 357ms
  GET https://api.nuget.org/v3-flatcontainer/system.text.encodings.web/4.7.2/system.text.encodings.web.4.7.2.nupkg
  OK https://api.nuget.org/v3-flatcontainer/system.security.principal.windows/index.json 381ms
  GET https://api.nuget.org/v3-flatcontainer/system.security.principal.windows/5.0.0/system.security.principal.windows.5.0.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/system.memory/4.5.3/system.memory.4.5.3.nupkg 282ms
  OK https://api.nuget.org/v3-flatcontainer/microsoft.identity.client/4.22.0/microsoft.identity.client.4.22.0.nupkg 392ms
  OK https://api.nuget.org/v3-flatcontainer/azure.core/1.6.0/azure.core.1.6.0.nupkg 790ms
  OK https://api.nuget.org/v3-flatcontainer/microsoft.identity.client.extensions.msal/2.16.5/microsoft.identity.client.extensions.msal.2.16.5.nupkg 721ms
  OK https://api.nuget.org/v3-flatcontainer/system.text.json/4.6.0/system.text.json.4.6.0.nupkg 713ms
  OK https://api.nuget.org/v3-flatcontainer/microsoft.identitymodel.jsonwebtokens/6.8.0/microsoft.identitymodel.jsonwebtokens.6.8.0.nupkg 621ms
  OK https://api.nuget.org/v3-flatcontainer/system.buffers/4.5.1/system.buffers.4.5.1.nupkg 601ms
  OK https://api.nuget.org/v3-flatcontainer/system.diagnostics.diagnosticsource/5.0.0/system.diagnostics.diagnosticsource.5.0.0.nupkg 713ms
  OK https://api.nuget.org/v3-flatcontainer/system.configuration.configurationmanager/5.0.0/system.configuration.configurationmanager.5.0.0.nupkg 684ms
  OK https://api.nuget.org/v3-flatcontainer/system.runtime.caching/5.0.0/system.runtime.caching.5.0.0.nupkg 888ms
  OK https://api.nuget.org/v3-flatcontainer/microsoft.win32.registry/5.0.0/microsoft.win32.registry.5.0.0.nupkg 3605ms
  OK https://api.nuget.org/v3-flatcontainer/system.text.encoding.codepages/5.0.0/system.text.encoding.codepages.5.0.0.nupkg 3521ms
  OK https://api.nuget.org/v3-flatcontainer/system.security.cryptography.cng/5.0.0/system.security.cryptography.cng.5.0.0.nupkg 4748ms
  OK https://api.nuget.org/v3-flatcontainer/system.text.encodings.web/4.7.2/system.text.encodings.web.4.7.2.nupkg 5143ms
  OK https://api.nuget.org/v3-flatcontainer/system.security.principal.windows/5.0.0/system.security.principal.windows.5.0.0.nupkg 5121ms
Installed Microsoft.IdentityModel.JsonWebTokens 6.8.0 from https://api.nuget.org/v3/index.json with content hash +7JIww64PkMt7NWFxoe4Y/joeF7TAtA/fQ0b2GFGcagzB59sKkTt/sMZWR6aSZht5YC7SdHi3W6yM1yylRGJCQ==.
Installed Microsoft.Identity.Client.Extensions.Msal 2.16.5 from https://api.nuget.org/v3/index.json with content hash VlGUZEpF8KP/GCfFI59sdE0WA0o9quqwM1YQY0dSp6jpGy5EOBkureaybLfpwCuYUUjQbLkN2p7neUIcQCfbzA==.
Installed Azure.Core 1.6.0 from https://api.nuget.org/v3/index.json with content hash kI4m2NsODPOrxo0OoKjk6B3ADbdovhDQIEmI4039upjjZKRaewVLx/Uz4DfRa/NtnIRZQPUALe1yvdHWAoRt4w==.
Installed System.Memory 4.5.3 from https://api.nuget.org/v3/index.json with content hash 3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==.
Package 'System.Text.Encoding.CodePages 5.0.0' from source 'https://api.nuget.org/v3/index.json': Signature Hash Algorithm: SHA256
Package 'System.Text.Encoding.CodePages 5.0.0' from source 'https://api.nuget.org/v3/index.json': Verifying the author primary signature with certificate: 

Package 'System.Text.Encoding.CodePages 5.0.0' from source 'https://api.nuget.org/v3/index.json':   SHA1 hash: F404000FB11E61F446529981C7059A76C061631E
Package 'System.Text.Encoding.CodePages 5.0.0' from source 'https://api.nuget.org/v3/index.json':   Issued by: CN=DigiCert SHA2 Assured ID Code Signing CA, OU=www.digicert.com, O=DigiCert Inc, C=US
Package 'System.Text.Encoding.CodePages 5.0.0' from source 'https://api.nuget.org/v3/index.json': Timestamp: 10/20/2020 9:29:58 AM

Package 'System.Text.Encoding.CodePages 5.0.0' from source 'https://api.nuget.org/v3/index.json': Verifying author primary signature's timestamp with timestamping service certificate: 
  Subject Name: CN=Symantec SHA256 TimeStamping Signer - G3, OU=Symantec Trust Network, O=Symantec Corporation, C=US
  SHA1 hash: A9A4121063D71D48E8529A4681DE803E3E7954B0
  SHA256 hash: C474CE76007D02394E0DA5E4DE7C14C680F9E282013CFEF653EF5DB71FDF61F8
  Issued by: CN=Symantec SHA256 TimeStamping CA, OU=Symantec Trust Network, O=Symantec Corporation, C=US
  Valid from: 12/22/2017 7:00:00 PM to 3/22/2029 7:59:59 PM

Installed System.Text.Json 4.6.0 from https://api.nuget.org/v3/index.json with content hash 4F8Xe+JIkVoDJ8hDAZ7HqLkjctN/6WItJIzQaifBwClC7wmoLSda/Sv2i6i1kycqDb3hWF4JCVbpAweyOKHEUA==.
Installed System.Runtime.Caching 5.0.0 from https://api.nuget.org/v3/index.json with content hash 30D6MkO8WF9jVGWZIP0hmCN8l9BTY4LCsAzLIe4xFSXzs+AjDotR7DpSmj27pFskDURzUvqYYY0ikModgBTxWw==.
Installed System.Text.Encodings.Web 4.7.2 from https://api.nuget.org/v3/index.json with content hash iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==.
Installed System.Buffers 4.5.1 from https://api.nuget.org/v3/index.json with content hash Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==.
Installed System.Configuration.ConfigurationManager 5.0.0 from https://api.nuget.org/v3/index.json with content hash aM7cbfEfVNlEEOj3DsZP+2g9NRwbkyiAv2isQEzw7pnkDg9ekCU2m1cdJLM02Uq691OaCS91tooaxcEn8d0q5w==.
Installed System.Diagnostics.DiagnosticSource 5.0.0 from https://api.nuget.org/v3/index.json with content hash tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==.
Package 'Microsoft.Identity.Client 4.22.0' from source 'https://api.nuget.org/v3/index.json': Signature Hash Algorithm: SHA256
Package 'Microsoft.Identity.Client 4.22.0' from source 'https://api.nuget.org/v3/index.json': Verifying the author primary signature with certificate: 

Package 'Microsoft.Identity.Client 4.22.0' from source 'https://api.nuget.org/v3/index.json':   SHA1 hash: F404000FB11E61F446529981C7059A76C061631E
Package 'Microsoft.Identity.Client 4.22.0' from source 'https://api.nuget.org/v3/index.json':   Issued by: CN=DigiCert SHA2 Assured ID Code Signing CA, OU=www.digicert.com, O=DigiCert Inc, C=US
Package 'Microsoft.Identity.Client 4.22.0' from source 'https://api.nuget.org/v3/index.json': Timestamp: 10/22/2020 1:50:36 PM

Package 'Microsoft.Identity.Client 4.22.0' from source 'https://api.nuget.org/v3/index.json': Verifying author primary signature's timestamp with timestamping service certificate: 
  Subject Name: CN=Symantec SHA256 TimeStamping Signer - G3, OU=Symantec Trust Network, O=Symantec Corporation, C=US
  SHA1 hash: A9A4121063D71D48E8529A4681DE803E3E7954B0
  SHA256 hash: C474CE76007D02394E0DA5E4DE7C14C680F9E282013CFEF653EF5DB71FDF61F8
  Issued by: CN=Symantec SHA256 TimeStamping CA, OU=Symantec Trust Network, O=Symantec Corporation, C=US
  Valid from: 12/22/2017 7:00:00 PM to 3/22/2029 7:59:59 PM

Installed Microsoft.Win32.Registry 5.0.0 from https://api.nuget.org/v3/index.json with content hash dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==.
Package 'Microsoft.Data.SqlClient 4.1.0' from source 'https://api.nuget.org/v3/index.json': Signature Hash Algorithm: SHA256
Package 'Microsoft.Data.SqlClient 4.1.0' from source 'https://api.nuget.org/v3/index.json': Verifying the author primary signature with certificate: 

Package 'Microsoft.Data.SqlClient 4.1.0' from source 'https://api.nuget.org/v3/index.json':   SHA1 hash: A6E18D21B507879FC7F9C392A5CE355936E3AD2C
Package 'Microsoft.Data.SqlClient 4.1.0' from source 'https://api.nuget.org/v3/index.json':   Issued by: CN=DigiCert SHA2 Assured ID Code Signing CA, OU=www.digicert.com, O=DigiCert Inc, C=US
Package 'Microsoft.Data.SqlClient 4.1.0' from source 'https://api.nuget.org/v3/index.json': Timestamp: 1/31/2022 5:36:44 PM

Package 'Microsoft.Data.SqlClient 4.1.0' from source 'https://api.nuget.org/v3/index.json': Verifying author primary signature's timestamp with timestamping service certificate: 
  Subject Name: CN=Symantec SHA256 TimeStamping Signer - G3, OU=Symantec Trust Network, O=Symantec Corporation, C=US
  SHA1 hash: A9A4121063D71D48E8529A4681DE803E3E7954B0
  SHA256 hash: C474CE76007D02394E0DA5E4DE7C14C680F9E282013CFEF653EF5DB71FDF61F8
  Issued by: CN=Symantec SHA256 TimeStamping CA, OU=Symantec Trust Network, O=Symantec Corporation, C=US
  Valid from: 12/22/2017 7:00:00 PM to 3/22/2029 7:59:59 PM

Installed System.Security.Principal.Windows 5.0.0 from https://api.nuget.org/v3/index.json with content hash t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==.
Installed System.Security.Cryptography.Cng 5.0.0 from https://api.nuget.org/v3/index.json with content hash jIMXsKn94T9JY7PvPq/tMfqa6GAaHpElRDpmG+SuL+D3+sTw2M8VhnibKnN8Tq+4JqbPJ/f+BwtLeDMEnzAvRg==.
NU3008: Package 'System.Text.Encoding.CodePages 5.0.0' from source 'https://api.nuget.org/v3/index.json': The package integrity check failed. The package has changed since it was signed. Try clearing the local http-cache and run nuget operation again.
NU3008: Package 'Microsoft.Identity.Client 4.22.0' from source 'https://api.nuget.org/v3/index.json': The package integrity check failed. The package has changed since it was signed. Try clearing the local http-cache and run nuget operation again.
NU3008: Package 'Microsoft.Data.SqlClient 4.1.0' from source 'https://api.nuget.org/v3/index.json': The package integrity check failed. The package has changed since it was signed. Try clearing the local http-cache and run nuget operation again.
Time Elapsed: 00:00:14.2400739

我尝试过的是:

  • 重新启动
  • 清除本地缓存(我已经尝试了很多次,这是从Nuget程序中的命令行和工具,选项,选项,选项,vs vs vs vs Nuget软件包管理器,清除所有Nuget Cache(S))
  • 中分别安装依赖项
  • 从Nuget修复Visual Studio 2022安装

,我一直在尝试解决此问题已有近2天,我开始看到红色的雾气。我不明白为什么失败或如何修复它,而我对Microsoft感到沮丧,因为它使以前的简单添加依赖关系变得复杂且不透明。拜托,有帮助吗?

更新

要澄清,每个软件包都不会发生这种情况,但是每次Microsoft.data.sqlclient(和其他Microsoft软件包)每次都会发生这种情况。

我使用的是Nuget命令行工具(6.2.1.2)的最新版本,

我尝试了Jingmiao Xu-Msft的所有建议,而不是卸载和重新安装Visual Studio。建议2在另一台计算机上复制失败的软件包,但我不接受这是一个可行的永久解决方案。每当我需要从微软安装包裹时,我应该缠住同事吗?

我遇到这个问题与我的包装和软件包几乎相同版本。不幸的是,它不包含有关该分辨率的细节。如果我们的公司网络有问题,我需要对它们进行具体细节。 Nuget软件包下载哪种网络功能可能会篡改?

My development environment is as follows:

  • Windows 10 Enterprise 64-bit
  • Visual Studio 2022 Professional
  • .NET 6.0

I am new to using NuGet. I am having constant problems with NuGet not being able to install packages with the error "The package integrity check failed."

These steps will reproduce the error consistently on my system:

  1. Start VS, choose "Create a new project"
  2. Filter for C# / Windows / Console and choose Console App (not the .NET Framework one)
  3. Framework: .NET 6 (Long-term support)
  4. Once VS finishes creating the project, right-click the project in Solution Explorer and select "Manage NuGet Packages..."
  5. Click Browse, enter "microsoft.data.sqlclient" in the search box, then choose the Microsoft.Data.SqlClient item. As of today the latest stable version is 4.1.0. Click Install. My package source is "https://api.nuget.org/v3/index.json" if that is important
  6. A lot of NuGet messages show up in the Output window, always ending with a NU3008 error. Apologies for the verbosity, I am not sure how much of this is relevant:
Restoring packages for d:\dev\CoreConsoleTest\CoreConsoleTest.csproj...
  GET https://api.nuget.org/v3-flatcontainer/microsoft.data.sqlclient/index.json
  OK https://api.nuget.org/v3-flatcontainer/microsoft.data.sqlclient/index.json 122ms
  GET https://api.nuget.org/v3-flatcontainer/microsoft.data.sqlclient/4.1.0/microsoft.data.sqlclient.4.1.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/microsoft.data.sqlclient/4.1.0/microsoft.data.sqlclient.4.1.0.nupkg 742ms
  GET https://api.nuget.org/v3-flatcontainer/azure.core/index.json
  GET https://api.nuget.org/v3-flatcontainer/microsoft.identity.client.extensions.msal/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.memory/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.text.json/index.json
  GET https://api.nuget.org/v3-flatcontainer/microsoft.identity.client/index.json
  GET https://api.nuget.org/v3-flatcontainer/microsoft.identitymodel.jsonwebtokens/index.json
  GET https://api.nuget.org/v3-flatcontainer/microsoft.win32.registry/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.buffers/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.configuration.configurationmanager/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.diagnostics.diagnosticsource/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.runtime.caching/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.text.encoding.codepages/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.text.encodings.web/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.security.cryptography.cng/index.json
  GET https://api.nuget.org/v3-flatcontainer/system.security.principal.windows/index.json
  OK https://api.nuget.org/v3-flatcontainer/azure.core/index.json 46ms
  GET https://api.nuget.org/v3-flatcontainer/azure.core/1.6.0/azure.core.1.6.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/microsoft.identity.client.extensions.msal/index.json 123ms
  OK https://api.nuget.org/v3-flatcontainer/system.text.json/index.json 133ms
  GET https://api.nuget.org/v3-flatcontainer/microsoft.identity.client.extensions.msal/2.16.5/microsoft.identity.client.extensions.msal.2.16.5.nupkg
  GET https://api.nuget.org/v3-flatcontainer/system.text.json/4.6.0/system.text.json.4.6.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/system.memory/index.json 173ms
  GET https://api.nuget.org/v3-flatcontainer/system.memory/4.5.3/system.memory.4.5.3.nupkg
  OK https://api.nuget.org/v3-flatcontainer/microsoft.identity.client/index.json 190ms
  GET https://api.nuget.org/v3-flatcontainer/microsoft.identity.client/4.22.0/microsoft.identity.client.4.22.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/microsoft.win32.registry/index.json 208ms
  GET https://api.nuget.org/v3-flatcontainer/microsoft.win32.registry/5.0.0/microsoft.win32.registry.5.0.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/microsoft.identitymodel.jsonwebtokens/index.json 226ms
  GET https://api.nuget.org/v3-flatcontainer/microsoft.identitymodel.jsonwebtokens/6.8.0/microsoft.identitymodel.jsonwebtokens.6.8.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/system.buffers/index.json 246ms
  GET https://api.nuget.org/v3-flatcontainer/system.buffers/4.5.1/system.buffers.4.5.1.nupkg
  OK https://api.nuget.org/v3-flatcontainer/system.diagnostics.diagnosticsource/index.json 271ms
  GET https://api.nuget.org/v3-flatcontainer/system.diagnostics.diagnosticsource/5.0.0/system.diagnostics.diagnosticsource.5.0.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/system.text.encoding.codepages/index.json 294ms
  OK https://api.nuget.org/v3-flatcontainer/system.configuration.configurationmanager/index.json 310ms
  GET https://api.nuget.org/v3-flatcontainer/system.text.encoding.codepages/5.0.0/system.text.encoding.codepages.5.0.0.nupkg
  GET https://api.nuget.org/v3-flatcontainer/system.configuration.configurationmanager/5.0.0/system.configuration.configurationmanager.5.0.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/system.security.cryptography.cng/index.json 319ms
  OK https://api.nuget.org/v3-flatcontainer/system.runtime.caching/index.json 327ms
  GET https://api.nuget.org/v3-flatcontainer/system.security.cryptography.cng/5.0.0/system.security.cryptography.cng.5.0.0.nupkg
  GET https://api.nuget.org/v3-flatcontainer/system.runtime.caching/5.0.0/system.runtime.caching.5.0.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/system.text.encodings.web/index.json 357ms
  GET https://api.nuget.org/v3-flatcontainer/system.text.encodings.web/4.7.2/system.text.encodings.web.4.7.2.nupkg
  OK https://api.nuget.org/v3-flatcontainer/system.security.principal.windows/index.json 381ms
  GET https://api.nuget.org/v3-flatcontainer/system.security.principal.windows/5.0.0/system.security.principal.windows.5.0.0.nupkg
  OK https://api.nuget.org/v3-flatcontainer/system.memory/4.5.3/system.memory.4.5.3.nupkg 282ms
  OK https://api.nuget.org/v3-flatcontainer/microsoft.identity.client/4.22.0/microsoft.identity.client.4.22.0.nupkg 392ms
  OK https://api.nuget.org/v3-flatcontainer/azure.core/1.6.0/azure.core.1.6.0.nupkg 790ms
  OK https://api.nuget.org/v3-flatcontainer/microsoft.identity.client.extensions.msal/2.16.5/microsoft.identity.client.extensions.msal.2.16.5.nupkg 721ms
  OK https://api.nuget.org/v3-flatcontainer/system.text.json/4.6.0/system.text.json.4.6.0.nupkg 713ms
  OK https://api.nuget.org/v3-flatcontainer/microsoft.identitymodel.jsonwebtokens/6.8.0/microsoft.identitymodel.jsonwebtokens.6.8.0.nupkg 621ms
  OK https://api.nuget.org/v3-flatcontainer/system.buffers/4.5.1/system.buffers.4.5.1.nupkg 601ms
  OK https://api.nuget.org/v3-flatcontainer/system.diagnostics.diagnosticsource/5.0.0/system.diagnostics.diagnosticsource.5.0.0.nupkg 713ms
  OK https://api.nuget.org/v3-flatcontainer/system.configuration.configurationmanager/5.0.0/system.configuration.configurationmanager.5.0.0.nupkg 684ms
  OK https://api.nuget.org/v3-flatcontainer/system.runtime.caching/5.0.0/system.runtime.caching.5.0.0.nupkg 888ms
  OK https://api.nuget.org/v3-flatcontainer/microsoft.win32.registry/5.0.0/microsoft.win32.registry.5.0.0.nupkg 3605ms
  OK https://api.nuget.org/v3-flatcontainer/system.text.encoding.codepages/5.0.0/system.text.encoding.codepages.5.0.0.nupkg 3521ms
  OK https://api.nuget.org/v3-flatcontainer/system.security.cryptography.cng/5.0.0/system.security.cryptography.cng.5.0.0.nupkg 4748ms
  OK https://api.nuget.org/v3-flatcontainer/system.text.encodings.web/4.7.2/system.text.encodings.web.4.7.2.nupkg 5143ms
  OK https://api.nuget.org/v3-flatcontainer/system.security.principal.windows/5.0.0/system.security.principal.windows.5.0.0.nupkg 5121ms
Installed Microsoft.IdentityModel.JsonWebTokens 6.8.0 from https://api.nuget.org/v3/index.json with content hash +7JIww64PkMt7NWFxoe4Y/joeF7TAtA/fQ0b2GFGcagzB59sKkTt/sMZWR6aSZht5YC7SdHi3W6yM1yylRGJCQ==.
Installed Microsoft.Identity.Client.Extensions.Msal 2.16.5 from https://api.nuget.org/v3/index.json with content hash VlGUZEpF8KP/GCfFI59sdE0WA0o9quqwM1YQY0dSp6jpGy5EOBkureaybLfpwCuYUUjQbLkN2p7neUIcQCfbzA==.
Installed Azure.Core 1.6.0 from https://api.nuget.org/v3/index.json with content hash kI4m2NsODPOrxo0OoKjk6B3ADbdovhDQIEmI4039upjjZKRaewVLx/Uz4DfRa/NtnIRZQPUALe1yvdHWAoRt4w==.
Installed System.Memory 4.5.3 from https://api.nuget.org/v3/index.json with content hash 3oDzvc/zzetpTKWMShs1AADwZjQ/36HnsufHRPcOjyRAAMLDlu2iD33MBI2opxnezcVUtXyqDXXjoFMOU9c7SA==.
Package 'System.Text.Encoding.CodePages 5.0.0' from source 'https://api.nuget.org/v3/index.json': Signature Hash Algorithm: SHA256
Package 'System.Text.Encoding.CodePages 5.0.0' from source 'https://api.nuget.org/v3/index.json': Verifying the author primary signature with certificate: 

Package 'System.Text.Encoding.CodePages 5.0.0' from source 'https://api.nuget.org/v3/index.json':   SHA1 hash: F404000FB11E61F446529981C7059A76C061631E
Package 'System.Text.Encoding.CodePages 5.0.0' from source 'https://api.nuget.org/v3/index.json':   Issued by: CN=DigiCert SHA2 Assured ID Code Signing CA, OU=www.digicert.com, O=DigiCert Inc, C=US
Package 'System.Text.Encoding.CodePages 5.0.0' from source 'https://api.nuget.org/v3/index.json': Timestamp: 10/20/2020 9:29:58 AM

Package 'System.Text.Encoding.CodePages 5.0.0' from source 'https://api.nuget.org/v3/index.json': Verifying author primary signature's timestamp with timestamping service certificate: 
  Subject Name: CN=Symantec SHA256 TimeStamping Signer - G3, OU=Symantec Trust Network, O=Symantec Corporation, C=US
  SHA1 hash: A9A4121063D71D48E8529A4681DE803E3E7954B0
  SHA256 hash: C474CE76007D02394E0DA5E4DE7C14C680F9E282013CFEF653EF5DB71FDF61F8
  Issued by: CN=Symantec SHA256 TimeStamping CA, OU=Symantec Trust Network, O=Symantec Corporation, C=US
  Valid from: 12/22/2017 7:00:00 PM to 3/22/2029 7:59:59 PM

Installed System.Text.Json 4.6.0 from https://api.nuget.org/v3/index.json with content hash 4F8Xe+JIkVoDJ8hDAZ7HqLkjctN/6WItJIzQaifBwClC7wmoLSda/Sv2i6i1kycqDb3hWF4JCVbpAweyOKHEUA==.
Installed System.Runtime.Caching 5.0.0 from https://api.nuget.org/v3/index.json with content hash 30D6MkO8WF9jVGWZIP0hmCN8l9BTY4LCsAzLIe4xFSXzs+AjDotR7DpSmj27pFskDURzUvqYYY0ikModgBTxWw==.
Installed System.Text.Encodings.Web 4.7.2 from https://api.nuget.org/v3/index.json with content hash iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==.
Installed System.Buffers 4.5.1 from https://api.nuget.org/v3/index.json with content hash Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==.
Installed System.Configuration.ConfigurationManager 5.0.0 from https://api.nuget.org/v3/index.json with content hash aM7cbfEfVNlEEOj3DsZP+2g9NRwbkyiAv2isQEzw7pnkDg9ekCU2m1cdJLM02Uq691OaCS91tooaxcEn8d0q5w==.
Installed System.Diagnostics.DiagnosticSource 5.0.0 from https://api.nuget.org/v3/index.json with content hash tCQTzPsGZh/A9LhhA6zrqCRV4hOHsK90/G7q3Khxmn6tnB1PuNU0cRaKANP2AWcF9bn0zsuOoZOSrHuJk6oNBA==.
Package 'Microsoft.Identity.Client 4.22.0' from source 'https://api.nuget.org/v3/index.json': Signature Hash Algorithm: SHA256
Package 'Microsoft.Identity.Client 4.22.0' from source 'https://api.nuget.org/v3/index.json': Verifying the author primary signature with certificate: 

Package 'Microsoft.Identity.Client 4.22.0' from source 'https://api.nuget.org/v3/index.json':   SHA1 hash: F404000FB11E61F446529981C7059A76C061631E
Package 'Microsoft.Identity.Client 4.22.0' from source 'https://api.nuget.org/v3/index.json':   Issued by: CN=DigiCert SHA2 Assured ID Code Signing CA, OU=www.digicert.com, O=DigiCert Inc, C=US
Package 'Microsoft.Identity.Client 4.22.0' from source 'https://api.nuget.org/v3/index.json': Timestamp: 10/22/2020 1:50:36 PM

Package 'Microsoft.Identity.Client 4.22.0' from source 'https://api.nuget.org/v3/index.json': Verifying author primary signature's timestamp with timestamping service certificate: 
  Subject Name: CN=Symantec SHA256 TimeStamping Signer - G3, OU=Symantec Trust Network, O=Symantec Corporation, C=US
  SHA1 hash: A9A4121063D71D48E8529A4681DE803E3E7954B0
  SHA256 hash: C474CE76007D02394E0DA5E4DE7C14C680F9E282013CFEF653EF5DB71FDF61F8
  Issued by: CN=Symantec SHA256 TimeStamping CA, OU=Symantec Trust Network, O=Symantec Corporation, C=US
  Valid from: 12/22/2017 7:00:00 PM to 3/22/2029 7:59:59 PM

Installed Microsoft.Win32.Registry 5.0.0 from https://api.nuget.org/v3/index.json with content hash dDoKi0PnDz31yAyETfRntsLArTlVAVzUzCIvvEDsDsucrl33Dl8pIJG06ePTJTI3tGpeyHS9Cq7Foc/s4EeKcg==.
Package 'Microsoft.Data.SqlClient 4.1.0' from source 'https://api.nuget.org/v3/index.json': Signature Hash Algorithm: SHA256
Package 'Microsoft.Data.SqlClient 4.1.0' from source 'https://api.nuget.org/v3/index.json': Verifying the author primary signature with certificate: 

Package 'Microsoft.Data.SqlClient 4.1.0' from source 'https://api.nuget.org/v3/index.json':   SHA1 hash: A6E18D21B507879FC7F9C392A5CE355936E3AD2C
Package 'Microsoft.Data.SqlClient 4.1.0' from source 'https://api.nuget.org/v3/index.json':   Issued by: CN=DigiCert SHA2 Assured ID Code Signing CA, OU=www.digicert.com, O=DigiCert Inc, C=US
Package 'Microsoft.Data.SqlClient 4.1.0' from source 'https://api.nuget.org/v3/index.json': Timestamp: 1/31/2022 5:36:44 PM

Package 'Microsoft.Data.SqlClient 4.1.0' from source 'https://api.nuget.org/v3/index.json': Verifying author primary signature's timestamp with timestamping service certificate: 
  Subject Name: CN=Symantec SHA256 TimeStamping Signer - G3, OU=Symantec Trust Network, O=Symantec Corporation, C=US
  SHA1 hash: A9A4121063D71D48E8529A4681DE803E3E7954B0
  SHA256 hash: C474CE76007D02394E0DA5E4DE7C14C680F9E282013CFEF653EF5DB71FDF61F8
  Issued by: CN=Symantec SHA256 TimeStamping CA, OU=Symantec Trust Network, O=Symantec Corporation, C=US
  Valid from: 12/22/2017 7:00:00 PM to 3/22/2029 7:59:59 PM

Installed System.Security.Principal.Windows 5.0.0 from https://api.nuget.org/v3/index.json with content hash t0MGLukB5WAVU9bO3MGzvlGnyJPgUlcwerXn1kzBRjwLKixT96XV0Uza41W49gVd8zEMFu9vQEFlv0IOrytICA==.
Installed System.Security.Cryptography.Cng 5.0.0 from https://api.nuget.org/v3/index.json with content hash jIMXsKn94T9JY7PvPq/tMfqa6GAaHpElRDpmG+SuL+D3+sTw2M8VhnibKnN8Tq+4JqbPJ/f+BwtLeDMEnzAvRg==.
NU3008: Package 'System.Text.Encoding.CodePages 5.0.0' from source 'https://api.nuget.org/v3/index.json': The package integrity check failed. The package has changed since it was signed. Try clearing the local http-cache and run nuget operation again.
NU3008: Package 'Microsoft.Identity.Client 4.22.0' from source 'https://api.nuget.org/v3/index.json': The package integrity check failed. The package has changed since it was signed. Try clearing the local http-cache and run nuget operation again.
NU3008: Package 'Microsoft.Data.SqlClient 4.1.0' from source 'https://api.nuget.org/v3/index.json': The package integrity check failed. The package has changed since it was signed. Try clearing the local http-cache and run nuget operation again.
Time Elapsed: 00:00:14.2400739

What I have tried:

  • Rebooting
  • Clearing my local cache (I have tried this many times, both from the command line with the nuget program and VS under Tools, Options, NuGet Package Manager, Clear All NuGet Cache(s))
  • Installing dependencies individually from NuGet
  • Repairing the Visual Studio 2022 installation

I have been trying to resolve this for almost 2 days now and I'm starting to see the red mist. I don't understand why this is failing or how to fix it, and I'm beyond frustrated with Microsoft for making the formerly simple process of adding dependencies complicated and opaque. Please, any help?

Update

To clarify, this does not happen for every package, but it does happen every time for Microsoft.Data.SqlClient (and other Microsoft packages).

I am using the latest version of the nuget command line tool (6.2.1.2)

I have tried all the suggestions made by Jingmiao Xu-MSFT below other than uninstalling and reinstalling Visual Studio. Suggestion #2, copying over the failing packages from another machine, did work but I do not accept that as a tenable permanent solution. Am I supposed to pester a coworker whenever I need to install packages from Microsoft?

I came across this issue which is nearly identical to mine, including the package and the package version. Unfortunately it contains no details about the resolution. If there is an issue with our corporate network I will need to take specifics to them. What sorts of network features might tamper with a NuGet package download?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

柳若烟 2025-02-18 12:35:35

根据您的描述,错误消息说:“尝试清除本地HTTP-CACHE并再次运行Nuget操作。” and 此文档建议运行 > nuget本地人http-cache -clear dotnet nuget http-cache-clear 命令清除本地的HTTP-CACHES。

如果它不起作用,则可以尝试以下方法:

  1. 关闭vs,从 c:\ users \ xxx(当前用户)\ appdata \ roaming \ nuget ,< /p>

    delete .vs 解决方案文件夹的隐藏文件夹, bin obj 项目的文件夹,

    然后重新启动与再生该文件以检查其是否有效。

  2. 从另一个工作的PC中复制nuget packages microsoft.data.sqlclient to %userProfile%.nuget \ packages 。然后重新安装您的Nuget软件包以检查此工作是否工作。

  3. 下载最新的 nuget.exe v6.2.1 来自此链接然后关闭VS并重新启动您的项目,然后按CMD运行此命令:

    nuget还原

  4. 最后,您可以尝试卸载VS并重新安装它。安装后,您可以检查问题是否存在。

According to your description, the error message said “Try clearing the local http-cache and run nuget operation again.” and this document suggests to run nuget locals http-cache -clear or dotnet nuget locals http-cache --clear command to cleare local http-caches.

If it doesn’t work you can try the following methods:

  1. Close VS, delete nuget.config file from C:\Users\xxx(current user)\AppData\Roaming\NuGet,

    delete .vs hidden folder of the solution folder, bin and obj folder of the project,

    and then restart VS to regenerate that file to check whether it works.

  2. copy the nuget packages Microsoft.Data.SqlClient from another worked PC into %userprofile%.nuget\packages. And then reinstall your nuget package there to check if this work.

  3. download the latest nuget.exe v6.2.1 from this link and then close VS and restart your project and run this command under CMD:

    nuget restore.

  4. Finally, you can try to uninstall your vs and reinstall it. After installation, you can check if the problem exists.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文