Inedo Community Forums Forums
    • Recent
    • Tags
    • Popular
    • Login

    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

    Scheduled Pinned Locked Moved Support
    sourceprogetsymbols
    7 Posts 1 Posters 51 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ? This user is from outside of this forum
      Guest
      last edited by

      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

      1 Reply Last reply Reply Quote 0
      • ? This user is from outside of this forum
        Guest
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • ? This user is from outside of this forum
          Guest
          last edited by

          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!

          1 Reply Last reply Reply Quote 0
          • ? This user is from outside of this forum
            Guest
            last edited by

            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

            1 Reply Last reply Reply Quote 0
            • ? This user is from outside of this forum
              Guest
              last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • ? This user is from outside of this forum
                Guest
                last edited by

                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.

                1 Reply Last reply Reply Quote 0
                • ? This user is from outside of this forum
                  Guest
                  last edited by

                  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?

                  1 Reply Last reply Reply Quote 0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  • 1 / 1
                  • First post
                    Last post
                  Inedo Website Home • Support Home • Code of Conduct • Forums Guide • Documentation