问题
I have added html agility pack to my class library in project. Whenever i try to debug the HtmlAgilityPack specific code it opens a browse window asking for a HtmlAgilityPack source file (for example HtmlDocument.cs) or gives the error "There is no source code available for the current location."
What the heck is this, why I can not debug the HtmlAgilityPack related code.
回答1:
When you include a DLL in your project and step into the code it is not possible to show you a source view because a DLL does not include the source code - only the compiled byte code. If you want to debug you have to tell Visual Studio where the source code is, and to do that you need to download it first.
Alternatively you can just install the .NET Reflector Pro plugin (not free but you can try it for free) and have it automatically decompile the assembly and allow you to step into the decompiled code. This can also be useful if you have a third party product for which the source code is not available.
回答2:
Please try the following...
Visual Studio -> Debug -> Options -> Check both "Enable Just My Code" and "Warn if no user code on lunch (Managed Only)"
Options
来源:https://stackoverflow.com/questions/4558654/htmlagilitypack-debugging-asks-for-source-code