-
Notifications
You must be signed in to change notification settings - Fork 56
Any tips for troubleshooting Visual Studio no working with Source Link? #306
Comments
|
Thanks for the help. I switched to portable and it worked when I using a local (file system) nuget feed! However, when the nuget is created from our CI (TeamCity), it fails to Step Into. If I try to manually load the symbols through the Debug > Windows > Modules, it is trying to point to a file system location in the CI agents. Not sure if this is expected or not, but here are some details: If I click on "Symbol Load Information" it has the TC location This is my Symbols Settings: In the Team City agent, this is the sourcelink.json file generated: {"documents":{"D:\\TCW\\16805bc3ab87691c\\*":"http://stash.xxx.com:7990/projects/cclcom/repos/somerepo/browse/*?raw=1&at=de2a587657d77c404ff75047fb6ce66064cff418"}} Following your advise, if I unzip the generated nuget in TeamCity, and run the dotnet source-link commands this is what I get: dotnet sourcelink print-json c:\temp\nuget\Assembly.1.9.5\lib\netstandard2.0\Assembly.pdb
{"documents":{"D:\\TCW\\16805bc3ab87691c\\*":"http://stash.xxx.com:7990/projects/cclcom/repos/somerepo/browse/*?raw=1&at=de2a587657d77c404ff75047fb6ce66064cff418"}}
dotnet sourcelink print-documents c:\temp\nuget\Assembly.1.9.5\lib\netstandard2.0\Assembly.pdb
c77b4dd8b5444604628bf81030467e4cea671e45 sha1 csharp D:\TCW\16805bc3ab87691c\src\Assembly\Utilities\CastUtilities.cs
867ed556e45121e470e52806b9e7637b8b779372 sha1 csharp D:\TCW\16805bc3ab87691c\src\Assembly\Utilities\EmailExtensions.cs
etc
dotnet sourcelink print-urls c:\temp\nuget\Assembly.1.9.5\lib\netstandard2.0\Assembly.pdb
c77b4dd8b5444604628bf81030467e4cea671e45 sha1 csharp D:\TCW\16805bc3ab87691c\src\Assembly\Utilities\CastUtilities.cs
http://stash.xxx.com:7990/projects/cclcom/repos/somerepo/browse/src/Assembly/Utilities/CastUtilities.cs?raw=1&at=de2a587657d77c404ff75047fb6ce66064cff418
867ed556e45121e470e52806b9e7637b8b779372 sha1 csharp D:\TCW\16805bc3ab87691c\src\Assembly\Utilities\EmailExtensions.cs
http://stash.xxx.com:7990/projects/cclcom/repos/somerepo/browse/src/Assembly/Utilities/EmailExtensions.cs?raw=1&at=de2a587657d77c404ff75047fb6ce66064cff418
etc The BitBucket urls are correct. If I paste the generated file urls into the browser, I get the raw file. Is supposed to be a url or a pattern? If it is supposed to be a url that returns a snapshot of all the files for that commit, then it is not working. I'm getting a 404 from BitBucket Server. By the way, I try to run the dotnet source-link commands pointing at the nupkg I get the following error for all the print-* commands:
However, this one passes: dotnet sourcelink test c:\temp\nuget\Assembly.1.9.5.nupkg
sourcelink test passed: lib/netstandard2.0/Assembly.pdb |
I have encountered similar as in comment above problem with embedded source files. But unfortunately this goes against this guide on debugging .net sources and i cannot debug framework sources anymore. |
@epignosisx If you are getting 404 errors from the URLs, then |
@YakhontovYaroslav possibly a Visual Studio regression if embedded source works for 15.5.0 and not 15.5.2. |
As a troubleshooting step, try out a source link enabled library that is known to work. I created an example and uploaded a video demo in #307. |
@ctaggart the individual urls for each file work just fine. My question is about this one: from the print-json output. Is that supposed to be a true url that should return a 200 OK from BitBucket? |
@epignosisx The information in the json is used to construct the URLs. The |
@ctaggart thank you so much for putting together that video! It helped a lot narrowing things down. I downloaded the TryJson repo and it worked great! So definitely not a VS issue. So I went back and started looking at my implementation and found the problem. It was simply that I'm publishing my ASP.NET Core app to a different directory and during the publishing the dependencies' pdb files are not copied over. Once I manually copied the pdb it worked! You should consider adding that video and the TryJson to the wiki as troubleshooting tips. It will definitely narrow down the problem. |
@epignosisx Glad you figured it out. Any idea what is needed to get the pdb files copied over automatically. If you add SourceLink to your ASP.NET Core app too, does it then copy the pdb files. Or if you add this property, does it copy the pdb files? |
I haven’t figured that part out yet. I’m going to try out a few things, among them your suggestion. I’ll post my findings. This wouldn’t be an issue if embedded pdbs would have worked. Any idea why? |
It appears the the .NET Core projects when targeting the .NET Framework do not copy the pdb files to the Debug or Release directories. the .NET Core targets use runtimeconfig files, so they end up using the files from their original locations. netcoreapp2.0<TargetFramework>netcoreapp2.0</TargetFramework> net46<TargetFramework>net46</TargetFramework> I'll open up a bug. |
I opened up bug 3rd party pdb files not copied to build output #2920. |
I opened up a specific issue to track this problem. #313 |
I'm trying to integrate SourceLink V2 with our internal repos and it seems like the nuget is generated correctly with SourceLink based on the output of:
However, when I installed the nuget in a solution and try to step in the assembly it does not work. Any tips for troubleshooting? I checked VS's debug output but it does not have anything related Source Linking. I do not get a VS prompt either.
Here is my VS config:
This is the csproj:
Relevant build script line:
The text was updated successfully, but these errors were encountered: