2012-01-09 35 views
6

我收到此錯誤。沒有可用於當前位置的源

Locating source for 'C:\Users\cem\Documents\Visual Studio 2008\Projects\CS.Web.Controls\WebCropImage\CropImage.cs'. Checksum: MD5 {20 55 30 34 b8 e3 ee df 89 75 e5 b5 36 b6 13 21} 
Determining whether the checksum matches for the following locations: 
1: C:\Users\sun\Desktop\trunk\CS.WebControls\WebCropImage\CropImage.cs Checksum: MD5 {5d 31 b6 21 f5 1 36 8b c0 25 dd b9 1e ff d7 89} Checksum doesn't match. 
2: C:\Users\sun\Downloads\WebCropImage.UI\CropImage.cs Checksum: MD5 {5d 31 b6 21 f5 1 36 8b c0 25 dd b9 1e ff d7 89} Checksum doesn't match. 
The file 'C:\Users\cem\Documents\Visual Studio 2008\Projects\CS.Web.Controls\WebCropImage\CropImage.cs' does not exist. 
Looking in script documents for 'C:\Users\cem\Documents\Visual Studio 2008\Projects\CS.Web.Controls\WebCropImage\CropImage.cs'... 
Looking in the projects for 'C:\Users\cem\Documents\Visual Studio 2008\Projects\CS.Web.Controls\WebCropImage\CropImage.cs'. 
The file was found in a project: 'C:\Users\sun\Downloads\WebCropImage.UI\CropImage.cs'. 
The file was found in a project: 'C:\Users\sun\Desktop\trunk\CS.WebControls\WebCropImage\CropImage.cs'. 
Determining whether the checksum matches for the following locations: 
1: C:\Users\sun\Downloads\WebCropImage.UI\CropImage.cs Checksum: MD5 {5d 31 b6 21 f5 1 36 8b c0 25 dd b9 1e ff d7 89} Checksum doesn't match. 
2: C:\Users\sun\Desktop\trunk\CS.WebControls\WebCropImage\CropImage.cs Checksum: MD5 {5d 31 b6 21 f5 1 36 8b c0 25 dd b9 1e ff d7 89} Checksum doesn't match. 
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\vc7\atlmfc'... 
Looking in directory 'C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\vc7\crt'... 
Looking in directory 'C:\Users\sun\Desktop\trunk\CS.WebControls\'... 
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: C:\Users\cem\Documents\Visual Studio 2008\Projects\CS.Web.Controls\WebCropImage\CropImage.cs. 
The debugger could not locate the source file 'C:\Users\cem\Documents\Visual Studio 2008\Projects\CS.Web.Controls\WebCropImage\CropImage.cs'. 

很可能它找不到CropImage.cs或其不匹配。 我在bin文件夾中添加了CS.Web.UI.CropImage.dll。不知道爲什麼它仍然需要的.cs

感謝 孫

+0

這是一個ASP.NET項目嗎?一個WebForms項目?一個WinForms項目?一個WPF項目?錯誤消息何時出現?不要手動添加東西到bin文件夾。 IDE爲你做到了這一點。添加參考資料,不要在bin文件夾中查找 - 這是在尋求麻煩。 – 2012-01-09 16:28:31

+2

不是一個好問題 - 你真的沒有具體關於何時發生這種事!這就是說 - 我的猜測是CropImage庫中發生了一個異常,即在BIN中有一個PDB,因此調試器知道該錯誤出現在名爲CropImage.cs的文件中的代碼中。這不是一個運行時錯誤 - 它的環境要求您將它指向代碼文件,以便它可以向您顯示錯誤的位置。 – 2012-01-09 16:30:15

回答

3

很有可能發生的事情,是你已經提到,當你調用它拋出一個異常DLL。當您調試時,Visual Studio會讓您向您顯示引發錯誤的代碼行,但它不知道源的位置。通常,在我的環境中,它會提示您找到源文件並將其打開,以便它可以顯示額外的調試信息。我通常會得到你提到的錯誤,當我按下取消對話框,因爲我要麼沒有源,要麼不在乎源是什麼

+0

只需用try catch塊圍繞代碼 – 2017-12-11 21:31:49

15

打開「解決方案」YourSolutionName'屬性頁「窗口進入主菜單:Project-> Properties),然後進入「調試源文件」。如果您在其中寫入有問題的文件路徑,請在「不要查找這些源文件」窗口中進行檢查。如果是,請刪除路徑並重試。我認爲這可能會解決你的問題。

問候,

+0

謝謝...爲我解決了它! – 2013-05-30 03:24:00

+0

+1我也是,謝謝。 – 2013-06-18 13:47:11

+0

謝謝你們這解決了這個問題 – 2013-12-31 12:00:44

1

對我來說是米羅的解決方案+我清理項目,並手動刪除所有來自調試提出並釋放文件夾。這迫使乾淨的重建。

+0

有時一個乾淨的解決方案不會清除所有文件,手動刪除bin目錄是保證「清潔」的唯一方法。 – Francis 2017-02-02 17:01:34

0

我已經從Bin/Debug和Bin/Release文件夾中刪除了文件。其中有效。

0

如果是ASP.Net項目,請刪除臨時文件。這不會傷害。任何時候做一個副本,可能存在某種程度上它可能不同步。

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\

在我的情況下,之前我這樣做,我不能設置任何斷點。 錯誤在兩個MD5語句中給出完全相同的路徑,並且說校驗和不匹配。

我這樣做後,它仍然告訴我源代碼版本是不同的,但我仍然選擇使用它,並且我能夠遍歷代碼並設置斷點。

去圖。

還有一兩件事:如果你想知道是取得實際的PDB,你可以進入Debug, Windows, Modules,並找到有問題的DLL,並查看Symbol File列的路徑。

相關問題