0
我在我的linux機器上運行一個ASP Core項目。'Crypto'的類型初始值設定項引發異常
我對樣板本身做了很少的工作,只保留了一些模型。
今天早上我試着運行這個項目,突然間斷了。什麼都沒有我已經窺探了互聯網幾個小時,但都可以利用,因爲大多數遇到此問題的用戶都在運行在Mac系統中。請參閱下面的堆棧跟蹤。
Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
An unhandled exception has occurred: The type initializer for 'Crypto' threw an exception.
System.TypeInitializationException: The type initializer for 'Crypto' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'System.Security.Cryptography.Native.OpenSsl': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)
at Interop.Crypto.GetMaxMdSize()
at Interop.Crypto..cctor()
--- End of inner exception stack trace ---
at Interop.Crypto.EvpMd5()
at Internal.Cryptography.HashProviderDispenser.CreateHashProvider(String hashAlgorithmId)
at System.Security.Cryptography.MD5.Implementation..ctor()
at Npgsql.FrontendMessages.PasswordMessage.CreateMD5(String password, String username, Byte[] serverSalt)
at Npgsql.NpgsqlConnector.ProcessAuthenticationMessage(String username, AuthenticationRequestMessage msg)
at Npgsql.NpgsqlConnector.HandleAuthentication(String username, NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnector.Open(NpgsqlTimeout timeout)
at Npgsql.ConnectorPool.Allocate(NpgsqlConnection conn, NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnection.OpenInternal()
at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open()
at Microsoft.EntityFrameworkCore.Storage.Internal.NpgsqlDatabaseCreator.Exists()
at Microsoft.EntityFrameworkCore.Storage.RelationalDatabaseCreator.EnsureCreated()
任何可能的思路或解決方案
System.Security.Cryptography.Native.OpenSsl存在嗎? –
@DanielHilgarth在哪裏?我應該在哪裏檢查? –
您可以打開LD_DEBUG以獲取它探測的位置。另外,它可能是一個最近才被修復的bug:https://github.com/dotnet/corefx/issues/12517 –