首页 > 解决方案 > 使用此错误构建 ASP.NET 项目:Microsoft.AspNetCore.Cryptography.Internal.dll 中的“System.DllNotFoundException”

问题描述

唯一引用 Microsoft.AspNetCore.Cryptography.Internal.dll 的包在这里:在此处输入图像描述

这些错误在构建/运行时间歇性地出现在控制台中 - 但仅在 Visual Studio Code for Mac 中,而不是在 Visual Studio for Mac 或 Rider 中:

-------------------------------------------------------------------
You may only use the Microsoft .NET Core Debugger (vsdbg) with
Visual Studio Code, Visual Studio or Visual Studio for Mac software
to help you develop and test your applications.
-------------------------------------------------------------------
[01:07:28 INF] Application Starting Up
Exception thrown: 'System.Net.Sockets.SocketException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Net.Http.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Net.Http.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Net.Http.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.Net.Http.HttpRequestException' in System.Private.CoreLib.dll
Exception thrown: 'System.DllNotFoundException' in Microsoft.AspNetCore.Cryptography.Internal.dll
Exception thrown: 'System.Net.Sockets.SocketException' in System.Private.CoreLib.dll

我可以从 Visual Studio for Mac 或 Rider 运行该项目,但在使用 Visual Studio Code for Mac 时出现此错误。难住了。我什至卸载了 .NET Core 运行时并重新安装了它们(最新版本的 .NET Core 2 和 3)。

有任何想法吗?

标签: visual-studio-code

解决方案


推荐阅读