DBContext构造函数中的System.ExecutionEngineException

问题描述 投票:-1回答:1

我知道这是一个非常模糊的错误,但我已经发布了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

c# clr autofac
1个回答
0
投票

这归结为CLR中的已知错误,并计划在4.8框架构建中修复。解决方法是将以下内容添加到我的Machine.config文件中:

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

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

© www.soinside.com 2019 - 2024. All rights reserved.