尝试在 .Net5 中发布时出现 Nuget 错误
Nuget error when trying to publish in .Net5
当我在 .Net5 中发布时,出现以下错误
Severity Code Description Project File Line Suppression State
Error Assets file 'C:\Users\cornelis.dejager\source\repos\Marel.MSAWebServiceAPI\Marel.MSAWebServiceAPI\obj\publish\win-x86\project.assets.json' not found. Run a NuGet package restore to generate this file. Marel.MSAWebServiceAPI 0
和
Severity Code Description Project File Line Suppression State
Error Failed to retrieve information about 'Microsoft.WindowsDesktop.App.Runtime.win-x86' from remote source 'https://api.nuget.org/v3-flatcontainer/microsoft.windowsdesktop.app.runtime.win-x86/index.json'.
An error occurred while sending the request.
The request was aborted: Could not create SSL/TLS secure channel. Marel.MSAWebServiceAPI 0
是什么原因造成的:
老实说,我不确定。在我更改代码后它停止工作。该项目几周来一直很好,突然间发生了变化。
我试过了
- 清洁溶液
- Build/Re-Build 解决方案
- 恢复 Nuget 包
- 更新Visual Studio
- 重建所有项目
- 删除 Bin 和对象文件夹
- 更新所有包
- 正在重新启动 Visual Studio + 计算机
- 创建了新的发布配置文件
- 安装 dotnet-WindowsDesktop
- 重新安装 .Net5 运行次
- 运行命令:
附加信息
- 它构建并且 运行 很好。只有当我发布时它似乎给我一个错误。
我真的不明白为什么发布不起作用。看了好几个地方,还没找到解决方法。
可能是包源错误,
在Visual Studio转到
Options=> Nuget Package Manager=> Package Sources
如果您使用的是自定义来源,请确保您输入的地址正确。
NuGet 默认源地址是https://api.nuget.org/v3/index.json
当我在 .Net5 中发布时,出现以下错误
Severity Code Description Project File Line Suppression State Error Assets file 'C:\Users\cornelis.dejager\source\repos\Marel.MSAWebServiceAPI\Marel.MSAWebServiceAPI\obj\publish\win-x86\project.assets.json' not found. Run a NuGet package restore to generate this file. Marel.MSAWebServiceAPI 0
和
Severity Code Description Project File Line Suppression State Error Failed to retrieve information about 'Microsoft.WindowsDesktop.App.Runtime.win-x86' from remote source 'https://api.nuget.org/v3-flatcontainer/microsoft.windowsdesktop.app.runtime.win-x86/index.json'. An error occurred while sending the request. The request was aborted: Could not create SSL/TLS secure channel. Marel.MSAWebServiceAPI 0
是什么原因造成的:
老实说,我不确定。在我更改代码后它停止工作。该项目几周来一直很好,突然间发生了变化。
我试过了
- 清洁溶液
- Build/Re-Build 解决方案
- 恢复 Nuget 包
- 更新Visual Studio
- 重建所有项目
- 删除 Bin 和对象文件夹
- 更新所有包
- 正在重新启动 Visual Studio + 计算机
- 创建了新的发布配置文件
- 安装 dotnet-WindowsDesktop
- 重新安装 .Net5 运行次
- 运行命令:
附加信息
- 它构建并且 运行 很好。只有当我发布时它似乎给我一个错误。
我真的不明白为什么发布不起作用。看了好几个地方,还没找到解决方法。
可能是包源错误,
在Visual Studio转到
Options=> Nuget Package Manager=> Package Sources
如果您使用的是自定义来源,请确保您输入的地址正确。 NuGet 默认源地址是https://api.nuget.org/v3/index.json