[英]System.ExecutionEngineException in DBContext Constructor
I know this is a very vague error, but I've posted on the EF Core and CLR git repositories, and they have no idea.我知道这是一个非常模糊的错误,但我已经在 EF Core 和 CLR git 存储库上发布了信息,但他们不知道。 I wonder if this might have something to do with dependency injection (I'm using AutoFac).
我想知道这是否与依赖注入有关(我正在使用 AutoFac)。
The error happens about every other time I start a new debugging session.每隔一次我开始新的调试会话时就会发生错误。 It happens in the constructor of my class which inherits from DbContext, when I am passing the DbContextOptions down to the base.
它发生在我从 DbContext 继承的类的构造函数中,当我将 DbContextOptions 传递给基类时。
Exception:例外:
Exception Type: System.ExecutionEngineException异常类型:System.ExecutionEngineException
Exception Message="Exception of type 'System.ExecutionEngineException' was thrown."异常消息="抛出了“System.ExecutionEngineException”类型的异常。"
Stack trace: Empty堆栈跟踪:空
protected WinsDbContextBase(DbContextOptions options, ICurrentUserContext userContext)
: base(options) <=== the error occurs on this line
{
... other code here ...
}
I know this is not really enough to go on, but I'm posting this here in hopes that maybe someone else has experienced this and can give me a clue as to where to start digging.我知道这还不够继续,但我在这里发布这个是希望也许其他人经历过这个并且可以给我一个关于从哪里开始挖掘的线索。
Edit: This came down to a known bug in the CLR and is scheduled to be fixed in 4.8 framework build.编辑:这归结为 CLR 中的一个已知错误,并计划在 4.8 框架构建中修复。 The workaround was to add the following to my Machine.config file:
解决方法是将以下内容添加到我的 Machine.config 文件中:
<configuration>
<runtime>
<disableNativeImageLoad>
<assemblyIdentity name="netstandard" />
</disableNativeImageLoad>
</runtime>
</configuration>
https://github.com/dotnet/coreclr/issues/22137 https://github.com/dotnet/coreclr/issues/22137
This came down to a known bug in the CLR and is scheduled to be fixed in 4.8 framework build.这归结为 CLR 中的一个已知错误,并计划在 4.8 框架构建中修复。 The workaround was to add the following to my Machine.config file:
解决方法是将以下内容添加到我的 Machine.config 文件中:
<configuration>
<runtime>
<disableNativeImageLoad>
<assemblyIdentity name="netstandard" />
</disableNativeImageLoad>
</runtime>
</configuration>
https://github.com/dotnet/coreclr/issues/22137 https://github.com/dotnet/coreclr/issues/22137
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.