C# 当前位置没有可用的来源
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8791669/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
There is no source available for the current location
提问by user575219
I am getting this error.
我收到此错误。
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'.
Probably it is not finding a CropImage.cs or its getting a mismatch. I have added CS.Web.UI.CropImage.dll in the bin folder. Not sure why it still needs a .cs
可能它没有找到 CropImage.cs 或者它不匹配。我在 bin 文件夹中添加了 CS.Web.UI.CropImage.dll。不知道为什么它仍然需要 .cs
Thanks Sun
谢谢孙
采纳答案by Anthony Shaw
Likely what is happening, is that DLL that you've referenced is throwing an exception when you're calling it. When you're debugging, Visual Studio would like you show you the line of code that is throwing the error, but it doesn't know where the source is. Usually, in my environment, it will prompt you to locate the source file and open it so that it can show you additional debug information. I would usually get the error you mention, when I press cancel on that dialog since I either don't have the source, or don't care what the source is
可能发生的情况是,您引用的 DLL 在您调用它时抛出异常。在调试时,Visual Studio 希望您向您展示引发错误的代码行,但它不知道源在哪里。通常,在我的环境中,它会提示您定位源文件并打开它,以便它可以向您显示其他调试信息。我通常会收到您提到的错误,当我在该对话框上按取消时,因为我要么没有源,要么不在乎源是什么
回答by Miro Malek
Open "Solution 'YourSolutionName' property pages" window (go to main menu: Project->Properties) and then go to "Debug Source Files". Check under "Do not look for these source files" window if you have your problematic file path written in it. If yes, delete the path and try again. I think this might solve your problem.
打开“解决方案‘YourSolutionName’属性页”窗口(转到主菜单:项目->属性),然后转到“调试源文件”。如果其中写入了有问题的文件路径,请检查“不要查找这些源文件”窗口。如果是,请删除路径并重试。我认为这可能会解决您的问题。
Regards,
问候,
回答by 0xDEAD BEEF
For me it was Miro's solution + I cleaned project and manually removed all filed from Debug and Release folders. This forces clean rebuild.
对我来说,这是 Miro 的解决方案 + 我清理了项目并手动删除了 Debug 和 Release 文件夹中的所有文件。这会强制干净重建。
回答by Thakur Rock
I have removed files from Bin/Debug and Bin/Release folder.Which worked for me.
我已经从 Bin/Debug 和 Bin/Release 文件夹中删除了文件。这对我有用。
回答by toddmo
If is an ASP.Net project, delete the temporary files. This cannot hurt. Any time a copy is made, the possibility exists that somehow it can get out of sync.
如果是 ASP.Net 项目,请删除临时文件。这不能伤害。任何时候制作副本时,都有可能以某种方式失去同步。
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\
In my case, before I did that, I could not set any breakpoints. The error was giving the exact same path in both MD5 statements, and saying the checksum didn't match.
就我而言,在我这样做之前,我无法设置任何断点。错误是在两个 MD5 语句中给出了完全相同的路径,并说校验和不匹配。
After I did that, it still told me the source version was different, but I choose to use it anyway, and I was able to step through the code and set breakpoints.
在我这样做之后,它仍然告诉我源版本不同,但我还是选择使用它,并且我能够单步执行代码并设置断点。
Go figure.
去搞清楚。
And one more thing: If you want to know where it's getting the pdb from actually, you can go into Debug, Windows, Modules, and find the dll in question, and see the path in the Symbol Filecolumn.
还有一件事:如果您想知道它实际上从哪里获取 pdb,您可以进入Debug, Windows, Modules,找到有问题的 dll,然后查看Symbol File列中的路径。

