LoadFromContext Occured(Wex.Logger.Interop)

时间:2016-04-20 14:50:19

标签: c# .net visual-studio f# visual-studio-2015

当我尝试在Visual Studio 2015中调试测试用例时,我收到“LoadFromContext Occurred”异常。这是通过测试资源管理器窗口并右键单击测试方法并选择“调试所选测试”来完成的。例外是:

LoadFromContext occurred
Message: Managed Debugging Assistant 'LoadFromContext' has detected a problem in 'C:\PROGRAM FILES (X86)\MICROSOFT VISUAL STUDIO 14.0\COMMON7\IDE\COMMONEXTENSIONS\MICROSOFT\TESTWINDOW\x64\te.processhost.managed.exe'.
Additional information: The assembly named 'Wex.Logger.Interop' was loaded from 'file:///C:/PROGRAM FILES (X86)/MICROSOFT VISUAL STUDIO 14.0/COMMON7/IDE/COMMONEXTENSIONS/MICROSOFT/TESTWINDOW/Wex.Logger.Interop.DLL' using the LoadFrom context. The use of this context can result in unexpected behavior for serialization, casting and dependency resolution. In almost all cases, it is recommended that the LoadFrom context be avoided. This can be done by installing assemblies in the Global Assembly Cache or in the ApplicationBase directory and using Assembly.Load when explicitly loading assemblies.

我尝试按照答案here上的说明操作,但禁用XAML的UI调试工具似乎不会影响事情。

'Wex.Logger.Interop'不是我在项目引用下看到的程序集,也不是我在代码中导入或加载的程序集。如果我正常运行我的测试用例,他们将运行而不会抛出此异常。它只在我尝试调试测试方法时才会发生。我可以通过测试资源管理器运行我的测试用例,它们按预期完成。如果我构建并运行我的解决方案,它就会运行。如果我调试我的项目,那不会导致异常。但是如果我尝试调试我的任何测试方法,它会抛出LoadFromContext Occured异常。

1 个答案:

答案 0 :(得分:0)

你有没有"打破所有错误"打开,如果是这样,关闭该错误,它是一个.NET错误,可以忽略。我有这个错误,我禁用了错误,它工作正常。在出现的错误弹出窗口中,出现此错误时会出现“中断”和“#39;或者像复选框一样,取消它。