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!

Source files not indexed



  • I'm trying to enable symbol and source server via ProGet.
    I'm getting half the way I think.

    I can get Visual Studio to request and download the PDB files but source setpping is not working for me.

    In side the PDB files served from ProGet I can find the following block:

    SRCSRV: ini ------------------------------------------------
    VERSION=2
    INDEXVERSION=2
    VERCTRL=http
    SRCSRV: variables ------------------------------------------
    SRCSRVVERCTRL=http
    PGSERVER=http://ms-ch12/source-files
    PGFEED=ShurePackages
    PGPKGID=Shure.TestUtilities
    PGPKGVER=0.0.21.0
    HTTP_EXTRACT_TARGET=%pgserver%/%pgfeed%/%pgpkgid%/%pgpkgver%/%var2%
    SRCSRVTRG=%http_extract_target%
    SRCSRVCMD=
    SRCSRV: source files ---------------------------------------
    SRCSRV: end ------------------------------------------------
    

    It does not seem to list any source files, and the visual studio output window lists the following when trying to step in to the source of a nuget package:

    SRCSRV: c:\Jenkins\jobs\CWB shure.testutilities\workspace\source\main\TestUtilities.Web\Helpers\ControllerHelper.cs not indexed

    SRCSRV: Source server cannot retrieve the source code for file 'c:\Jenkins\jobs\CWB shure.testutilities\workspace\source\main\TestUtilities.Web\Helpers\ControllerHelper.cs' in module 'C:\Source\shure\shure.conferencing\Web\Web.Tests\bin\Debug\Shure.TestUtilities.Web.dll'. The system cannot find the file specified.

    On the feed homepage for the module in the Symbols & Source section it writes:
    Symbols and source files are available. [view]

    I have inspected the package to both contain pdb files and a src section with all the source code.

    ProGet report no indexing errors.

    Any ideas of what is going wrong?

    Product: ProGet
    Version: 3.2.1



  • Are you able to send us the package with the symbols/source in it so we can try it on our test servers? If so, please send to support@inedo.com



  • I'm pretty sure I just figured out what the problem was.

    The folder layout/structure of the src folder of the nuget package was not a correct reflection of the structure on disk. As a test I manually edited the nuget package src folder layout, uploaded it to ProGet, then ProGet was able to index the source files correctly.

    I just used the "-symbols" switch with nuget.exe and let nuget figure out where the source is. It finds the source files but the directory naming/structure is incorrect. I will have to figure out how to fix this.

    Thanks anyway for your response!



  • I had the same issue as Peter. My project was structured on disk like this:

    • SolutionFolder
      • ClassLib
      • Application

    But my "ClassLib" was actually named "Namespace.ClassLib" inside the src folder of the nuget package for some reason. I had to change the physical folder name to "Namespace.ClassLib" and then repackage for the source server to be able to index the sources.

    I'd love to know why nuget.exe does this and how to workaround it, because we often use shorter folder names that don't match the project name exactly to reduce the annoying effect of repeated namespaces infolder names.

    For example, rather than:

    c:\dev\Solution\MyNamespace.Lib1\MyNamespace.Lib1.csproj
    c:\dev\Solution\MyNamespace.Lib2\MyNamespace.Lib2.csproj
    c:\dev\Solution\MyNamespace.Lib3\MyNamespace.Lib3.csproj

    My team prefers:

    c:\dev\Solution\Lib1\MyNamespace.Lib1.csproj
    c:\dev\Solution\Lib2\MyNamespace.Lib2.csproj
    c:\dev\Solution\Lib3\MyNamespace.Lib3.csproj



  • Figured it out!

    Lines 885-889 of https://github.com/NuGet/NuGet2/blob/2.12/src/CommandLine/Commands/ProjectFactory.cs and lines 1182-1184 of https://github.com/NuGet/NuGet.Client/blob/dev/src/NuGet.Clients/NuGet.CommandLine/Commands/ProjectFactory.cs are the key (I think).

    If IncludeReferencedProjects is true, the src folder gets built using the project name. If the actual folder containing the code isn't named the same as the project, this appears to breaks source indexing.

    So another workaround is to not use IncludeReferencedProjects. If this option is needed, it looks like you have to name your folders the same as your project.



  • Scratch that. Double checked that workaround and while it does put the code in the src folder without the project name, the source server still returns:

    SRCSRV: {path}\src{ProjectName}{file}.cs not indexed

    SRCSRV: Source server cannot retrieve the source code for file '{path}'. The system cannot find the file specified.



  • Guess it depends on the project. I removed -IncludeReferencedProjects on another project we have and that did resolve the issue. Seems to be that if the SRCSRV: {path}\src{ProjectName}{file}.cs not indexed error message contains the project name after src\ then you need -IncludeReferencedProjects. Maybe?



Inedo Website HomeSupport HomeCode of ConductForums GuideDocumentation