簡體   English   中英

DBContext 構造函數中的 System.ExecutionEngineException

[英]System.ExecutionEngineException in DBContext Constructor

我知道這是一個非常模糊的錯誤,但我已經在 EF Core 和 CLR git 存儲庫上發布了信息,但他們不知道。 我想知道這是否與依賴注入有關(我正在使用 AutoFac)。

每隔一次我開始新的調試會話時就會發生錯誤。 它發生在我從 DbContext 繼承的類的構造函數中,當我將 DbContextOptions 傳遞給基類時。

例外:

異常類型:System.ExecutionEngineException

異常消息="拋出了“System.ExecutionEngineException”類型的異常。"

堆棧跟蹤:空

protected WinsDbContextBase(DbContextOptions options, ICurrentUserContext userContext)
    : base(options) <=== the error occurs on this line
    {
... other code here ...
    }

我知道這還不夠繼續,但我在這里發布這個是希望也許其他人經歷過這個並且可以給我一個關於從哪里開始挖掘的線索。

編輯:這歸結為 CLR 中的一個已知錯誤,並計划在 4.8 框架構建中修復。 解決方法是將以下內容添加到我的 Machine.config 文件中:

<configuration>
        <runtime>
          <disableNativeImageLoad>
            <assemblyIdentity name="netstandard" />
          </disableNativeImageLoad>
        </runtime>
    </configuration>

https://github.com/dotnet/coreclr/issues/22137

這歸結為 CLR 中的一個已知錯誤,並計划在 4.8 框架構建中修復。 解決方法是將以下內容添加到我的 Machine.config 文件中:

<configuration>
        <runtime>
          <disableNativeImageLoad>
            <assemblyIdentity name="netstandard" />
          </disableNativeImageLoad>
        </runtime>
    </configuration>

https://github.com/dotnet/coreclr/issues/22137

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM