{"id":139,"date":"2018-11-16T00:00:00","date_gmt":"2018-11-16T08:00:00","guid":{"rendered":"http:\/\/devblogs.microsoft.com\/nuget\/improved-debugging-experience-with-the-nuget-org-symbol-server-and-snupkg"},"modified":"2018-11-16T00:00:00","modified_gmt":"2018-11-16T08:00:00","slug":"improved-package-debugging-experience-with-the-nuget-org-symbol-server","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/improved-package-debugging-experience-with-the-nuget-org-symbol-server\/","title":{"rendered":"Improved package debugging experience with the NuGet.org symbol server"},"content":{"rendered":"<p>Starting today, you can publish symbol packages to the NuGet.org symbol server. With NuGet.org as a single service provider for libraries and symbols, package authors and consumers will have a streamlined publishing and consumption experience. With a single place for managing authentication and identity, you can be sure that both the package and its symbols are coming from the same author when you consume a NuGet package from NuGet.org.<\/p>\n<h2>Publish a snupkg to the NuGet.org symbol server today!<\/h2>\n<p>We have introduced a new symbol package format &#8211; <code>.snupkg<\/code>. You will need <a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/releasenotes\/vs2017-relnotes\">Visual Studio 2017 15.9<\/a> to generate <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/master\/Documentation\/diagnostics\/portable_pdb.md\">portable PDBs<\/a> that can be packaged as <code>.snupkg<\/code> for publishing to the NuGet.org symbol server.<\/p>\n<h3>Create and publish snupkg to NuGet.org<\/h3>\n<ol>\n<li>\n<p>Compile your code using <a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/releasenotes\/vs2017-relnotes\">Visual Studio 2017 15.9<\/a> to generate the portable PDBs.<\/p>\n<\/li>\n<li>\n<p>Get <a href=\"https:\/\/www.nuget.org\/downloads\">nuget.exe 4.9.0<\/a> \/ <a href=\"https:\/\/www.microsoft.com\/net\/download\/dotnet-core\/2.2\">dotnet.exe 2.1.500<\/a> or higher (Visual Studio 2017 15.9 ships with dotnet.exe 2.1.500 and msbuild).<\/p>\n<\/li>\n<li>\n<p>Create the .snupkg using pack with your tool of choice. We have added a new property <code>SymbolPackageFormat<\/code>, which must be set to <code>snupkg<\/code><\/p>\n<p><strong>using dotnet<\/strong><\/p>\n<p><code>&gt; dotnet pack MyAwesomeLib.csproj --include-symbols -p:SymbolPackageFormat=snupkg<\/code><\/p>\n<p><strong>using nuget<\/strong><\/p>\n<p><code>&gt; nuget pack MyAwesomeLib.nuspec -Symbols -SymbolPackageFormat snupkg<\/code><\/p>\n<p><strong>using msbuild<\/strong><\/p>\n<p><code>&gt; msbuild \/t:pack MyAwesomeLib.csproj \/p:IncludeSymbols=true \/p:SymbolPackageFormat=snupkg<\/code><\/p>\n<\/li>\n<li>\n<p>Push the .nupkg to NuGet.org (we will detect the .snupkg and push it for you)<\/p>\n<p><strong>using dotnet<\/strong><\/p>\n<p><code>&gt; dotnet nuget push MyAwesomeLib.1.0.0.nupkg -s https:\/\/api.nuget.org\/v3\/index.json -k ~~your API key here~~<\/code><\/p>\n<p><strong>using nuget<\/strong><\/p>\n<p><code>&gt; nuget push MyAwesomeLib.1.0.1.nupkg -Source https:\/\/api.nuget.org\/v3\/index.json -apikey ~~your API key here~~<\/code><\/p>\n<p><strong>using nuget.org upload<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/49\/2019\/05\/nuget_upload.png\" alt=\"nuget.org upload\" \/><\/p>\n<\/li>\n<li>\n<p>Once validated and indexed, the <code>.snupkg<\/code> will be available for consumption and will also be downloadable from the NuGet.org gallery.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/49\/2019\/05\/snupkg_download.png\" alt=\"snupkg published\" \/><\/p>\n<\/li>\n<\/ol>\n<blockquote>\n<p>NuGet.org symbol server only accepts the new symbol package format <code>.snupkg<\/code>. Take a look at <a href=\"https:\/\/docs.microsoft.com\/en-us\/nuget\/create-packages\/symbol-packages-snupkg#nugetorg-symbol-package-constraints\">NuGet.org symbol package constraints<\/a> for more info.<\/p>\n<\/blockquote>\n<h3>Consume snupkg from NuGet.org in Visual Studio<\/h3>\n<p>You will need <a href=\"https:\/\/docs.microsoft.com\/en-us\/visualstudio\/releasenotes\/vs2017-relnotes\">Visual Studio 2017 15.9<\/a> to consume <code>.snupkg<\/code> from NuGet.org symbol server.<\/p>\n<ol>\n<li>\n<p>In Visual Studio, open <strong>Tools<\/strong> &gt; <strong>Options<\/strong> &gt; <strong>Debugging<\/strong> &gt; <strong>Symbols<\/strong> (or <strong>Debug<\/strong> &gt; <strong>Options<\/strong> &gt; <strong>Symbols<\/strong>).<\/p>\n<\/li>\n<li>\n<p>Under <strong>Symbol file (.pdb) locations<\/strong>, add a new symbol server location by selecting the <strong>+<\/strong> symbol in the toolbar. Use the following URL <code>https:\/\/symbols.nuget.org\/download\/symbols<\/code>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/49\/2019\/05\/vs-nuget-symbol-server.png\" alt=\"VS debug options\" \/><\/p>\n<\/li>\n<\/ol>\n<h2>FAQs<\/h2>\n<ul>\n<li>\n<p><strong>Q. Can I submit a snupkg for an existing package on NuGet.org?<\/strong><br \/>\nTo upload any .snupkg to NuGet.org, the hash of the .pdb must be embedded in the .dll that is included in the matching .nupkg. If the existing .nupkg on nuget.org does not include the .pdb hash, you will need to recompile and package your .nupkg with a compiler that supports this feature (such as the one that shipped with Visual Studio 2017 15.9), and push a new version before you can submit the corresponding .snupkg.<\/p>\n<\/li>\n<li>\n<p><strong>Q. Which PDB formats are supported?<\/strong><br \/>\nCurrently, NuGet.org symbol server supports only the portable PDB format. The portable PDB format can be created and consumed for any .NET application provided that the consuming client is on .NET 4.7.1 or later. More info about Portable PDBs is available on the <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/master\/Documentation\/diagnostics\/portable_pdb.md\">.NET GitHub<\/a>.<\/p>\n<\/li>\n<li>\n<p><strong>Q. Where are the docs?<\/strong><br \/>\nHere are the docs for <a href=\"https:\/\/docs.microsoft.com\/en-us\/nuget\/create-packages\/symbol-packages-snupkg\">creating symbol packages (.snupkg)<\/a> and the corresponding <a href=\"https:\/\/docs.microsoft.com\/en-us\/nuget\/api\/symbol-package-publish-resource\">API docs<\/a>.<\/p>\n<\/li>\n<\/ul>\n<h2>We want to hear your feedback!<\/h2>\n<p>We want NuGet to meet the evolving needs of our community. Use the <a href=\"https:\/\/github.com\/NuGet\/Home\/issues\/6104\">GitHub issue tracking this experience<\/a> to provide feedback, or ask questions. You can also reach out me on twitter &#8211; mention <a href=\"https:\/\/twitter.com\/karann9\">@karann9<\/a> and <a href=\"https:\/\/twitter.com\/nuget\">@nuget<\/a> in your tweets.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Starting today, you can publish symbol packages to the NuGet.org symbol server. With NuGet.org as a single service provider for libraries and symbols, package authors and consumers will have a streamlined publishing and consumption experience. With a single place for managing authentication and identity, you can be sure that both the package and its symbols [&hellip;]<\/p>\n","protected":false},"author":795,"featured_media":56237,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[7196,7933,7874],"tags":[],"class_list":["post-139","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debugging","category-feature-announcement","category-nuget"],"acf":[],"blog_post_summary":"<p>Starting today, you can publish symbol packages to the NuGet.org symbol server. With NuGet.org as a single service provider for libraries and symbols, package authors and consumers will have a streamlined publishing and consumption experience. With a single place for managing authentication and identity, you can be sure that both the package and its symbols [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/139","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/795"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=139"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/139\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/56237"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=139"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=139"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=139"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}