How to force Visual Studio 2015 to unlock .PDB file after FreeLibrary call?

☆樱花仙子☆ 提交于 2019-12-21 21:47:12

问题


After loading a DLL library using LoadLibrary("file.dll") visual studio also opens and locks file.pdb.

The problem is - the file.pdb is kept locked even after calling FreeLibrary(...).

It is necessary to recompile file.dll and reload it once again (externally, outside of MSVS, using CL.exe), but the compilation fails because file.pdb is still locked.

How to make Visual Studio 2015 release the file lock?


回答1:


Coincidentally I've stumbled upon a solution to this:

Go to Tools -> Options then Debugging -> General, then turn on Use Native Compatibility Mode.

This fixes the issue (e.g. .pdb file is unlocked after unloading .dll now).

I've no idea why, as I can't find the documentation for Use Native Compatibility Mode.



来源:https://stackoverflow.com/questions/38427425/how-to-force-visual-studio-2015-to-unlock-pdb-file-after-freelibrary-call

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!