Friday, November 3, 2017

[C#] Breakpoint will not currently be hit. No symbols loaded for this document.

breakingpoint

Recently I was modify an old WPF application, but when I am debugging, it shows a message on my breakpoint told it can't work.
最近我在改一個之前的WPF程式,但當我在除錯時,發現中斷點上顯示了一個訊息說它無法運作。
Breakpoint will not currently be hit. No symbols loaded for this document.

Googled it, a lot of solutions about this question, like this "Breakpoint will not currently be hit. No symbols loaded for this document." on codeproject , but no one work on me.
Google了一下,很多關於這問題的解法,像是codeproject上的"Breakpoint will not currently be hit. No symbols loaded for this document."這篇,不過沒有一個解法對我適用。


So I traced the detail, find out my pdb file (use for debug) have been removed after build, then I check my build event, in post-build event I have a command use for merge dll into exe via Libz, seems when Libz doing merge, it will clear pdb file at same time.
我開始追細節,發現在程式建置完後,我的pdb檔案(用來除錯的)被移除掉,然後我確認了設定裡的建置事件,在建置後事件我有個指令是用Libz將dll合併到exe裡,看來在Libz做合併時會同時將pdb檔清掉。

breakingpoint2

After remove the command, my breakpoint back to work, the problem solved!! Remember put back the command when you finish the modify.
移除指令之後,我的中斷點回來工作啦,問題解決!! 記得當你完成修改後,要把指令放回去。

No comments:

Post a Comment