Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible

前端 未结 11 1632
执笔经年
执笔经年 2020-12-15 16:54

Here is the error

Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code

11条回答
  •  甜味超标
    2020-12-15 17:28

    While it's true that the "Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized" error appears when in release mode, most developers just ensure that their projects are configured to compile as a debug build. BUT to be sure that you have no release-DLL issues, you also must check the references to DLLs that are in your solution and make sure that you don't have a reference to a release-build DLL. If you find that this is the case, delete the DLL reference and then add a project reference rather than a DLL reference. The project reference will ensure that your solution references debug or release versions of the DLL as specified in your build configuration.

    Note that the above advice applies, of course, to only those DLLs to which you have source code and which are built from a project in your solution.

提交回复
热议问题