Asp.net :一個調試錯誤 Breakpoint will not currently be hit. No symbols loaded for this document.

來源:互聯網
上載者:User

   為調試Crystal Report功能,臨時建了一個Crystal Report網站(Vs2010, Windows2008, IIS7,基於.NET 4.0),當需要Attach Process 進行調試時遇到了一個錯誤:
   "Breakpoint will not currently be hit. No symbols loaded for this document."
   如果直接F5進行調試則會成功進入Breakpoint,但Attach Process就會hit不到。
   經過一番償試,終於解決問題,解決方案或步驟如下

Step 1. 先停止WWW services 服務 
1). 開啟 Administrative Tools 再選擇 Services項
2). 在Services控制台, 停止World Wide Web Publishing Service.
 
Step 2. 停止你要調試的網站,直接在IIS中停止它就行。

Step 3. 刪除目錄 C:\windows\microsoft.net\framework\v4.0.30319\Temporary ASP.NET Files

  (視項目的基於的.net framework版本而定,由於本項目是基於.NET 4.0,所以刪除對應版本Framework下的Temporary ASP.NET Files內的檔案)

Step 4. 刪除在項目的bin或obj 目錄下的所以的 PDB 和Dll file檔案。
 註:如果debugger沒有加裁.pdf檔案,則Breakpoin不會被hit到,所以要保證debugger一定載入了symbols內容。我們可以通過下面方式來進行檢查:
Debug->Windows->Modules,然後選擇你的dll module,看看是否pdf檔案被加裁了,如果沒有,我們可能手動載入,方法是:Right click the dll model->Select Load Symbols

Step 5. 檢查Vs2010此項目的web.config檔案,加入 <compilation debug="True">
    <system.web>
     <deployment retail=”true”/>
    </system.web>

Step 6. 使用VS2010重新Publish網站,在發布屬性頁面選中Emit the debug information項.

Step 7.  重啟 www services,重啟IIS

(命令列方式Start Menu--Run--cmd--c:\>iisreset /restart),再次通過attach process 來調試項目。

通常情況,經過上面操作步驟,絕大部問題都會解決,如果還存在hit不到的情況,則要具體問題具體分析了,

 

以下是有用的相關參考連結。
Visual Studio Debugger FAQ: http://blogs.msdn.com/b/jimgries/archive/2007/08/07/visual-studio-debugger-faq.aspx
Debugger doesn't work:http://blogs.msdn.com/b/mkpark/archive/2004/03/09/86872.aspxBreakpointBreakpoint

will not currently be hit: http://www.visualstudiodev.com/visual-studio-debugger/breakpoint-will-not-currently-be-hit-no-symbols-loaded-for-this-document-11902.shtml

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.