Debug .NET Core source (Visual Studio 2019)

戏子无情 提交于 2019-12-06 06:15:00

Maybe this issue can help solve your puzzle.

Just like what vancem describes in that issue, all you need to do for debugging .net core source is:

1.Uncheck the (Tools -> Options -> Debugging -> Just My Code) checkbox.

2.Ensure that the (Tools -> Options -> Debugging -> Symbol Settings -> Microsoft Symbol Servers) checkbox is set

3.Ensure that the (Tools -> Options -> Debugging -> Enable Source Link support) checkbox is checked

"GenericHostBuilderExtensions.cs is not found".

As for why you fail here. I think it's similar to the issue I provides above. For .net core 3.0 preview, some of its libraries currently don't have source links in github so the vs can't fetch them. (Like .net core 2.0 in 2017, now it has been fixed)

Actually, if you follow options above, you will find you can debug well .net core 2.x web-app, but may fail for not finding source links for .net core 3.0.

As a workaround:

1.You can try getting the source manually from git, and go solution -> Properties -> Debug Source Files, then add your directory to the 'Directories Containing Source Code' to check if it helps for some situation. (Which is describe in details by vancem, thanks to him)

2.And the source of GenericHostBuilderExtensions.cs of the GenericHostBuilderExtensions.cs can be found here.I reproduced same issue, and resolve it by download the xx.cs and find it during debugging.

3.But I have to say this way takes some time. Since not only this file has no source file, we will meet similar issues and have to resolve it by getting corresponding source from git unless all the source in .net core3.0 has its source links. But it may takes some time, sorry for this inconvenience. And I suggest you can post it on github and share link here. Members interested in it will help vote it.

Hope all above helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!