Blog | SymbolSource.org - Your source for debugging symbols... and sources. http://www.symbolsource.org/ The latest news from http://www.symbolsource.org/ More on SymbolSource and related technologies Sun, 11 Dec 2011 16:32:39 +0200 http://www.symbolsource.org/Public/Blog/View/34 <p>In this short post I would like to invite you to my <a href="http://tripleemcoder.wordpress.com">personal blog</a>, where I will be posting more behind-the-scenes information about SymbolSource, that does not really fit here. It will also be a place for general .NET and related technology posts, basically stuff that interests me personally.</p> <p>So far, I've written these pieces:</p> <ul> <li><a href="http://tripleemcoder.wordpress.com/2011/11/13/embedding-an-asp-net-application-in-a-unit-test-part-1/">Embedding an ASP .NET application in a unit test (part 1)</a></li> <li><a href="http://tripleemcoder.wordpress.com/2011/11/14/embedding-an-asp-net-application-in-a-unit-test-part-2/">Embedding an ASP .NET application in a unit test (part 2)</a></li> <li><a href="http://tripleemcoder.wordpress.com/2011/12/10/writing-an-automatic-debugger-in-15-minutes-yes-a-debugger/">Writing an automatic debugger in 15 minutes (yes, a debugger!)</a></li> <li><a href="http://tripleemcoder.wordpress.com/2011/12/11/accessing-stack-traces-with-mdbgengine-and-padre/">Accessing stack traces with MDbgEngine and PADRE</a></li> </ul> <p>I hope you'll find my writing interesting and useful, and won't be discouraged by my non-nativeness in English.</p> http://www.symbolsource.org/Public/Blog/View/34 Updated NuGet Package Explorer Plugin Tue, 15 Nov 2011 17:11:20 +0200 http://www.symbolsource.org/Public/Blog/View/33 <p>We've updated our <a href="http://npe.codeplex.com">NuGet Package Explorer</a> plugin. It is built against the <a href="http://ci.nuget.org:8080/viewLog.html?buildTypeId=bt27&amp;buildId=lastSuccessful">unreleased version 2.5</a>, but we really encourage you to try it out, because it is already perfectly stable at this point, and has some nice new features. From now on, we will only support 2.5+, because of its incredibly cool plugin manager that downloads plugins from a <a href="http://www.myget.org/F/npe">NuGet feed</a>.</p> <p>In the new version of our plugin we added two new warnings about mismatches between the package file name and its contents: it should end with <code>.symbols.nupkg</code> if and only if the package contains symbols and sources.</p> <p>We also have a completely new feature that allows you to verify the contents of a package against any symbol server (SymbolSource by default). It will tell you if your submission was correct and if it is already available to end-users.</p> <p>As always, screenshots tell the story best. The UI is hideous, we know, but as I've written before, the plugin is open source, so you are free to improve it: <a href="http://github.com/SymbolSource/Integration.NuGet">http://github.com/SymbolSource/Integration.NuGet</a>. Thanks :)</p> <p><img src="/Content/Public/Blog/33/Menu.png" alt="Accessing the new symbol status feature" /></p> <p><img src="/Content/Public/Blog/33/Check.png" alt="Accessing the new symbol status feature" /></p> http://www.symbolsource.org/Public/Blog/View/33 Using SymbolSource as an OpenWrap repository Sat, 08 Oct 2011 12:17:55 +0200 http://www.symbolsource.org/Public/Blog/View/32 <p><a href="http://www.openwrap.org"><img src="http://www.openwrap.org/logo-small.png" alt="OpenWrap" /></a></p> <p>We have some very exciting news to announce today. The OpenWrap package gateway has been extended and now supports the entire protocol. Which means that <strong>SymbolSource now offers regular OpenWrap package repositories</strong>. You can take advantage of SymbolSource and its flexible permission system to store and share wraps, symbols and sources.</p> <h2>Preparing OpenWrap</h2> <ol> <li><p>OpenWrap 2.0.2 is required to use our repositories. You can skip this entire section if you already have it.</p></li> <li><p>Make sure you have OpenWrap 1.0.2 before upgrading, otherwise bad things may happen:</p> <p><code>o update-wrap openwrap -system</code></p></li> <li><p>Add the official beta repository:</p> <p><code>o add-remote -name beta -href http://wraps.openwrap.org/beta</code></p></li> <li><p>Update OpenWrap in the system repository (or skip <code>-system</code> if you're running from a test project):</p> <p><code>o update-wrap openwrap -system</code></p></li> </ol> <h2>Configuring repositories</h2> <p>It might be good idea to start up <a href="http://www.fiddler2.com">Fiddler</a> at this point to verify that o.exe is contacting remote repositories. It should, but this is all still beta stuff. Also, you will need an account on SymbolSource to complete some of the steps, so go ahead and <a href="/Public/Account/Register">register</a> now, if you don't have one yet. From now on <code>%login%</code> will be, you guessed it, your login, and <code>%key%</code> will be your <a href="/Public/Home/VisualStudio">Visual Studio access key</a>.</p> <ol> <li><p>Add the public OpenWrap repository:</p> <p><code>o add-remote -name public -href http://openwrap.gw.symbolsource.org/Public/OpenWrap</code></p></li> <li><p>Go to <a href="/Public/Metadata">Metadata</a> and create a private repository for upload testing. 'OpenWrap' is a nice name. Also make note of our Visual Studio key while you're there, it will be used as the password for authentication.</p></li> <li><p>Register the private repository with your install of OpenWrap:</p> <p><code>o add-remote -name private -href http://openwrap.gw.symbolsource.org/Public/Private.%login%.OpenWrap -user %login% -pwd %key%</code></p></li> <li><p>Try listing packages (<code>o.exe</code> should access <code>index.wraplist</code> from both locations, plus <code>wraps.openwrap.org</code>):</p> <p><code>o list-wrap -remote</code></p></li> <li><p>If everything goes fine, you'll see a package from the public repository:</p> <p><code>- symbolsource-repositorytest (available: 0.0.1.84582059)</code></p></li> </ol> <h2>Using the repositories</h2> <ol> <li><p>Go to a new directory and initialize a new wrap:</p> <p><code>o init-wrap</code></p></li> <li><p>Now you can add the test library from SymbolSource:</p> <p><code>o add-wrap symbolsource-repositorytest</code></p></li> </ol> <h2>Uploading your packages</h2> <ol> <li><p>Take a package from somewhere or just build your test wrap:</p> <p><code>o build-wrap</code></p></li> <li><p>Publish package to SymbolSource:</p> <p><code>o publish-wrap -path test-1.0.wrap -remote private</code></p></li> <li><p>Verify that the package was uploaded:</p> <p><code>o list-wrap -remote</code></p></li> </ol> <h2>Symbol package support</h2> <p>With a SymbolSource repository for OpenWrap you also get the entire on-demand debugging experience. Just make sure, before uploading, that your package contains PDB files in <code>bin-*</code> folders and all the sources you used to build the package from in an <code>src</code> folder - you will need to add those files manually (with a ZIP tool) for now. The package will be then processed on the SymbolSource servers. The version for download will be stripped from these files, but they will be available on-demand for Visual Studio. Once OpenWrap gets flavor support, these files will be included automatically during <code>o build-wrap</code>.</p> <h2>Hosting official packages</h2> <p>If you wish to maintain official packages for your project in the <a href="/Public/Metadata/OpenWrap">main OpenWrap repository</a> at SymbolSource, please let us know through the usual channels (<a href="http://groups.google.com/group/symbolsource">Google Group</a>, <a href="http://twitter.com/TripleEmcoder">Twitter</a>) and we'll assign the required permissions to your account ASAP.</p> http://www.symbolsource.org/Public/Blog/View/32 Online source code navigation Wed, 05 Oct 2011 16:30:27 +0200 http://www.symbolsource.org/Public/Blog/View/31 <p>There is a whole range of exciting possibilities arrising from having a catalogued repository of eleased code like SymbolSource. We have been experimenting with various ideas for some time now. Today we would like to announce the first step in providing a dynamic, relfector-like view of all source code on SymbolSource. <!--break--></p> <h2>Source element tree</h2> <p>To see the first piece of new functionality, have a look at <a href="/Public/Metadata/Default/Project/Html-Agility-Pack/1.4.0-Stable/Release/All/HtmlAgilityPack">HtmlAgilityPack.dll</a>. Here you can see all of the code elements (namespaces, classes, methods etc.) displayed in a hierarchy. Clicking on any element will load the file where it was declared. If an element spans multiple files (like a namespace), you'll be asked to pick a file from a popup list.</p> <p><a href="/Public/Metadata/Default/Project/Html-Agility-Pack/1.4.0-Stable/Release/All/HtmlAgilityPack"><img src="/Content/Public/Blog/31/Introduction.png" alt="Browsing the structure of HtmlAgilityPack" /></a></p> <h2>What's next</h2> <p>There are a couple of things we'd like to do at some point, some reflector-like, but also many only achievable with SymbolSource:</p> <ul> <li>have the tree jump and highlight chosen elements in the source file view,</li> <li>make actual source fragments (names of types, methods, etc.) clickable,</li> <li>display help popups based on XML comments,</li> <li>generate lists of changes between project releases,</li> <li>calculate code metrics,</li> <li>visualize project dependencies, both explicit and implicit.</li> </ul> <p>As always, we'll be glad to get your input! Share your thought on our <a href="http://groups.google.com/group/symbolsource">Google Group</a>.</p> http://www.symbolsource.org/Public/Blog/View/31 Package validation in NuGet Package Explorer Wed, 07 Sep 2011 09:02:16 +0200 http://www.symbolsource.org/Public/Blog/View/30 <p>Creating a symbol package can be challenging the first time, especially when you're trying to do it manually or in your own build script, without using the <code>nuget.exe pack -symbols</code> command. Fortunately <a href="http://npe.codeplex.com/">NuGet Package Explorer</a> 2.0 has a great new feature: package analysis. It runs various rules to verify package correctness and best practices. These rules can also be provided through plugins, so we wrote our own to provide validation rules for symbol packages.</p> <!--break--> <p><a href="/Content/Public/Blog/30/Screenshot-Full.png"><img src="/Content/Public/Blog/30/Screenshot.png" alt="NuGet Package Explorer with the SymbolSource plugin" /></a></p> <h2>Features</h2> <p>The current release contains a DLL and PDB viewer that displays binary and symbol hashes, and the list of source files that have been compiled in. There is also a number of validation rules that produce the following:</p> <ul> <li>(warning) Assembly compiled without symbol support</li> <li>(warning) Missing symbol file for assembly</li> <li>(warning) Unnecessary symbol file for assembly</li> <li>(warning) Orphan symbol file found</li> <li>(error) Mismatched assembly and symbol hashes</li> <li>(error) Missing source file</li> </ul> <h2>Download</h2> <p><a href="/Content/Public/Blog/30/SymbolSource.Integration.NuGet.PackageExplorer.zip">SymbolSource.Integration.NuGet.PackageExplorer.dll</a></p> <h2>Install</h2> <p>You can use one of two ways to install a plugin in NuGet Package Explorer:</p> <ul> <li>Go to Tools -> Plugin Manager -> Add and select the DLL.</li> <li>Copy the DLL to <code>%LOCALAPPDATA%\NuGet\PackageExplorerPlugins</code>.</li> </ul> <p>Both methods do the exact same thing.</p> <h2>Source</h2> <p>We are releasing this plugin and one of our internal libraries that it requires as open source. Have a look at GitHub if you're interested in how the plugin was implemented or if you would like to contribute to this project:</p> <ul> <li><a href="http://github.com/SymbolSource/Integration.NuGet">SymbolSource.Integration.NuGet</a></li> <li><a href="http://github.com/SymbolSource/Processing">SymbolSource.Processing</a></li> </ul> http://www.symbolsource.org/Public/Blog/View/30 Announcing private symbol and source repositories Thu, 25 Aug 2011 15:31:33 +0200 http://www.symbolsource.org/Public/Blog/View/29 <p>Today we are proud to present the long waited support for private symbol and source repositories. It will allow you to benefit from the ease of debugging that SymbolSource provides without publicly disclosing any part of you code. Symbols and sources will only be fetched through the authenticated Visual Studio URLs and only after verifying permissions defined on the SymbolSource website. <!--break--> For now support for private storage comes in two flavors.</p> <h2>Private repositories</h2> <p>These are additional repositories that you can create automatically during NuGet package upload. Just push to an URL like this:</p> <p><code>http://nuget.gw.symbolsource.org/Public/Private.&lt;login&gt;.&lt;name&gt;</code></p> <p>You can use whatever <code>&lt;name&gt;</code> that you like, but <code>&lt;login&gt;</code> must match your login on the site, which will be an ugly hash until you associate your NuGet API key on the <a href="/Public/Account/Authentication">Authentication</a> page.</p> <p>Read access will only be possible through this debugging URL:</p> <p><code>http://srv.symbolsource.org/pdb/Public/&lt;login&gt;/&lt;hash&gt;</code></p> <p>You can also grant other users access to your symbols and sources - as long as you know their login registered with this site. Once you create a private repository permissions can be defined through the <a href="/Public/Metadata">Metadata</a> page.</p> <h2>Separate companies</h2> <p>We are also launching an open beta of hosted SymbolSource instances. These instances are internally called companies, and the <code>Public</code> part of URLs you see all over our service is an example of such an entity.</p> <p>By registering a new company you will get an entirely separate instance of SymbolSource at <code>http://www.symbolsource.org/&lt;company&gt;</code>, which will allow you to define your own set of repositories and users. In the future this will also allow you to integrate authentication and authorization with an external store like Active Directory. For now, you will be able to manage permissions through the administration panel, which exposes the entire flexibility of SymbolSource permissions. Read and write access can be granted on any level of the symbol/source hierarchy: company, repository, project or version.</p> <p>With a separate company you'll be able to push to any URLs like the following:</p> <p><code>http://nuget.gw.symbolsource.org/&lt;company&gt;/&lt;repository&gt;</code>.</p> <p>And Visual Studio will only be able to download symbols and sources with this URL:</p> <p><code>http://srv.symbolsource.org/pdb/&lt;company&gt;/&lt;login&gt;/&lt;hash&gt;</code></p> <p>Because we would like to make this feature as robust and easy to use as possible, for now we will personally oversee the provisioning of every company account. Please let us know through any of the usual channels (Google Groups, Twitter or e-mail) if you'd like to take part in the beta program.</p> http://www.symbolsource.org/Public/Blog/View/29 SymbolSource health monitoring Tue, 26 Jul 2011 19:30:49 +0200 http://www.symbolsource.org/Public/Blog/View/28 <p>Those of you who follow me on Twitter (<a href="http://www.twitter.com/TripleEmcoder">@TripleEmcoder</a>) will already now this, but I'd like to share a few more details in this post: we've implemented an automated end-to-end test and scheduled it to run every hour. If anything goes wrong we'll be able to detect and fix it much faster than before.</p> <!--break--> <p>The scenario is as follows:</p> <ol> <li>Find the most recent version of the test package on nuget.org.</li> <li>Create a simple C# project with a few files.</li> <li>Modify one of those files with a comment stating the next version.</li> <li>Use nuget.exe pack command to compile the project and build a package (with -symbols to generate a package for SymbolSource).</li> <li>Upload both packages to nuget.org and symbolsource.org, accordingly.</li> <li>Download and extract the package from nuget.org into a separate folder.</li> <li>Run <a href="http://msdn.microsoft.com/en-us/library/ff551063(v=vs.85).aspx">Debugging Tools for Windows</a> (this uses the same components as Visual Studio) to make sure that symbols for the package can be downloaded from symbolsource.org.</li> <li>Verify that the downloaded PDB file contains refernces to all source files used to build the test library, that they can be downloaded from SymbolSource and that their content has not been corrupted in any way.</li> </ol> <p>There is an interesting thing to note by anyone who uses symbol server support in <a href="http://msdn.microsoft.com/en-us/library/ff551063(v=vs.85).aspx">Debugging Tools for Windows</a> - cdb.exe, symchk.exe or symsrv.dll. If you try to use any of those while running as a service (like we did, running the test scenario in CruiseControl .NET), web requests will not be made using the regular WinINET stack, but WinHTTP. There is an interesting catch with the latter one, having a default bogus HTTP proxy configured. You need to either reconfigure WinHTTP to use your own proxy or disable proxying in the registry. This equals to setting the following keys:</p> <pre> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Symbol Server] "NoInternetProxy"=dword:00000001 [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Symbol Server] "NoInternetProxy"=dword:00000001 [HKEY_CURRENT_USER\SOFTWARE\Microsoft\Symbol Server] "NoInternetProxy"=dword:00000001 [HKEY_CURRENT_USER\SOFTWARE\Wow6432Node\Microsoft\Symbol Server] "NoInternetProxy"=dword:00000001 </pre> <p>To experience this behavior in your own account, set this environment variable:</p> <pre> SET DBGHELP_WINHTTP=AnythingOtherThanEmpty </pre> <p>You can test this with the commands described in my previous post on <a href="http://www.symbolsource.org/Public/Blog/View/26">Veryfing symbols after upload to SymbolSource</a>.</p> <p>For more info on the WinHTTP issue check out these links:</p> <ul> <li><a href="http://www.ms-news.net/f3682/using-symbol-server-symsrv-from-local-system-account-1831202.html">Using symbol server / symsrv from local system account</a> - a discussion on microsoft.public.windbg (sadly I couldn't find archives of this newsgroup anywhere else that would not strip out important parts of messages)</li> <li><a href="http://www.facebook.com/note.php?note_id=10150118296038405">How does cdb access the Microsoft Symbol Server from within a Windows Service</a> - a <em>Facebook</em> note that is actually incredibly technical and useful (I was truly shocked).</li> </ul> http://www.symbolsource.org/Public/Blog/View/28 Deleting packages from SymbolSource Mon, 27 Jun 2011 22:00:10 +0200 http://www.symbolsource.org/Public/Blog/View/27 <p><em>Before you get discouraged by this long (although we feel needed) introduction, please know that we are introducing a feature to delete packages from SymbolSource. Well, sort of.</em></p> <p>When we were initially designing SymbolSource, we didn't believe there was much need for deleting symbols and sources once they were published. The reasoning behind this is that when you build up the expectation that symbols of all the libraries that you use can be easily loaded on-demand and that it's possible to likewise step into all of their sources, everything should be done to avoid breaking that expectation. <strong>It's a matter of trust. If you see a project name mentioned on the site, you should expect all its symbols to be available.</strong> <!--break--> Symbols are quite different than binaries. You may want to have binaries of various versions of your library available for download, and you may want to remove a version altogether, e.g. when if you discover a critical problem with it. But that's only valid for the distribution side of things: be it your website, NuGet or any other channel. By the time that you remove your package from distribution it might already be referenced in countless projects and there is no way to force users to upgrade from the flawed version. Those projects at some point will surely benefit from a symbol/source server. Leaving symbols behind does not cause any harm, it can only be beneficial.</p> <p>One of the possible reasons to remove a package is to keep versions in sync between SymbolSource.org and a repository like NuGet.org. Imagine that you uploaded a binary package, then discovered and fixed a problem with it and reuploaded it to the repository without changing its version number. There would be nothing wrong with this approach, if the new package contained the exact same binaries - perhaps just more or less of them. There is nothing at NuGet.org, however, that prevents you from uploading completely different binaries for the same package. <strong>Also note that good practice of versioning (you might want to take a look at <a href="http://www.semver.org">http://www.semver.org</a> for an example) dictates that once you publish a package, you should never ever make modify it - instead bump up the version number and upload again.</strong> This has been always supported at SymbolSource.org.</p> <p>Nevertheless, many of our users requested the feature to delete packages. And there are of course situations when this is appropriate: you might have only uploaded to SymbolSource for testing, so you are sure that the binaries did not leak into the world, or you might really need the version number to stay at some value. That's why from now on you can use <code>nuget.exe</code> to delete packages from SymbolSource.org the same way you can from NuGet.org:</p> <p><code>nuget.exe delete MyLibrary 1.0 -source http://nuget.gw.symbolsource.org/Public/NuGet</code></p> <p><strong>But since we still believe this is a <em>bad thing to do</em>, a package deleted this way will only really be hidden. It will not be shown anywhere on the site, and you will be able to upload again using the same version number, but symbols will still be served for the hidden package.</strong> As its maintainer you will be the only person to see its metadate on the site and you will be able to restore to it to a fully available state, provided that the same version has not been uploaded in the meantime.</p> <p>A way to pernamently delete all resources that came with a package will be also soon made available.</p> <p>Please let us know your thoughts on this matter.</p> http://www.symbolsource.org/Public/Blog/View/27 Veryfing symbols after upload to SymbolSource Sat, 14 May 2011 22:58:55 +0200 http://www.symbolsource.org/Public/Blog/View/26 <p>Although with the release of NuGet integration uploading symbols and sources to SymbolSource became a matter of simply invoking one command, it is still possible to mix up packages and end up uploading binaries and symbols that do not match. SymbolSource will of course verify the integrity of an incoming package, but there is no way for it to stop you from uploading a package to nuget.org with different binaries.</p> <p>This post will show you how to quickly verify that symbols can be downloaded for a given set of binaries.</p> <!--break--> <script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushPlain.js"></script> <p>You will need to set up a few things first:</p> <ol> <li><p><a href="http://go.microsoft.com/fwlink/?LinkID=191420">Download Debugging Tools from the Windows SDK</a> - run the SDK web installer and select <em>Debugging Tools for Windows</em> under <em>Common Utilities</em> to download and install just the bits that you will need.</p></li> <li><p>Prepare two directories - the first one with all the binaries that you will be verifying (e.g. <code>Z:\Binaries</code>) and a second one as a cache for downloaded symbols (e.g. <code>Z:\Symbols</code>).</p> <p><em>The binary directory will be searched recursively, so you can extract many packages into separate subdirectories. <strong>Make sure there are no PDB files present.</strong></em></p></li> <li><p>Open a command prompt and add Debuggin Tools to your PATH variable to make things easier:</p> <p><code>set PATH=%PATH%;C:\Program Files\Debugging Tools for Windows (x64)</code></p></li> </ol> <p>Now you can do the actual verification:</p> <ol> <li> Run <code>symchk.exe</code> on the entire binary directory: <pre class="brush: plain; wrap-lines: false"> symchk.exe Z:\Binaries /su "SRV*Z:\Symbols*http://srv.symbolsource.org/pdb/Public" /oi /op /r </pre> </li> <li> If everything goes well, this will result in output similar to the following: <pre class="brush: plain; wrap-lines: false"> SYMCHK: Orchard.Core.dll PASSED - PDB: Orchard.Core.pdb DBG: &lt;N/A> SYMCHK: Orchard.exe PASSED - PDB: Orchard.pdb DBG: &lt;N/A> SYMCHK: Orchard.Framework.dll PASSED - PDB: Orchard.Framework.pdb DBG: &lt;N/A> SYMCHK: Orchard.WarmupStarter.dll PASSED - PDB: Orchard.WarmupStarter.pdb DBG: &lt;N/A> SYMCHK: FAILED files = 0 SYMCHK: PASSED + IGNORED files = 4 </pre> </li> <li> Most often you will see these two types of errors: <pre class="brush: plain; wrap-lines: false"> SYMCHK: FluentNHibernate.dll FAILED - FluentNHibernate.pdb mismatched or not found SYMCHK: FluentNHibernate.xml IGNORED - Not an executable file (file does not have a DOS header) </pre> </li> <li> When you do come across a failure, it's worth investigating with the following command: <pre class="brush: plain; wrap-lines: false"> symchk.exe Z:\Binaries\FluentNHibernate.dll /su "SRV*Z:\Symbols*http://srv.symbolsource.org/pdb/Public" /v </pre> </li> <li> In verbose mode <code>symchk.exe</code> will output a lot of information about the symbol loading process, among which will be lines like the following: <pre class="brush: plain; wrap-lines: false"> DBGHELP: Symbol Search Path: SRV*Z:\Symbols*http://srv.symbolsource.org/pdb/Public DBGHELP: No header for Z:\Binaries\FluentNHibernate.dll. Searching for image on disk DBGHELP: Z:\Binaries\FluentNHibernate.dll - OK SYMSRV: Z:\Symbols\FluentNHibernate.pdb\01D37CC489F649B89A1122C482A574CB1\FluentNHibernate.pdb not found SYMSRV: http://srv.symbolsource.org/pdb/Public/FluentNHibernate.pdb/01D37CC489F649B89A1122C482A574CB1/FluentNHibernate.pdb not found </pre> This shows clearly that a PDB for the given DLL wasn't found on SymbolSource. </li> </ol> <h3>A quick reference to symchk.exe options</h3> <p>The meaning of the symchk.exe switches that were used in the examples is the following:</p> <table> <thead><tr><th>Switch</th><th>meaning</th></tr></thead> <tbody> <tr><td>/su</td><td>Search the following symbol path and always update.</td></tr> <tr><td>/r</td><td>Scan the directory recursively for binaries.</td></tr> <tr><td>/oi</td><td>Additionally list files that were ignored.</td></tr> <tr><td>/op</td><td>Additionally list files that passed verification.</td></tr> <tr><td>/op</td><td>Verbose mode. Inform about every action taken.</td></tr> </tbody> </table> <h3>Ideas for improvements</h3> <p>If you have any ideas how this process could be improved, please share them with us. One possibility is to wrap <code>symcheck.exe</code> and <code>nuget.exe</code> into a script that would just take a package name and version and output a yes/no result. Perhaps there are other ways?</p> http://www.symbolsource.org/Public/Blog/View/26 Set up your own NuGet gallery with SymbolSource Fri, 22 Apr 2011 14:36:28 +0200 http://www.symbolsource.org/Public/Blog/View/25 <p>So far there have mostly been instructions on creating local or remote-but-read-only NuGet feeds. You can read about it in a few places, like these:</p> <ul> <li>NuGet documentation - <a href="http://nuget.codeplex.com/wikipage?title=Hosting%20Your%20Own%20Local%20and%20Remote%20NuPack%20Feeds">Hosting Your Own NuGet Feeds</a></li> <li>Phil Haack's blog - <a href="http://haacked.com/archive/2011/03/31/hosting-simple-nuget-package-feed.aspx">Hosting a Simple “Read-Only” NuGet Package Feed on the Web</a></li> </ul> <p>This method, although very simple, unfortunately has a big drawback: you can't publish packages with <code>nuget.exe</code>, so none of the new SymbolSource integration goodness will be available to you.</p> <p>But since the sources of all components that drive the NuGet website and package feed can be downloaded from Codeplex, you can set up the exact same experience with a separate, private data store. <!--break--> Before we dive into the 8 step instruction that follows, let's establish our goal. Imagine for a moment that you work at the same company that I do, which is called <strong>Caliper</strong>, and that we have a server called <strong>Polaris</strong>. At the end of step 8 you should be able work with internal NuGet packages the same way you do with with regular ones:</p> <ul> <li><code>nuget.exe list -source http://polaris/nuget-server/FeedService.svc</code></li> <li><code>nuget.exe push SecretLibrary.0.1.nupkg 8cd3ad95-19a3-47d3-81af-090280077f24 -source http://polaris/nuget-server</code></li> <li><code>nuget.exe push SecretLibrary.0.1.symbols.nupkg 8cd3ad95-19a3-47d3-81af-090280077f24 -source http://nuget.gw.symbolsource.org/Caliper/NuGet</code></li> </ul> <p>Of course, you'll be also able to use our clone of the <a href="http://nuget.org">nuget.org</a> site and install and debug packages right from Visual Studio.</p> <p>Interested? Then let's get going.</p> <h3>Step 1: Getting the sources</h3> <p>There are a few repositories that you will first need to clone with Mercurial:</p> <ol> <li><p><a href="http://galleryserver.codeplex.com"><strong>GalleryServer</strong></a> (<a href="https://hg01.codeplex.com/galleryserver">https://hg01.codeplex.com/galleryserver</a>) - this is a backend application containing the package feed - both <code>nuget.exe</code> and the frontend site use it to list, download and publish packages.</p></li> <li><p><a href="http://orchardgallery.codeplex.com"><strong>Orchard.Gallery module</strong></a> (<a href="https://hg01.codeplex.com/orchardgallery">https://hg01.codeplex.com/orchardgallery</a>) - this is an Orchard module that runs the frontend sites - <a href="http://nuget.org">nuget.org</a> (with Packages) and <a href="http://orchardproject.net/gallery">orchardproject.net/gallery</a> (with Modules and Themes).</p></li> <li><p><a href="http://www.orchardproject.net"><strong>Orchard</strong></a> (<a href="https://hg01.codeplex.com/orchard">https://hg01.codeplex.com/orchard</a>) - unless you've been on some exotic trip for the past few months (in which case I envy you a lot), you must have heard about Orchard - it's an extensible CMS platform built in .NET, and we'll need it to run the <code>Orchard.Gallery</code> module.</p></li> <li><p><strong>OrchardGallery theme</strong> (<a href="https://bitbucket.org/kevinkuebler/orchard-gallery-theme">https://bitbucket.org/kevinkuebler/orchard-gallery-theme</a>) - this is the <a href="http://orchardproject.net/gallery">orchardproject.net/gallery</a> theme, but it's also required for a NuGet gallery.</p></li> <li><p><strong>NugetGallery theme</strong> (<a href="https://bitbucket.org/bradmi/nuget-gallery-theme">https://bitbucket.org/bradmi/nuget-gallery-theme</a>) - this is the <a href="http://nuget.org">nuget.org</a> theme built on top of the <code>OrchardGallery</code> theme.</p></li> </ol> <h3>Step 2: Building projects and preparing a site structure</h3> <p>The next step is to build the downloaded sources, but before you do that you need to switch <code>Orchard</code> to the correct revision. This is taken from the <code>Readme.txt</code> file of the <code>Orchard.Gallery</code> module:</p> <blockquote> <p><em>The Orchard.Gallery module is currently being developed against the 1.x branch of the Orchard repository, changeset number: 4406 (7caba1cd1dcd).</em></p> </blockquote> <p>Being new to Mercurial I had some trouble finding the way to do this, so if you are using TortoiseHg, I suggest having a look at the <code>Update...</code> context menu item. Once you switch to revision 4406 it should look like this:</p> <p><img src="/Content/Public/Blog/25/00-UpdateTo4406.png" alt="Switching to revision 4406" /></p> <p>To build the necessary components:</p> <ul> <li>Run <code>ClickToBuild.bat</code> in <code>GalleryServer</code>.</li> <li>Run <code>ClickToBuild.cmd</code> in <code>Orchard</code>.</li> <li>That's it, all the other required modules and themes will be built automatically at run-time by Orchard.</li> </ul> <h3>Step 3: Configure IIS to run Orchard</h3> <p>The actual web application that you will be running is in <code>src\Orchard.Web</code>. I named it <code>nuget-gallery</code> and placed it in <code>C:\WebSites\nuget-gallery</code>, so that's what you'll see on the screenshots, but the naming is all up to you.</p> <p>Before going further, modify <code>Web.config</code> to run <code>Orchard</code> under full trust. Change <code>&lt;trust level="Medium" originUrl="" /&gt;</code> to <code>&lt;trust level="Full" originUrl="" /&gt;</code>. This is required by the <code>Orchard.Gallery</code> module.</p> <p>Now you can run IIS Manager and configure the web application. Right click <code>Default Web Site</code> and select <code>Add Application...</code>.</p> <p><a href="/Content/Public/Blog/25/01-IisManager-Full.png"><img src="/Content/Public/Blog/25/01-IisManager.png" alt="IIS Manager" /></a></p> <p>Be sure to select an application pool configured to use ASP.NET 4.0.</p> <p><img src="/Content/Public/Blog/25/02-IisApplication.png" alt="Adding the nuget-gallery application" /></p> <h3>Step 4: Run the Orchard site and install required modules</h3> <p>At this point you should be able to access the Orchard site. In my case this was at <code>http://polaris/nuget-gallery</code>. During the first run you can configure the name of you site (I went with <code>Caliper NuGet Gallery</code>, since that's the name of our company) and set a password for the <code>admin</code> user (at least 7 characters). For now I suggest using the default <code>SQL Server Compact Edition</code> option to save on additional work.</p> <p>Now go to the <code>Dashboard</code>, pick <code>Modules</code> in the side menu and install the following modules (order is important because of compile-time dependencies):</p> <ol> <li>Profile</li> <li>Taxonomies</li> <li>Voting</li> <li>Contrib.Reviews</li> </ol> <p>After that you can add modules and themes downloaded earlier.</p> <ul> <li>Copy the <code>Orchard.Gallery</code> module to <code>C:\WebSites\nuget-gallery\Modules</code>. Note that the name of a module folder is important.</li> <li>Copy <code>OrchardGallery</code> and <code>NugetGallery</code> themes to <code>C:\WebSites\nuget-gallery\Themes</code>. Names of theme folders are also significant.</li> </ul> <p>Now you can go back to the <code>Dashboard</code>, this time picking <code>Features</code>, and enable <code>Orchard.Gallery</code>. This will also enable all dependencies.</p> <h3>Step 5: Configure Orchard and Orchard.Gallery</h3> <p>The next step is to go to <code>Taxonomies</code> and decide if you want to host NuGet packages only or also support Orchard modules and themes. We build Orchard applications so I just added a Packages entry to have all three.</p> <p><a href="/Content/Public/Blog/25/03-OrchardTaxonomy-Full.png"><img src="/Content/Public/Blog/25/03-OrchardTaxonomy.png" alt="Configuring the package taxonomy" /></a></p> <p>It's almost time to set up the backend now, so have a look at <code>Settings</code> in the <code>Dashboard</code>.</p> <p><img src="/Content/Public/Blog/25/04-OrchardSettings.png" alt="Orchard settings for a gallery site" /></p> <p>First of all you might want to enable user registration or perhaps even require e-mail verification. If you do enable the latter, be sure to configure SMTP settings that are just below where I clipped the screenshot.</p> <p>Next, in <code>Gallery Settings</code> you need to configure the location of the backend <code>GalleryServer</code> application. I decided to host it on the same server under <code>/nuget-server</code>.</p> <p><strong>Note that you won't be able to save settings unless you fill out the <code>User To Report Abuse To</code> field. Additionally, this needs to be a different user than <code>admin</code> - you will need to create one yourself.</strong></p> <h3>Step 6: Configure GalleryServer</h3> <p><code>GalleryServer</code> also uses <code>SQL Server Compact Edition</code> and creates a database on-the-fly like <code>Orchard</code>, but since it uses Entity Framework (whereas <code>Orchard</code> relies on NHibernate) and a crucial assembly - <code>System.Data.SqlServerCe.Entity.dll</code> - is not present anywhere in the source tree, you will need to either install <a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=033cfb76-5382-44fb-bc7e-b3c8174832e2">SQL Server Compact 4</a> on the server or get the assembly elsewhere and copy it to <code>bin</code>.</p> <p>Next configure the site in IIS. In my case this is <code>/nuget-server</code> pointing to <code>C:\WebSite\nuget-server</code>, which is a copy of the entire <code>GalleryServer</code> repository.</p> <p>Because <code>GalleryServer</code> relies on the <code>Orchard.Gallery</code> module for authentication and authorization, you also need to modify <code>ApplicationSettings.config</code>. In my setup the relevant settings are as follows, the rest is left an modified:</p> <script type="text/javascript" src="http://alexgorbatchev.com/pub/sh/current/scripts/shBrushXml.js"></script> <pre class="brush: xml; wrap-lines: false"> <add key="FrontEndWebSiteRoot" value="http://polaris"></add> <add key="ValidatePackageKeyUri" value="nuget-gallery/PackageAuthentication/ValidatePackageKey"></add> <add key="AuthorizePackageIdsUri" value="nuget-gallery/PackageAuthentication/AuthorizePackageIds"></add> <add key="AuthorizeRatingsUri" value="nuget-gallery/Ratings/AuthorizeUpdate"></add> <add key="ReportAbuseUriTemplate" value="nuget-gallery/Package/ReportAbuse/{PackageId}/{PackageVersion}"></add> <add key="GalleryDetailsUriTemplate" value="nuget-gallery/List/{PackageTypeSlug}/{PackageId}/{PackageVersion}"></add> <add key="GalleryPackageSlug" value ="Packages"></add> <add key="GalleryModuleSlug" value="Modules"></add> <add key="GalleryThemeSlug" value="Themes"></add> </pre> <p>Unfortunately, <code>FrontEndWebSiteRoot</code> can only contain the hostname, so you need to repeat the entire path in each setting.</p> <h3>Step 7: Test the setup with nuget.exe and the frontend website</h3> <p>Now you can finally see if things are really working. As a smoke test, first try getting the list of packages (which will obviously be empty, but shouldn't return any errors):</p> <p><code>nuget.exe list -source http://polaris/nuget-server/FeedService.svc</code></p> <p>Then log into the site as a non-admin user (you can can use the one created for the <code>Settings</code> page). In the usual place - <code>MyAccount</code> - you'll find your local API key. Now try uploading a package:</p> <p><code>nuget.exe push elmah.1.1.nupkg 8cd3ad95-19a3-47d3-81af-090280077f24 -source http://polaris/nuget-server</code></p> <p>Next check if it's really there:</p> <p><code>nuget.exe list -source http://polaris/nuget-server/FeedService.svc</code></p> <p>Now go back to <code>http://polaris/nuget-gallery</code> and check the <code>My Contributions</code> page and the global <code>Packages</code> page. Note that the latter sometimes needs a few minutes to refresh.</p> <p><strong>If all tests succeeded - congratulations! You are now a proud owner of your own private NuGet gallery. At this point you can use both <code>nuget.exe</code> and the website for all package operations, including upload and removal.</strong></p> <h3>Step 8: SymbolSource integration</h3> <p>This is all great, but I hope you are now asking a very important question: <em>how do I make use of the SymbolSource integration features introduced recently into NuGet</em>?</p> <p>SymbolSource has been built from the ground up with scalability and multi-tenancy in mind. Although we are not yet ready to release a standalone product that you could install on your own server, <strong>we can provide you with an entirely separate repository of symbols and sources</strong>.</p> <p>You might have noticed that many of our URLs containt a <code>Public</code> prefix or suffix. This is a so-called <em>company name</em> and it identifies a separate namespace for users and packages. You can actually have a look at our NuGet symbol and source repository here (access to demo projects is unrestricted):</p> <p><a href="http://www.symbolsource.org/Caliper/Metadata/NuGet/Projects">http://www.symbolsource.org/Caliper/Metadata/NuGet/Projects</a></p> <p>The functionality of a private instance of SymbolSource is the same as the public one, and you can use it in the same way. For example, to upload a package, you can use this command:</p> <p><code>nuget.exe push SecretLibrary.0.1.symbols.nupkg 8cd3ad95-19a3-47d3-81af-090280077f24 -source http://nuget.gw.symbolsource.org/Caliper/NuGet</code></p> <p>And that's it. Absolutely no pain of the original Microsoft source indexing scripts, no need to take care of file system performance, and out-of-the box support in NuGet and Visual Studio. During upload, the correct NuGet gallery will of course be consulted to verify that you are a contributor for the particular project. To debug a package, all you need to do is add a familiar looking URL to Visual Studio:</p> <p><code>http://srv.symbolsource.org/pdb/Caliper/TripleEmcoder/aR5bN6qkO4dT23g7WtfM3_0fBlP=</code></p> <p>This is a private URL, which means that it contains a username and an authentication hash. No symbols or sources will be served out publicly.</p> <p><strong>What I've described so far in this blog post is a setup that we use in our everyday development. If you are interested in an environment like this, contacts us on <a href="http://groups.google.com/group/symbolsource">Google Groups</a>, <a href="http://www.twitter.com/TripleEmcoder">Twitter</a> or using the comment form below.</strong></p> <p>The next post will describe how SymbolSource handles permissions and how symbol and source access to repositories and projects can be restricted per user.</p> http://www.symbolsource.org/Public/Blog/View/25 The new integrated NuGet workflow Thu, 14 Apr 2011 17:26:47 +0200 http://www.symbolsource.org/Public/Blog/View/23 <p><em>After a short false start of this note that hopefully none of you actually saw, here is the full announcement post.</em></p> <p>For the past few weeks we have been working hard together with the NuGet team on simplifying the symbol and source distribution story for .NET libraries.</p> <p>What we can finally show you today is an integrated workflow that allows effortless submission of packages to both NuGet and SymbolSource sites simultaneously. <!--break--> What best speaks to us developers are examples, so please consider the following commands:</p> <ol> <li><p>Create a regular and a symbol/source package in one go:</p> <p><code>nuget.exe pack MyLibrary.csproj -Symbols</code></p> <p>This will use the <code>*.nuspec</code> file included in the project file and generate <code>MyLibrary.1.0.0.0.nupkg</code> for nuget.org and <code>MyLibrary.1.0.0.0.symbols.nupkg</code> for symbolsource.org.</p></li> <li><p>Save your API key for easier use of <code>nuget.exe</code>:</p> <p><code>nuget.exe SetApiKey 78a53314-c2c0-45c6-9d92-795b2096ae6c</code></p></li> <li><p>Push both packages to appropriate sites in one go:</p> <p><code>nuget.exe push MyLibrary.1.0.0.0.nupkg</code></p></li> </ol> <p><strong>And that's it!</strong> After a short moment your package will be available not only for download through the NuGet package manager, but also for full on-demand debugging in Visual Studio with SymbolSource.</p> <p>No registration on SymbolSource is required for this to work, but you can create an account later and associate your NuGet API key to manage past and future submissions.</p> <p><strong>Please remember to update your nuget.exe before trying this yourself.</strong> </p> http://www.symbolsource.org/Public/Blog/View/23 Illustrated guide to symbol and source servers Tue, 12 Apr 2011 11:23:10 +0200 http://www.symbolsource.org/Public/Blog/View/21 <p>If you're new to the subject, have a look at Cameron Skinner's blog for a series of nicely illustrated posts on the topic of debugging, symbols and symbol/source servers:</p> <ul> <li><a href="http://blogs.msdn.com/b/camerons/archive/2011/04/01/debugging-series-symbol-server.aspx">Debugging Series: Symbol Server</a></li> <li><a href="http://blogs.msdn.com/b/camerons/archive/2011/04/06/debugging-series-symbols-server-and-your-symbols.aspx">Debugging Series: Symbols Server and Your Symbols</a></li> </ul> <p>This is a a recommended read for anyone interested in configuring a proper debugging experience, including Microsoft Reference Source server and SymbolSource.</p> http://www.symbolsource.org/Public/Blog/View/21 SymbolSource and NuGet after 1.2 Fri, 01 Apr 2011 23:41:44 +0200 http://www.symbolsource.org/Public/Blog/View/20 <p>As NuGet 1.2 has been released recently it would seem appropriate to write something new on the blog here, so that at least the previous note gets pushed down. For now let me just say, that we are very busy working on tighter integration with NuGet and a unified workflow for publishing packages simultaneously to nuget.org and symbolsource.org. We should be ready to announce it soon, so please stay tuned.</p> http://www.symbolsource.org/Public/Blog/View/20 NuGet 1.1 is great, but 1.2 will be even better Mon, 14 Feb 2011 10:42:32 +0200 http://www.symbolsource.org/Public/Blog/View/19 <p>Congratulations to the NuGet team for releasing 1.1! However, there are at least two reasons why we are really looking forward to using the next version, 1.2.</p> <h1>Framework Profile Support</h1> <p>NuGet 1.2 will bring an important bugfix and new feature regarding framework folder naming. The pattern will be extended to include a framework profile in the following way: </p> <p><code>{framework}{version}-{profile}</code></p> <p>That means that <code>net35-client</code> and <code>net40-client</code> will become legal and fully supported.You can have a look at preliminary documentation for this new feature on the wiki page: <a href="http://nuget.codeplex.com/wikipage?title=Framework%20Profile%20Support">Framework Profile Support</a>.</p> <p>At the same time a bug was fixed that prevented libraries in nested folders to be detected and referenced correctly. Now all files for the appropriate framework will be added recursively. You can see the original issue here: <a href="http://nuget.codeplex.com/workitem/664">#664 - Incorrect mapping of lib/* to FrameworkName</a>.</p> <h1>Symbol Server Support</h1> <p>The NuGet team is also looking at a way of simplifying package uploading to SymbolSource. You can vote for this issue here: <a href="http://nuget.codeplex.com/workitem/661">#661 - Simplify Integration with a Symbol Server</a>.</p> <p>This is strongly related to automatic package building, which you can have a look here (prototype screencast included): <a href="http://nuget.codeplex.com/workitem/675">#675 - Streamlined Workflow for creating packages</a>.</p> http://www.symbolsource.org/Public/Blog/View/19 NuGet and OpenWrap demo packages Mon, 07 Feb 2011 14:47:03 +0200 http://www.symbolsource.org/Public/Blog/View/18 <p>To work around our dependency on package maintainers publishing sources we prepared a small demo package (available from both NuGet and OpenWrap repositories) to show you how SymbolSource provides symbols and sources for libraries downloaded with your favourite package manager.</p> <p>Follow these simple steps to test SymbolSource:</p> <ol> <li><a href="/Public/Home/VisualStudio">Configure Visual Studio</a>.</li> <li>Create a new Console Application.</li> <li>Reference <code>SymbolSource.DemoLibrary</code> with NuGet or <code>symbolsource-demolibrary</code> with OpenWrap.</li> <li><p>Use something from the library:</p> <pre class="brush: csharp; wrap-lines: false"> using System; using SymbolSource.DemoLibrary.Calculator; namespace ConsoleApplication { class Program { static void Main(string[] args) { var c = new SimpleCalculator(); Console.WriteLine(c.Add(1, 2)); } } } </pre></li> <li><p>Set a breakpoint and step into <code>c.Add()</code>.</p></li> </ol> <p>Now wouldn't it be so cool if everyone published sources to SymbolSource?</p> http://www.symbolsource.org/Public/Blog/View/18