gpt4 book ai didi

visual-studio-2012 - "LoaderLock was detected"使用 Visual Studio 2012

转载 作者:行者123 更新时间:2023-12-03 11:01:51 25 4
gpt4 key购买 nike

我有几个使用 SQL CE 4.0 和 Entity Framework 的 MVC 项目。自从迁移到 Visual Studio 2012 以来,我不断收到以下错误(不是每次,但经常出现)

检测到 LoaderLock

尝试在 OS Loader 锁内进行托管执行。不要尝试在 DllMain 或图像初始化函数中运行托管代码,因为这样做会导致应用程序挂起。

如果我重新使用 VS 2010,则不会发生该错误,这使我相当确定这是 Visual Studio 而不是我的代码的问题,但我希望有人为我确认!

编辑

该问题似乎总是在调用 dbcontext 的 Dispose() 方法时发生。这是异常助手的屏幕截图:

Exception Assistant

最佳答案

switch this off .因为它警告应用程序可能挂起,所以如果您的程序没有挂起,那么您可能没问题。

The problem can be solved in the same way though, by switching off the MDA:

Debug -> Exceptions -> Managed Debug Assistants

and unchecking the LoaderLock item.

关于visual-studio-2012 - "LoaderLock was detected"使用 Visual Studio 2012,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12900192/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com