Welcome to the Inedo Forums! Check out the Forums Guide for help getting started.

If you are experiencing any issues with the forum software, please visit the Contact Form on our website and let us know!

Symbol Server - PDB Incorrectly Indexed



  • VS correctly requests and receives the PDB from the symbol server, but the subsequently requests the incorrect source file. Output from pdbstr.exe reveals the issue:

    SRCSRV: source files ---------------------------------------

    [BaseDirectory]\contracts\exceptionformatter.cs*ExceptionFormatter.cs

    [BaseDirectory]\contracts\streamclient.cs*Client.cs ** INCORRECT **

    [BaseDirectory]\contracts\properties\resources.designer.cs*Properties/Resources.Designer.cs

    [BaseDirectory]\contracts\channelfactoryextensions.cs*ChannelFactoryExtensions.cs

    [BaseDirectory]\contracts\client.cs*Client.cs

    [BaseDirectory]\contracts\argumentformatter.cs*ArgumentFormatter.cs

    SRCSRV: end ------------------------------------------------

    Decompiled Inedo.ProGet.WebApplication.SimpleHandlers.SymbolServerHandler @ ProGet.WebApplication. In ProcessRequestInternal there is a loop to match pdb source file paths to nuget package source files using an IndexOf. In my example, IndexOf results in two matches (Client.cs and StreamClient.cs) and then incorrectly writes the first. IndexOf may also be problematic for same-named files in different sub-directories.

    Maybe one potential solution is to first establish a common base path, then match on the remaining relative path in the nuget package:

        /// <summary>
        /// Finds the source base path.
        /// </summary>
        /// <param name="sourceFiles">The source file paths in the NuGet package under the 'src' directory.</param>
        /// <param name="referencedSources">The referenced sources obtained from srctool.exe.</param>
        /// <returns>The most common source base path with respect to matching files in the NuGet package.</returns>
        private static string FindSourceBasePath(IEnumerable<string> sourceFiles, IEnumerable<string> referencedSources)
        {
            return referencedSources.Aggregate(
                referencedSources.First(),
                (b, s) =>
                {
                    while ((!s.StartsWith(b, StringComparison.OrdinalIgnoreCase) || !sourceFiles.Contains(Path.Combine("src", s.Substring(b.Length)), StringComparer.OrdinalIgnoreCase)) && b.Length > 0)
                    {
                        b = b.Substring(0, b.Length - 1);
                    }
                    return b;
                });
        }
    

    Product: ProGet
    Version: 3.3.11



  • I'm having a similar problem. Will keep an eye on this.



  • Thanks for this investigation and suggested fix. We'll look into implementing something like this for the next maintenance release.



  • Just to let you know- we should have this fix in ProGet v3.4, scheduled for Friday (January 9). There is a smaller maintenance release scheduled for today, but that will not include this fix due to the amount of testing required.



  • Proget 3.4.4

    Visual Studio fetches the PDB correctly to the symbols cache, but then searches for the source with a local path used on our build server. Sources are not downloaded.


Log in to reply
 

Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation