ProGet Documentation

Symbol and Source Server

Symbol and Source Server

A NuGet feed in ProGet may be configured as a Symbol/Source server compatible with debuggers such as Visual Studio and WinDbg. The following is supported by the ProGet symbol server:

Windows PDB format (C/C++, .NET)

Source server

Portable PDB format (.NET Core)

PDBs in connector packages

Accessing Symbols

When the Symbol Server is enabled, any symbols files stored in local Feed packages will be accessible via the symbol server URL:

http://«proget-server»/symbols/«Feed»

Symbol Packages

ProGet supports using NuGet symbol packages built with the -Symbols argument. These symbol packages are nothing more than a standard NuGet package with .pdb files and possibly source files included, and they have a .symbols.nupkg file extension by convention. NuGet produces two packages (one with symbols and one without) because one is intended to be pushed to NuGet.org, while the other is intended to be pushed to a symbol feed.

Because ProGet integrates symbols in all of its NuGet feeds, having two packages is not necessary and is actually counterproductive. Symbol packages only differ from "normal" packages by convention, so attempting to push both to a ProGet feed will result in a race condition - whichever package is pushed "last" will overwrite the original one.

To summarize, push only the symbol package to your ProGet feed if you intend to use the symbol server . To prevent symbols from being downloaded with the NuGet package, see the Strip symbol files from packages downloaded from this feed option on the Manage Feed page under Symbol Server settings.

Debug Into Internal NuGet Packages

To take full advantage of ProGet's symbol/source server, the published NuGet package must include symbol (pdb) files for every debuggable assembly, and the source files must be included in the /src/ folder of the package. See the NuGet documentation on building a symbol package for detailed information.

Configuring ProGet

In order for ProGet to serve symbols for a particular NuGet feed, it must be configured to do so. Visit the Manage Feed page, and ensure that the options under Symbol Server are correctly checked, while noting the URL of the feed's symbol server to be used within Visual Studio:

Symbol and Source feed

Verifying Indexed Symbols

Once a package with symbols is uploaded to the feed, browsing to the Package Details page will indicate whether symbols have been indexed and whether the package contains sources:

Package details

You can download the package and inspect it yourself to verify this using the Download Package with Symbols link (which appears if the feed is configured to strip symbols).

Configuring Visual Studio

Enable Symbol Server Support

In order to debug into NuGet package libraries, Visual Studio must be configured to use ProGet as a symbol server. Select Debug > Options... from the menu bar, then browse to Debugging > Symbols in the tree menu. Add the symbol server URL found on the Manage Feed page earlier, and specify a Symbol Cache Directory. By default Visual Studio will use %LOCALAPPDATA%\Temp\SymbolCache, but you may specify any path.

Package details
Enable Source Server Support

To configure source server support, browse to Debugging > General in the debugging options tree menu, and make sure the following settings are checked/unchecked as follows:

Enable Just My Code

Enable source server support

Additionally, you may have to uncheck:

Enable .NET Framework Source Stepping

in some cases. The settings should look like the following:

Debug settings

Testing the Configuration

A simple way to test out the configuration is to create a console application that consumes the NuGet package with symbols, write some throwaway code that you know will throw an exception, then click the Start button in Visual Studio to begin debugging:

Throw code

If everything is configured correctly, Visual Studio will attempt to load symbols locally, then query the ProGet symbol server if they cannot be found, and the exact line that throws the exception will become highlighted:

Source server code

Troubleshooting

In some cases, the symbol server will fail for any number of reasons, the most common being misconfiguration. To view the PDBs that Visual Studio has loaded, select the Debug > Windows > Modules menu option while debugging, and find the desired DLL in the list. The symbol status will appear, along with the version and path to both the DLL and the downloaded symbols.

Modules window

Whether the symbols loaded or not, you can right-click on the DLL and select "Symbol Load Information..." to view the diagnostic messages associated with the symbol server for that library.

Modules window

The hex string in the file path should also start with the GUID listed in ProGet:

Modules window Modules window
Common Errors

The most common errors (based on previous support inquiries) include:

  • Using the wrong URL, e.g. http://«proget-server»/nuget/«feed-name» instead of the correct http://«proget-server»/symbols/«feed-name»
  • Pushing both NuGet packages (with and without symbols)
  • Trying to consume symbols for connector packages (which is not supported, workaround is to pull packages locally or use a separate feed for symbols)
  • Not include source files under the /src/ directory at the root of the .nupkg file