<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://www.xavierdecoster.com/feed.xml" rel="self" type="application/atom+xml" /><link href="https://www.xavierdecoster.com/" rel="alternate" type="text/html" /><updated>2026-02-03T09:45:15+01:00</updated><id>https://www.xavierdecoster.com/feed.xml</id><title type="html">Xavier Decoster’s Blog</title><subtitle>Blog posts about Package Management, Lean Startup, Platform Thinking, Customer Success.</subtitle><author><name>Xavier Decoster</name></author><entry><title type="html">Joining Microsoft</title><link href="https://www.xavierdecoster.com/post/2015/01/27/joining-microsoft.html" rel="alternate" type="text/html" title="Joining Microsoft" /><published>2015-01-27T08:21:00+01:00</published><updated>2015-01-27T08:21:00+01:00</updated><id>https://www.xavierdecoster.com/post/2015/01/27/joining-microsoft</id><content type="html" xml:base="https://www.xavierdecoster.com/post/2015/01/27/joining-microsoft.html"><![CDATA[<p>It’s been over 7 years since I joined RealDolmen, one of Belgium’s larger consultancy firms. I got to meet many interesting folks and had a wide variation in challenges. I was also lucky enough to attend a few conferences and was even allowed to speak abroad when I had the opportunity. Thank you <a href="http://www.realdolmen.com">RealDolmen</a>! And thank you everyone I worked with!</p>

<p>It was in 2011 at TechDays Belgium, after a talk by Scott Hanselman (<a href="http://www.hanselman.com/blog/TechDaysDevDaysNetherlandsAndBelgium.aspx">NuGet in depth: empowering OSS on the .NET platform</a>), when <a href="http://blog.maartenballiauw.be">Maarten Balliauw</a> and I got talking about an idea we had. We created a prototype and by the end of the month, we launched <a href="https://www.myget.org">MyGet</a>, a hosted NuGet server on Azure.</p>

<p>At first, we used it as a playground for ourselves and some friends. A few weeks later we had about a hundred people using the service and we had our first feature requests coming in: people told us they wanted secured feeds. We bootstrapped a business model to cover for the hosting costs, and executed as lean as we possibly could. Today, 3.5 years later, we serve thousands of feeds and provide a solution for many developers, OSS projects and companies worldwide. You can find us in the Azure Store, we became VSO Launch partners at TechEd, and we even host <a href="https://www.myget.org/gallery/aspnetvnext">nightly builds for ASP.NET</a> and many other Microsoft products!</p>

<p>Some time ago, I noticed a vacant position on the NuGet team (well, two, in fact). Today, I’m super-excited to share that I’m joining Microsoft and the NuGet team!</p>

<p>I’ll be working remotely on stuff I’m passionate about and feel I’m joining at an exciting time with many cool things to come: NuGet (and package management) is still building momentum! A few years ago, the average .NET developer didn’t know about packages. Then NuGet got introduced. Soon, we’ll be dealing with NuGet, NPM, Bower and many more tools integrated in our development on both .NET (vNext) and other languages.</p>

<p>What does this mean for MyGet? MyGet remains our private business and product. We’ll continue to provide the great service and support you’re used to! The only difference is that both Maarten and my agenda are now more aligned, and we’ll be in package management 24/7.</p>

<p>Looking very much forward for what’s next!</p>]]></content><author><name>Xavier Decoster</name></author><category term="post" /><summary type="html"><![CDATA[It’s been over 7 years since I joined RealDolmen, one of Belgium’s larger consultancy firms. I got to meet many interesting folks and had a wide variation in challenges. I was also lucky enough to attend a few conferences and was even allowed to speak abroad when I had the opportunity. Thank you RealDolmen! And thank you everyone I worked with!]]></summary></entry><entry><title type="html">Deploying the ASP.NET KRuntime Beta1 to Azure Websites</title><link href="https://www.xavierdecoster.com/post/2014/11/17/deploying-the-asp-net-beta1-kruntime-to-azure-websites.html" rel="alternate" type="text/html" title="Deploying the ASP.NET KRuntime Beta1 to Azure Websites" /><published>2014-11-17T00:00:00+01:00</published><updated>2014-11-17T00:00:00+01:00</updated><id>https://www.xavierdecoster.com/post/2014/11/17/deploying-the-asp-net-beta1-kruntime-to-azure-websites</id><content type="html" xml:base="https://www.xavierdecoster.com/post/2014/11/17/deploying-the-asp-net-beta1-kruntime-to-azure-websites.html"><![CDATA[<p><p>Unless you lived under a rock during the last few days, you should know by now that Microsoft shipped a Preview of VS2015 with support for ASP.NET vNext. Such announcements traditionally result in developers screaming "yeay, new bits!", late night coding and unlocking Untappd badges with each commit.</p><p>Working on a little side project, I wanted to explore ASP.NET vNext beta1 on Azure Websites. I quickly learned that <a href="http://blog.davidebbo.com/2014/09/deploying-aspnet-vnext-toazure-websites.html">Azure Websites currently only provides alpha-support</a>. On top of that, the kvm command switches have changed (esp. <code>kvm install</code>), so there's no straightforward kvm upgrade that will do the trick. This post shows you how I got an ASP.NET MVC6 beta1 application working on Azure Websites using x64 CoreCLR (Note: my Azure Website is configured to run x64 on the Basic tier). Feel free to use whatever version you want, YMMV!
</p><h1>Instructing Kudu to run a custom deployment</h1><p>First things first: for this to work, you'll need to take advantage of Kudu by connecting your Git repository to Azure Websites. <a href="http://bing.lmgtfy.com/?q=azure+websites+git+repository">Let me Google that for you with Bing</a>! Kudu will generate deployment scripts under the hood and deploy your website when pushing changes to your source repository. However, deployment will fail for an ASP.NET vNext beta1 application. To fix this, you'll need to customize the deployment scripts. This is the easiest part: simply add a <code>.deployment</code> file and an empty <code>deploy.cmd</code> to your source repository (don't bother downloading the script that Kudu uses out-of-the-box, it's flawed at the moment). The <code>.deployment</code> file looks like this:</p><p><pre><code>[config]<br />command = deploy.cmd</code></pre></p><p>Before we take a look at the deploy.cmd, we'll first have to setup the <a href="https://github.com/aspnet/Home/wiki/version-manager">K Version Manager</a> (KVM).</p><h1>Setting up KVM</h1><p>As the interactions with the Azure Websites environment are constrained due to security, we can't just install kvm by following the <a href="https://github.com/aspnet/Home">Getting Started</a> guide (not during deployment, and not from within site extensions). Installation will fail as the <code>kvm.ps1</code> script being used under the hood contains lots of <code>Write-Host</code> statements that will cause exceptions. In fact, when you try this, the first Write-Host statement encountered is the one that should log an exception to the console, so it just doesn't work.
</p><p>This leaves only one option: having a <code>kvm.cmd</code> in the repository root calling into a customized <code>kvm.ps1</code>, and call it from a custom <code>deploy.cmd</code>. Let's skip the download process and adapt the PowerShell script to our needs and check-it into source control. The following links point to their gists:</p><ul><li><a href="https://gist.github.com/xavierdecoster/c56561312891eb788b8d">kvm.cmd</a></li><li><a href="https://gist.github.com/xavierdecoster/c56561312891eb788b8d">kvm.ps1</a></li></ul><p>The <code>kvm.cmd</code> file is unmodified and <a href="https://github.com/aspnet/Home/blob/v1.0.0-beta1/kvm.cmd">matches</a> the one from the ASP.NET GitHub repository. The <code>kvm.ps1</code> file I created is also <a href="https://github.com/aspnet/Home/blob/v1.0.0-beta1/kvm.ps1">based on the v1.0.0-beta1 tag</a> and has the following modifications:</p><ul><li>It uses a <code>WriteLine</code> function that simply echo's the text into the console host, and all calls to Write-Host are replaced by calls to this <code>WriteLine</code> function.</li><li>The ZIP unpack logic in the script (which uses PowerShell's built-in unzip functionality) is replaced by calling into .NET's <a href="http://msdn.microsoft.com/en-us/library/hh485723(v=vs.110).aspx"><span style="font-family:Consolas; font-size:10pt">ZipFile::ExtractToDirectory</span></a> method. The original extract logic didn't work and silently failed.</li></ul><h1>Customizing the deployment</h1><p>Now we have almost everything in place except for the real deployment instructions. The <code>deploy.cmd</code> file is the one that our <code>.deployment</code> file points to so let's take a look at how we can leverage our custom KVM.</p><p>I didn't create this from scratch though. Remember, I started from the deployment scripts that got generated by Kudu. In a nutshell, here's what the script does:</p><ol><li>Check pre-requisites and configure environment variables
</li><li>Install KRE (by <a href="https://gist.github.com/xavierdecoster/c56561312891eb788b8d">calling</a> into the custom <code>kvm.ps1</code> file)</li><li>Run KPM restore</li><li>Run KPM pack</li><li>Run <a href="https://github.com/projectkudu/KuduSync">KuduSync</a></li><li>First-hit of the web site (warm-up call)</li></ol><p>The full deploy.cmd file can be found here: <a href="https://gist.github.com/xavierdecoster/c56561312891eb788b8d">deploy.cmd</a>. You can easily customize the script to your needs by changing the variables set in <a href="https://gist.github.com/xavierdecoster/c56561312891eb788b8d">lines 82-85</a>.
</p><pre><code>SET KRE VERSION=1.0.0-beta1<br />SET KRE_ARCH=amd64<br />SET KRE_CLR=CoreCLR<br />SET ProjectJsonFile=My.Awesome.DemoApp\project.json</code></pre><h1>Wrapping up</h1><p>I'm sure built-in support is coming, but if you want to have a play with it on Azure Websites today, this might just do the trick for you. I'd like to thank <a href="https://twitter.com/davidebbo">David Ebbo</a> for pointing me towards <a href="https://twitter.com/loudej/status/530543638351462400">this tweet</a>, referencing <a href="https://twitter.com/loudej">Louis DeJardin</a>'s GitHub <a href="https://github.com/lodejard/LockingProblems">repository</a>: it helped me to get this working :)</p><p>Link to all gists used in this post: <a href="https://gist.github.com/xavierdecoster/c56561312891eb788b8d">https://gist.github.com/xavierdecoster/c56561312891eb788b8d</a></p></p>]]></content><author><name>Xavier Decoster</name></author><category term="post" /><category term="ASP.NET" /><category term="Azure" /><summary type="html"><![CDATA[Unless you lived under a rock during the last few days, you should know by now that Microsoft shipped a Preview of VS2015 with support for ASP.NET vNext. Such announcements traditionally result in developers screaming "yeay, new bits!", late night coding and unlocking Untappd badges with each commit.Working on a little side project, I wanted to explore ASP.NET vNext beta1 on Azure Websites. I quickly learned that Azure Websites currently only provides alpha-support. On top of that, the kvm command switches have changed (esp. kvm install), so there's no straightforward kvm upgrade that will do the trick. This post shows you how I got an ASP.NET MVC6 beta1 application working on Azure Websites using x64 CoreCLR (Note: my Azure Website is configured to run x64 on the Basic tier). Feel free to use whatever version you want, YMMV! Instructing Kudu to run a custom deploymentFirst things first: for this to work, you'll need to take advantage of Kudu by connecting your Git repository to Azure Websites. Let me Google that for you with Bing! Kudu will generate deployment scripts under the hood and deploy your website when pushing changes to your source repository. However, deployment will fail for an ASP.NET vNext beta1 application. To fix this, you'll need to customize the deployment scripts. This is the easiest part: simply add a .deployment file and an empty deploy.cmd to your source repository (don't bother downloading the script that Kudu uses out-of-the-box, it's flawed at the moment). The .deployment file looks like this:[config]command = deploy.cmdBefore we take a look at the deploy.cmd, we'll first have to setup the K Version Manager (KVM).Setting up KVMAs the interactions with the Azure Websites environment are constrained due to security, we can't just install kvm by following the Getting Started guide (not during deployment, and not from within site extensions). Installation will fail as the kvm.ps1 script being used under the hood contains lots of Write-Host statements that will cause exceptions. In fact, when you try this, the first Write-Host statement encountered is the one that should log an exception to the console, so it just doesn't work. This leaves only one option: having a kvm.cmd in the repository root calling into a customized kvm.ps1, and call it from a custom deploy.cmd. Let's skip the download process and adapt the PowerShell script to our needs and check-it into source control. The following links point to their gists:kvm.cmdkvm.ps1The kvm.cmd file is unmodified and matches the one from the ASP.NET GitHub repository. The kvm.ps1 file I created is also based on the v1.0.0-beta1 tag and has the following modifications:It uses a WriteLine function that simply echo's the text into the console host, and all calls to Write-Host are replaced by calls to this WriteLine function.The ZIP unpack logic in the script (which uses PowerShell's built-in unzip functionality) is replaced by calling into .NET's ZipFile::ExtractToDirectory method. The original extract logic didn't work and silently failed.Customizing the deploymentNow we have almost everything in place except for the real deployment instructions. The deploy.cmd file is the one that our .deployment file points to so let's take a look at how we can leverage our custom KVM.I didn't create this from scratch though. Remember, I started from the deployment scripts that got generated by Kudu. In a nutshell, here's what the script does:Check pre-requisites and configure environment variables Install KRE (by calling into the custom kvm.ps1 file)Run KPM restoreRun KPM packRun KuduSyncFirst-hit of the web site (warm-up call)The full deploy.cmd file can be found here: deploy.cmd. You can easily customize the script to your needs by changing the variables set in lines 82-85. SET KRE VERSION=1.0.0-beta1SET KRE_ARCH=amd64SET KRE_CLR=CoreCLRSET ProjectJsonFile=My.Awesome.DemoApp\project.jsonWrapping upI'm sure built-in support is coming, but if you want to have a play with it on Azure Websites today, this might just do the trick for you. I'd like to thank David Ebbo for pointing me towards this tweet, referencing Louis DeJardin's GitHub repository: it helped me to get this working :)Link to all gists used in this post: https://gist.github.com/xavierdecoster/c56561312891eb788b8d]]></summary></entry><entry><title type="html">Using MyGet as a OneGet package source</title><link href="https://www.xavierdecoster.com/post/2014/04/17/using-myget-as-a-oneget-package-source.html" rel="alternate" type="text/html" title="Using MyGet as a OneGet package source" /><published>2014-04-17T17:03:10+02:00</published><updated>2014-04-17T17:03:10+02:00</updated><id>https://www.xavierdecoster.com/post/2014/04/17/using-myget-as-a-oneget-package-source</id><content type="html" xml:base="https://www.xavierdecoster.com/post/2014/04/17/using-myget-as-a-oneget-package-source.html"><![CDATA[<p>At the Build conference, Microsoft announced the <a href="http://www.microsoft.com/en-eg/download/details.aspx?id=42316" target="_blank" title="Windows Management Framework 5.0 Preview">Windows Management Framework 5.0 Preview</a> which includes Windows PowerShell 5.0, updates to the PowerShell ISE, Network Switch Cmdlets and ... <b>OneGet</b>!</p>

<h1>What is OneGet?</h1>

<blockquote>OneGet a unified package management interface component with a set of managed and native APIs, a set of PowerShell cmdlets, and a WMI provider. The component accepts both Microsoft-provided and 3rd party-provided plugins which extend the functionality for a given package type.

</blockquote>

<p>The OneGet team also has a weekly community meeting of which you can see the first introductionary recording below.</p>

<iframe width="640" height="360" src="//www.youtube-nocookie.com/embed/r0yfCSAGCLM" frameborder="0" allowfullscreen=""></iframe>

<p>As part of this Preview, OneGet is shipping with a prototype plugin compatible with Chocolatey, the so called <i>ChocolateyProvider</i>. This is a prototype implementation of a Chocolatey-compatible package manager that can install existing Chocolatey packages. This is a clear confirmation for the hard work done by the Chocolatey folks, and both systems will continue to evolve together, as <a href="https://twitter.com/ferventcoder" target="_blank">Rob Reynolds</a> explains in <a href="https://groups.google.com/forum/#!topic/chocolatey/a8WdEoF-M58" target="_blank">this post</a>. If you want to follow-up on OneGet, then check out <a href="https://github.com/OneGet/oneget" target="_blank">its GitHub repository</a> and <a href="https://twitter.com/PSOneGet" target="_blank">follow PSOneGet</a> on Twitter.</p>

<h1>Something about a forest and trees...</h1>

<p>NuGet, MyGet, Chocolatey, OneGet... what?! People ask questions and occasionally can't see the forest for the trees. Here's a quick recap:</p>

<ul>
<li><b>NuGet</b>: a <i>solution-level</i> package management tool, used to manage software dependencies within the scope of a solution. It is accompanied by the <a href="http://nuget.org" target="_blank">NuGet Gallery</a>, the home of many if not all .NET open source components.</li>
<li><b>Chocolatey</b>: a <i>system-level</i> package management tool, used to manage software installations on a Windows system. It (currently) leverages PowerShell and NuGet, supports the Web Platform Installer (WebPI), MSI, RubyGems and many more, and is accompanied by the <a href="http://chocolatey.org" target="_blank">Chocolatey Gallery</a> where you can find many popular software packages. Rob describes Chocolatey as somewhat like "apt-get", but with Windows in mind.</li>
<li><b>MyGet</b>: a <i>hosted NuGet package server</i> where you can create and secure your own feeds. In essence, <a href="https://www.myget.org" target="_blank">MyGet</a> is able to host vanilla NuGet feeds, <a href="http://docs.myget.org/docs/reference/package-sources" target="_blank">as well as Chocolatey feeds</a>.</li>
<li><b>OneGet</b>: a <i>a unified interface to package management systems</i> (see above)</li>
</ul>

<p>So what does this mean? How do these package managers play along?</p>

<p>OneGet supports multiple package sources, and as stated earlier, OneGet comes with a <i>ChocolateyProvider</i>. As MyGet also supports Chocolatey feeds, this effectively means that you can register a MyGet feed as a Chocolatey package source in OneGet! The below diagram is an attempt to illustrate how they relate:</p>

<p><img src="/images/2014-04-18/2014-04-17_1958.png" alt="How do OneGet, Chocolatey, NuGet and MyGet play along?" style="max-width:650px;" /></p>

<p>OneGet supports several commands at this stage:</p>

<p><img src="/images/2014-04-18/2014-04-04_1058.png" alt="OneGet Preview cmdlets" style="max-width:650px" /></p>

<h1>How can I use a private OneGet package source?</h1>

<p>So how can I register a private OneGet package source? Well, let's first see how you can register any package source using the Add-PackageSource cmdlet. Here's what the built-in help currently says:</p>

<p><img src="/images/2014-04-18/2014-04-04_1101.png" alt="OneGet Add-PackageSource Help" style="max-width:650px;" /></p>

<p>Note that this is a Preview: help is incomplete and cmdlets might change name, but this should already give you a good idea of what you can do with this cmdlet!</p>

<p>Now, let's register a MyGet feed on which you can host Chocolatey packages:</p>

<p><img src="/images/2014-04-18/2014-04-04_1128.png" alt="Register a MyGet feed as a OneGet package source" style="max-width:650px;" /></p>

<p>Did you notice how OneGet asked you to install the NuGet package manager?</p>

<p>That went easy right? That's because that feed was public :) OneGet does not support basic-authentication at this point, nor does it leverage any nuget.config settings you might configure (tried it). However, MyGet just <a href="http://docs.myget.org/docs/reference/feed-endpoints" target="_blank">added the possibility to use a "private-by-obscurity" endpoint on private feeds</a>, which should allow you to use private feeds as well. Note: we don't actively promote this, as it requires you to share one of your feed's access tokens. This is a work-around for clients that don't support the basic-auth flow, and we'd prefer to have proper basic-authentication support in OneGet, so fingers crossed!</p>

<p>You can verify the correct registration of your OneGet package source using the following commands:</p>

<p><img src="/images/2014-04-18/2014-04-04_1129.png" alt="Get OneGet package sources" style="max-width:650px;" />
<img src="/images/2014-04-18/2014-04-04_1134.png" alt="List available packages on a OneGet package source" style="max-width:650px;" /></p>

<p>Installing a software package from this MyGet feed is straightforward as well:</p>

<p><img src="/images/2014-04-18/2014-04-04_1141_001.png" alt="Install a software package from a specific OneGet feed" style="max-width:650px;" /></p>

<p>This flow allows you to control what packages get distributed through OneGet, avoids the need to publish your internal software to the general public, and still allows you to leverage the great new scenarios that OneGet offers!</p>

<p>As usual, happy packaging! :)</p>]]></content><author><name>Xavier Decoster</name></author><category term="post" /><category term="NuGet" /><category term="MyGet" /><category term="Chocolatey" /><category term="OneGet" /><category term="Package Management" /><summary type="html"><![CDATA[At the Build conference, Microsoft announced the Windows Management Framework 5.0 Preview which includes Windows PowerShell 5.0, updates to the PowerShell ISE, Network Switch Cmdlets and ... OneGet! What is OneGet? OneGet a unified package management interface component with a set of managed and native APIs, a set of PowerShell cmdlets, and a WMI provider. The component accepts both Microsoft-provided and 3rd party-provided plugins which extend the functionality for a given package type. The OneGet team also has a weekly community meeting of which you can see the first introductionary recording below. As part of this Preview, OneGet is shipping with a prototype plugin compatible with Chocolatey, the so called ChocolateyProvider. This is a prototype implementation of a Chocolatey-compatible package manager that can install existing Chocolatey packages. This is a clear confirmation for the hard work done by the Chocolatey folks, and both systems will continue to evolve together, as Rob Reynolds explains in this post. If you want to follow-up on OneGet, then check out its GitHub repository and follow PSOneGet on Twitter. Something about a forest and trees... NuGet, MyGet, Chocolatey, OneGet... what?! People ask questions and occasionally can't see the forest for the trees. Here's a quick recap: NuGet: a solution-level package management tool, used to manage software dependencies within the scope of a solution. It is accompanied by the NuGet Gallery, the home of many if not all .NET open source components. Chocolatey: a system-level package management tool, used to manage software installations on a Windows system. It (currently) leverages PowerShell and NuGet, supports the Web Platform Installer (WebPI), MSI, RubyGems and many more, and is accompanied by the Chocolatey Gallery where you can find many popular software packages. Rob describes Chocolatey as somewhat like "apt-get", but with Windows in mind. MyGet: a hosted NuGet package server where you can create and secure your own feeds. In essence, MyGet is able to host vanilla NuGet feeds, as well as Chocolatey feeds. OneGet: a a unified interface to package management systems (see above) So what does this mean? How do these package managers play along? OneGet supports multiple package sources, and as stated earlier, OneGet comes with a ChocolateyProvider. As MyGet also supports Chocolatey feeds, this effectively means that you can register a MyGet feed as a Chocolatey package source in OneGet! The below diagram is an attempt to illustrate how they relate: OneGet supports several commands at this stage: How can I use a private OneGet package source? So how can I register a private OneGet package source? Well, let's first see how you can register any package source using the Add-PackageSource cmdlet. Here's what the built-in help currently says: Note that this is a Preview: help is incomplete and cmdlets might change name, but this should already give you a good idea of what you can do with this cmdlet! Now, let's register a MyGet feed on which you can host Chocolatey packages: Did you notice how OneGet asked you to install the NuGet package manager? That went easy right? That's because that feed was public :) OneGet does not support basic-authentication at this point, nor does it leverage any nuget.config settings you might configure (tried it). However, MyGet just added the possibility to use a "private-by-obscurity" endpoint on private feeds, which should allow you to use private feeds as well. Note: we don't actively promote this, as it requires you to share one of your feed's access tokens. This is a work-around for clients that don't support the basic-auth flow, and we'd prefer to have proper basic-authentication support in OneGet, so fingers crossed! You can verify the correct registration of your OneGet package source using the following commands: Installing a software package from this MyGet feed is straightforward as well: This flow allows you to control what packages get distributed through OneGet, avoids the need to publish your internal software to the general public, and still allows you to leverage the great new scenarios that OneGet offers! As usual, happy packaging! :)]]></summary></entry><entry><title type="html">Semantic Versioning: State your intentions please!</title><link href="https://www.xavierdecoster.com/post/2014/03/24/semantic-versioning-state-your-intentions-please.html" rel="alternate" type="text/html" title="Semantic Versioning: State your intentions please!" /><published>2014-03-24T00:00:00+01:00</published><updated>2014-03-24T00:00:00+01:00</updated><id>https://www.xavierdecoster.com/post/2014/03/24/semantic-versioning-state-your-intentions-please</id><content type="html" xml:base="https://www.xavierdecoster.com/post/2014/03/24/semantic-versioning-state-your-intentions-please.html"><![CDATA[<p><p>I'm quite a fan of Semantic Versioning (<a href="http://www.semver.org">SemVer</a>). It is the most pragmatic approach towards software versioning that I know of. If you don't know about SemVer, then you should go read the spec now. However, it is not perfect. Mostly because people are not perfect and some aspects of the specification can be interpreted differently. Actually, the spec itself is pointing this out – and I quote:
</p>

<blockquote><p><span style="font-family:Arial; font-size:10pt">For this system to work, you first need to declare a public API. This may consist of documentation or be enforced by the code itself. Regardless, it is important that this API be clear and precise. Once you identify your public API, you communicate changes to it with specific increments to your version number.
</span></p>

</blockquote>

<p>Now, that's a big judgement call, isn't it? What is a public API? How do you define it in such way that it is clear to everyone without room for interpretation?
</p><h1>Recap: the semantic version format
</h1><p>I'm not going to explain the spec in detail here, but I want to quickly recap the most fundamental basics of it. SemVer has three version parts expressing semantics.
</p><p><pre>major.minor.patch</pre>
</p><p>I'm ignoring the metadata that can be appended (such as build stamps etc). It's just metadata after all, so not important in this context. Instead, I'm going to focus on the semantics here, because that's really what this spec is all about: semantics and intent. These three version parts are indicators of the author's intentions:
</p><ul><li>Major: incrementing this version part means that the author intends to indicate a breaking change in the public API (I'll try to define this public API later in this post)
</li><li>Minor: incrementing this version part means that the author intends not to break anything (and truly thinks he won't), but backwards compatible additions or changes to the public API have been introduced (at least, the intent here is that these things are backwards compatible)
</li><li>Patch: incrementing this version part means that the author intends not to break anything, and believes no changes to the public API happened. Furthermore, the author thinks you can safely upgrade to the latest patch release without any risks as changes are internal.
</li></ul><h1>Defining the public API
</h1><p>As simple as the SemVer format may sound, the devil's in the details. How do you assess that your intentions match with the changes you may have introduced in your new release?
</p><p>The first time you ever read the spec and start thinking about your <em>public API</em>, you'll likely limit your thinking to your code base and the public types and methods exposed in your libraries. Now that's obviously a good start, but reality is a little bit more complex. Let's assess the impact of the following, and these are real questions people ask themselves (rightfully!):
</p><ul><li>What if I don't change anything in my code base and only upgrade one of my dependencies?
</li><li>What if the internal behavior of a public method on a public type changed, but did not affect its signature? (eg: public bool Type.IsSecure now returns false instead of true)
</li><li>What if a type moved to another assembly without changing namespace or any of its publicly visible members? (so only the "packaging" of this type changed)
</li></ul><p>You can already tell that a <em>public API</em> likely shouldn't be defined solely by signatures and type visibility.
</p><p>First and foremost: this is just my personal perspective on things. This is what works for me and hopefully as well for anyone consuming the API's I create. If it doesn't work for you, then please don't hesitate to tell me why in the comments. If you have a better approach, then please share it with the world so I can learn from you.
</p><h2>SemVer is technology agnostic
</h2><p>SemVer is a set of pragmatic rules and tries to provide guidelines. However, it is also technology agnostic. On purpose! As much as I believe that the guidelines set forth in this spec are valuable, I also believe there's a need to define a standard definition of <em>public API</em> within the scope of a certain technology.
</p><p>In .NET, we have a long history of looking at assemblies as the release vehicle. History shows us that versioning assemblies can quickly become problematic, and the words <em>dependency hell</em> may come to mind. That's mainly because a release vehicle also brings technical limitations to the way your API can and will be referenced.
</p><ul><li>You apply strong naming? Why does that even exist? Oh, right, the Global Assembly Cache… Wait a minute, isn't that a Windows thing? Why should my <em>public API</em> care about that?
</li><li>You remember .NET Remoting? Then you're probably familiar with the <a href="http://msdn.microsoft.com/en-us/library/aa302331.aspx">breaking aspects</a> of changing version numbers...
</li><li>Moving a type to another assembly requires consumers to recompile against your new assemblies, so again: breaking (even without any changes to the API of the type being moved)!
</li></ul><p>And then along came NuGet! Another release vehicle. Some packages contain a single assembly, some contain multiple assemblies, and some contain none at all! This is where many people lose faith in SemVer and start asking questions similar to the ones I mentioned earlier in this post. In fact, the SemVer FAQ and issue list on GitHub is full of those questions and related discussions.
</p><h2>My definition for .NET development
</h2><p>I'm trying to define a strict public API in an attempt that anyone consuming it has a clear understanding of what to expect. I'll restrict my definition to any .NET API that ships as an assembly (or set of assemblies) through NuGet. Why? Because I'm taking into account any changes to the release vehicles into the versioning strategy of my public API.
</p><p>Hence, in my definition for .NET development, a <em>public API</em> is defined by:
</p><ul><li>The <strong>public types, members and method signatures</strong> exposed in the consumable components
</li><li>The <strong>behavior</strong> of those types and members (if the <em>semantics</em> of an unchanged method signature change, that's breaking)
</li><li>The <strong>assembly qualified name</strong> of these types: did the type change assembly? (if so, that's breaking)
</li><li>The <strong>assembly signing</strong>: <a href="http://haacked.com/archive/2012/02/16/changing-a-strong-name-is-a-major-breaking-change.aspx/">changing SNK is breaking</a>! (and why the hell are you still signing assemblies? Can't we just stop doing that and move on?)
</li><li>The <strong>packaging</strong> of these assemblies: did the assembly change NuGet package? (if so, that's breaking)
</li></ul><p>I'm not sure whether I'm overlooking any other aspects of the public API, but using the above interpretation hasn't led me into discovering any. This definition also really helps me to clearly state my <em>intentions</em> when defining the semantic version vNext of any public API I own.
</p><h1>The sad part
</h1><p>The sad part about SemVer is that you can't interpret an author's intentions solely based on the version format. It's not because your versioning format happens to comply with the guidelines set forth by SemVer that you are using SemVer properly. If you're a log4net user, <a href="http://www.wiktorzychla.com/2012/03/pathetic-breaking-change-between.html">you might have been bitten by this before</a>.
</p><p>Or perhaps you jumped from v4.0 to v4.5? (Looking at you .NET Framework <span style="font-family:Wingdings">J</span>) This is clearly an example of what I would call Marketing Driven Versioning. Technically, the .NET Framework doesn't apply SemVer (and no one ever claimed it does). In fact, most (if not all?) .NET 4.5 libraries have a version number of v4.0 (remember, it's an in-place upgrade). However, people get confused as the version format <em>seems</em> to be SemVer-compliant.
</p><h1>Moving forward
</h1><p>Moving forward, I really hope to see NuGet be fully SemVer compliant one day (I know it won't be trivial as there's quite a legacy of non-SemVer compliant packages on the Gallery). But even if all new packages would be enforced to be SemVer-compliant, I'd argue they're likely just SemVer-<strong>format</strong> compliant. And that's totally fine from a NuGet perspective as there's nothing more that can be done about that!
</p><p>At the same time, that's why I'd love to see a <em>standard definition of public API</em> for anything that ships through NuGet. People need guidance and preferably this guidance is specific to their needs/scenario. The version format alone simply doesn't cut it: it doesn't say that it was the author's intention to be SemVer-compliant and as such, the version format alone doesn't clearly state the author's intentions with any new release.
</p><p>If there is any metric I want to know about a package, then it is not the download count, but rather the number of times a package author has broken SemVer-compliance for a given package. Not sure how to solve that. Perhaps people should be able to report that a package upgrade from one version to another broke their stuff? Correlate the number of reports against the number of <em>package-updates</em> (not installs, not restores …)?
</p><p>Anyway, I don't have control over any of this (and likely no one has), but I believe guidance is critical, and I hope someone finds value in this way of working. SemVer is awesome! I understand the reasoning behind it being agnostic on some levels. We should just state our intentions. I'd be happy even if just a single package author finds value in this post and improves his versioning strategy. Note that the goal is to propagate this happiness to all package consumers ;)</p></p>

<p>SemVer is not about code, it's about stating your intentions...</p>]]></content><author><name>Xavier Decoster</name></author><category term="post" /><category term="ALM" /><category term="SemVer" /><category term="Package Management" /><summary type="html"><![CDATA[I'm quite a fan of Semantic Versioning (SemVer). It is the most pragmatic approach towards software versioning that I know of. If you don't know about SemVer, then you should go read the spec now. However, it is not perfect. Mostly because people are not perfect and some aspects of the specification can be interpreted differently. Actually, the spec itself is pointing this out – and I quote: For this system to work, you first need to declare a public API. This may consist of documentation or be enforced by the code itself. Regardless, it is important that this API be clear and precise. Once you identify your public API, you communicate changes to it with specific increments to your version number. Now, that's a big judgement call, isn't it? What is a public API? How do you define it in such way that it is clear to everyone without room for interpretation? Recap: the semantic version format I'm not going to explain the spec in detail here, but I want to quickly recap the most fundamental basics of it. SemVer has three version parts expressing semantics. major.minor.patch I'm ignoring the metadata that can be appended (such as build stamps etc). It's just metadata after all, so not important in this context. Instead, I'm going to focus on the semantics here, because that's really what this spec is all about: semantics and intent. These three version parts are indicators of the author's intentions: Major: incrementing this version part means that the author intends to indicate a breaking change in the public API (I'll try to define this public API later in this post) Minor: incrementing this version part means that the author intends not to break anything (and truly thinks he won't), but backwards compatible additions or changes to the public API have been introduced (at least, the intent here is that these things are backwards compatible) Patch: incrementing this version part means that the author intends not to break anything, and believes no changes to the public API happened. Furthermore, the author thinks you can safely upgrade to the latest patch release without any risks as changes are internal. Defining the public API As simple as the SemVer format may sound, the devil's in the details. How do you assess that your intentions match with the changes you may have introduced in your new release? The first time you ever read the spec and start thinking about your public API, you'll likely limit your thinking to your code base and the public types and methods exposed in your libraries. Now that's obviously a good start, but reality is a little bit more complex. Let's assess the impact of the following, and these are real questions people ask themselves (rightfully!): What if I don't change anything in my code base and only upgrade one of my dependencies? What if the internal behavior of a public method on a public type changed, but did not affect its signature? (eg: public bool Type.IsSecure now returns false instead of true) What if a type moved to another assembly without changing namespace or any of its publicly visible members? (so only the "packaging" of this type changed) You can already tell that a public API likely shouldn't be defined solely by signatures and type visibility. First and foremost: this is just my personal perspective on things. This is what works for me and hopefully as well for anyone consuming the API's I create. If it doesn't work for you, then please don't hesitate to tell me why in the comments. If you have a better approach, then please share it with the world so I can learn from you. SemVer is technology agnostic SemVer is a set of pragmatic rules and tries to provide guidelines. However, it is also technology agnostic. On purpose! As much as I believe that the guidelines set forth in this spec are valuable, I also believe there's a need to define a standard definition of public API within the scope of a certain technology. In .NET, we have a long history of looking at assemblies as the release vehicle. History shows us that versioning assemblies can quickly become problematic, and the words dependency hell may come to mind. That's mainly because a release vehicle also brings technical limitations to the way your API can and will be referenced. You apply strong naming? Why does that even exist? Oh, right, the Global Assembly Cache… Wait a minute, isn't that a Windows thing? Why should my public API care about that? You remember .NET Remoting? Then you're probably familiar with the breaking aspects of changing version numbers... Moving a type to another assembly requires consumers to recompile against your new assemblies, so again: breaking (even without any changes to the API of the type being moved)! And then along came NuGet! Another release vehicle. Some packages contain a single assembly, some contain multiple assemblies, and some contain none at all! This is where many people lose faith in SemVer and start asking questions similar to the ones I mentioned earlier in this post. In fact, the SemVer FAQ and issue list on GitHub is full of those questions and related discussions. My definition for .NET development I'm trying to define a strict public API in an attempt that anyone consuming it has a clear understanding of what to expect. I'll restrict my definition to any .NET API that ships as an assembly (or set of assemblies) through NuGet. Why? Because I'm taking into account any changes to the release vehicles into the versioning strategy of my public API. Hence, in my definition for .NET development, a public API is defined by: The public types, members and method signatures exposed in the consumable components The behavior of those types and members (if the semantics of an unchanged method signature change, that's breaking) The assembly qualified name of these types: did the type change assembly? (if so, that's breaking) The assembly signing: changing SNK is breaking! (and why the hell are you still signing assemblies? Can't we just stop doing that and move on?) The packaging of these assemblies: did the assembly change NuGet package? (if so, that's breaking) I'm not sure whether I'm overlooking any other aspects of the public API, but using the above interpretation hasn't led me into discovering any. This definition also really helps me to clearly state my intentions when defining the semantic version vNext of any public API I own. The sad part The sad part about SemVer is that you can't interpret an author's intentions solely based on the version format. It's not because your versioning format happens to comply with the guidelines set forth by SemVer that you are using SemVer properly. If you're a log4net user, you might have been bitten by this before. Or perhaps you jumped from v4.0 to v4.5? (Looking at you .NET Framework J) This is clearly an example of what I would call Marketing Driven Versioning. Technically, the .NET Framework doesn't apply SemVer (and no one ever claimed it does). In fact, most (if not all?) .NET 4.5 libraries have a version number of v4.0 (remember, it's an in-place upgrade). However, people get confused as the version format seems to be SemVer-compliant. Moving forward Moving forward, I really hope to see NuGet be fully SemVer compliant one day (I know it won't be trivial as there's quite a legacy of non-SemVer compliant packages on the Gallery). But even if all new packages would be enforced to be SemVer-compliant, I'd argue they're likely just SemVer-format compliant. And that's totally fine from a NuGet perspective as there's nothing more that can be done about that! At the same time, that's why I'd love to see a standard definition of public API for anything that ships through NuGet. People need guidance and preferably this guidance is specific to their needs/scenario. The version format alone simply doesn't cut it: it doesn't say that it was the author's intention to be SemVer-compliant and as such, the version format alone doesn't clearly state the author's intentions with any new release. If there is any metric I want to know about a package, then it is not the download count, but rather the number of times a package author has broken SemVer-compliance for a given package. Not sure how to solve that. Perhaps people should be able to report that a package upgrade from one version to another broke their stuff? Correlate the number of reports against the number of package-updates (not installs, not restores …)? Anyway, I don't have control over any of this (and likely no one has), but I believe guidance is critical, and I hope someone finds value in this way of working. SemVer is awesome! I understand the reasoning behind it being agnostic on some levels. We should just state our intentions. I'd be happy even if just a single package author finds value in this post and improves his versioning strategy. Note that the goal is to propagate this happiness to all package consumers ;) SemVer is not about code, it's about stating your intentions...]]></summary></entry><entry><title type="html">Migrate away from MSBuild-based NuGet package restore</title><link href="https://www.xavierdecoster.com/post/2014/03/06/migrate-away-from-msbuild-based-nuget-package-restore.html" rel="alternate" type="text/html" title="Migrate away from MSBuild-based NuGet package restore" /><published>2014-03-06T09:07:46+01:00</published><updated>2014-03-06T09:07:46+01:00</updated><id>https://www.xavierdecoster.com/post/2014/03/06/migrate-away-from-msbuild-based-nuget-package-restore</id><content type="html" xml:base="https://www.xavierdecoster.com/post/2014/03/06/migrate-away-from-msbuild-based-nuget-package-restore.html"><![CDATA[<h1>Back in the days...</h1>

<p>
NuGet package restore used to be MSBuild-based. You had to explicitly enable it using the context menu on a Visual Studio solution: right-click the solution and select Enable NuGet Package Restore. In fact, if you go to the NuGet docs, you'll see that this scenario is still fully documented. A quick search for "package restore" will throw this old scenario "in your face", as it is the first hit in the search results.</p>

<p><a href="http://docs.nuget.org/search?q=package%20restore" target="_blank"><img alt="First hit in search results when looking for Package Restore on the NuGet docs" src="/images/2014-03-06/searchresults.png" style="max-width:600px;" /></a></p>

<p>
To be fair, the page does highlight that there's a new way of doing this. But many people don't read. At best some look at the pictures. That's why I won't even include a screenshot of that page, as it is full of project setup details that no one should ever go through again. Instead, I'll give you a clear picture of what you should <strong>not</strong> do :)
</p>

<p><a href="/images/2014-03-06/dontdothis.png" target="_blank"><img src="/images/2014-03-06/dontdothis.png" alt="Don't do this!" style="max-height:450px;" /></a></p>

<h1>You're doing it wrong!</h1>

<p>
I can't stress it enough. I'm a huge proponent of NuGet package restore! But if you follow this workflow, then <a href="http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html" target="_blank">please do it right</a>! (and <a href="http://blog.ploeh.dk/2014/02/03/using-nuget-with-autonomous-repositories" target="_blank">design for failure</a>, obviously).
</p>

<p><p>
The MSBuild-based NuGet package restore has issues. For one: it's MSBuild-based. This means that anything that happens during package restore is run within the MSBuild process, which is particularly annoying for packages that want to modify project files and inject MSBuild targets (as these aren't picked up until the next run).</p><p>The moment you manually enable NuGet package restore through the context menu, you're actually installing a few NuGet packages: <a href="https://www.nuget.org/packages/NuGet.Build/" target="_blank">NuGet.Build</a>, which depends on <a href="https://www.nuget.org/packages/NuGet.CommandLine/" target="_blank">NuGet.Commandline</a>. The <code>nuget.exe</code> along with a <code>nuget.config</code> and a <code>nuget.targets</code> file are created within a <code>.nuget</code> folder, and all projects that have NuGet package references will be modified to import the NuGet.targets file. The nuget.targets file ensures that nuget.exe is invoked <strong>during</strong> builds (as in: <strong>not before</strong> builds!).
</p></p>

<h1>The right way</h1>

<p>All you need to do is to make sure that your Visual Studio options allow NuGet to download any missing packages in a pre-build phase (note: even before MSBuild compilation starts!). I'm not going to rephrase step-by-step what you should do as <a href="http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html" target="_blank">David Ebbo already has a great post explaining all of this</a>!</p>

<p><img alt="Ensure NuGet is allowed to download missing packages" src="/images/2014-03-06/options.png" style="max-width:600px;" /></p>

<p>If you're cloning a new project that did not commit any NuGet packages (and is not using the old MSBuild-based restore), then it just works!</p>

<h1>Migrating from the old way</h1>

<p>If you still have a <code>.nuget</code> folder in your repository, then <strong>please migrate away from it</strong>! Think about all those adorable kittens...</p>

<p>Did you know this has been <a href="http://docs.nuget.org/docs/workflows/migrating-to-automatic-package-restore" target="_blank">documented on the NuGet Docs</a> all along?! Follow this how-to and save yourself and everyone using your codebase some trouble and follow it step-by-step.</p>

<p>Even better: <a href="https://github.com/owen2/AutomaticPackageRestoreMigrationScript" target="_blank" style="font-weight:bold;">automate your migration using these awesome scripts</a>!</p>

<p>For those not using Visual Studio or perhaps not even on the Windows platform: a simple call to <code>nuget.exe restore *.sln</code> before calling the compiler does the trick as well (add it to your build script, or perhaps you can configure your IDE to do this for you before each build...).</p>

<h1>But... my precious (build server)</h1>

<p>As long as you did not set the environment variable <code>EnableNuGetPackageRestore=false</code> then you're good to go. (default: <code>EnableNuGetPackageRestore=true</code>)</p>

<p>The following tools support the new automatic package restore out-of-the-box and Just Work&#8482;!</p>

<ul>
<li>Anything based on Project Kudu (<a href="/deploying-to-azure-web-sites-using-nuget-package-restore-from-a-secured-feed" target="_blank">Windows Azure Web Sites deployments</a>, Windows Azure Mobile Services C# backend, ...)</li>
<li><a href="http://docs.myget.org/docs/reference/build-services#Package_Restore" target="_blank">MyGet Build Services</a></li>
</ul>

<p>The next list of tools requires some minor modifications to the build process:</p>

<ul>
<li>Visual Studio Online / Team Foundation Server (<a href="http://blogs.msdn.com/b/dotnet/archive/2013/08/27/nuget-package-restore-with-team-foundation-build.aspx" target="_blank">how-to</a>)</li>
<li>TeamCity (<a href="http://blog.jetbrains.com/teamcity/2013/08/nuget-package-restore-with-teamcity/" target="_blank">how-to</a>)</li>
</ul>

<p style="font-weight:bold;">Note that you don't need to worry about development machines! As long as you all have the latest NuGet Visual Studio extension installed (as of NuGet v2.7).</p>

<p>Upgrading your NuGet extension is generally a good idea anyway, as there are lots of improvements in the latest versions!</p>

<h1>Going forward</h1>

<p>
Here's what I'd love to see happen going forward:
<ul>
<li>The NuGet Docs should by default show the new non-MSBuild-based package restore instructions. There are close to none, but this should be thrown in your face when looking for it.</li>
<li>Migration instructions should be clearly linked to.</li>
<li>The old MSBuild-based instructions should be archived, perhaps even removed.</li>
<li>Currently, when installing a NuGet package that injects MSBuild targets, you'll see the following piece of logic appear in your project files:<br />
<pre>
  &lt;Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"&gt;
    &lt;PropertyGroup&gt;
      &lt;ErrorText&gt;This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.&lt;/ErrorText&gt;
    &lt;/PropertyGroup&gt;
    &lt;Error Condition="!Exists('..\packages\SomePackageId\Build\SomeMSBuild.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\SomePackageId\Build\SomeMSBuild.targets'))" /&gt;
  &lt;/Target&gt;
</pre>
This is horrible as it is suggesting you to do the wrong thing: you should call <code>nuget.exe restore</code> instead!</li>
<li>The context menu-item to manually enable NuGet package restore (MSBuild-based) should be completely removed from the extension. I don't see any reason to keep it. Do you? If you do, please <a href="https://nuget.codeplex.com/workitem/4019" target="_blank">comment on this CodePlex issue</a>, if you agree, then vote for it :)</li>
<li>Preferably, the next NuGet Visual Studio extension detects you are using the "old" restore option when you open a solution, and asks you to migrate/upgrade to the new way. Ideally, this removes the targets and import statements, and custom package sources and credentials are taken into account if they are in the nuget.config file.
&lt;/ul&gt;
&lt;/p&gt;

<p>I'm happy to take on an issue or send PR's for any of the above, but some of the bullet-points seem too big to me to be taken in as a PR.</p>
</li></ul></p>]]></content><author><name>Xavier Decoster</name></author><category term="post" /><category term="NuGet" /><category term="Package Management" /><summary type="html"><![CDATA[Back in the days...]]></summary></entry><entry><title type="html">Awarded MVP Visual Studio ALM</title><link href="https://www.xavierdecoster.com/post/2013/10/02/awarded-mvp-visual-studio-alm.html" rel="alternate" type="text/html" title="Awarded MVP Visual Studio ALM" /><published>2013-10-02T08:18:02+02:00</published><updated>2013-10-02T08:18:02+02:00</updated><id>https://www.xavierdecoster.com/post/2013/10/02/awarded-mvp-visual-studio-alm</id><content type="html" xml:base="https://www.xavierdecoster.com/post/2013/10/02/awarded-mvp-visual-studio-alm.html"><![CDATA[<p>I was quite thrilled and surprised yesterday to receive an email notification with the subject "<i>Congratulations 2013 Microsoft MVP!</i>".<br /></p>

<div style="text-align:center;"><img src="/images/MVP-Logo.png" alt="MVP Logo" /></div>

<p>I'm really honored to receive this award and find great satisfaction in the fact that Microsoft and the Community are appreciating my efforts to share experiences and insights in terms of NuGet, Visual Studio and ALM in general.</p>

<p>I hope to keep up to your expectations and deliver quality in everything I do, and I'm really looking forward to see what the next 12 months will bring. Challenge accepted! :-)</p>

<p>Thank you Microsoft for the <a href="http://mvp.microsoft.com/en-us/overview.aspx" target="_blank">MVP award</a>. Thank you <a href="http://www.microsoft.com/belux/meet/" target="_blank">MEET</a> for the awesome work you do! Thank you Community for a great collaboration and for giving me the opportunity to grow as a developer and as a person. Thanks to everyone who supported me in my efforts, including family and friends, colleagues, MVPs and many more!</p>]]></content><author><name>Xavier Decoster</name></author><category term="post" /><category term="ALM" /><category term="Visual Studio" /><category term="MVP" /><category term="Community" /><summary type="html"><![CDATA[I was quite thrilled and surprised yesterday to receive an email notification with the subject "Congratulations 2013 Microsoft MVP!".]]></summary></entry><entry><title type="html">Install-NuSpec with IntelliSense</title><link href="https://www.xavierdecoster.com/post/2013/09/26/install-nuspec-with-intellisense.html" rel="alternate" type="text/html" title="Install-NuSpec with IntelliSense" /><published>2013-09-26T14:33:33+02:00</published><updated>2013-09-26T14:33:33+02:00</updated><id>https://www.xavierdecoster.com/post/2013/09/26/install-nuspec-with-intellisense</id><content type="html" xml:base="https://www.xavierdecoster.com/post/2013/09/26/install-nuspec-with-intellisense.html"><![CDATA[<p>If you have quite a few projects you want to get out on NuGet for the first time, it can be a little confusing to find a good starting point. My recommendation usually is to simply create a <a href="http://docs.nuget.org/docs/reference/nuspec-reference#Replacement_Tokens" target="_blank">tokenized</a> NuSpec and package your projects. Target a csproj file, and make sure there's a nuspec file in the same directory with the same name as the csproj file. NuGet will merge the two during package creation.</p>

<p>If you hate manipulating the file system for a single project, imagine doing this for 50 projects. Let's automate this task and preferably without leaving our Visual Studio environment. There's the NuGet Package Manager Console after all.</p>

<p>Well, there you go: <b>Install-Package NuSpec</b><br />
<a href="https://github.com/myget/NuGetPackages/releases/tag/v3.0.0" target="_blank">Sources on GitHub</a></p>

<p>This package will install itself in the NuGet PowerShell profile, so you can immediately uninstall it, the new cmdlets will still be available. The following new cmdlets are available:</p>

<ul>
<li><b>Install-NuSpec</b> <i>&lt;ProjectName&gt; [-EnableIntelliSense] [-TemplatePath]</i></li>
<li><b>Enable-NuSpecIntelliSense</b></li>
</ul>

<p>Happy Packaging!</p>]]></content><author><name>Xavier Decoster</name></author><category term="post" /><category term="NuGet" /><category term="Visual Studio" /><category term="Package Management" /><summary type="html"><![CDATA[If you have quite a few projects you want to get out on NuGet for the first time, it can be a little confusing to find a good starting point. My recommendation usually is to simply create a tokenized NuSpec and package your projects. Target a csproj file, and make sure there's a nuspec file in the same directory with the same name as the csproj file. NuGet will merge the two during package creation.]]></summary></entry><entry><title type="html">How to: NuGet Package Restore when sharing projects between solutions</title><link href="https://www.xavierdecoster.com/post/2013/07/23/how-to-nuget-package-restore-when-sharing-projects-between-solutions.html" rel="alternate" type="text/html" title="How to: NuGet Package Restore when sharing projects between solutions" /><published>2013-07-23T00:00:00+02:00</published><updated>2013-07-23T00:00:00+02:00</updated><id>https://www.xavierdecoster.com/post/2013/07/23/how-to-nuget-package-restore-when-sharing-projects-between-solutions</id><content type="html" xml:base="https://www.xavierdecoster.com/post/2013/07/23/how-to-nuget-package-restore-when-sharing-projects-between-solutions.html"><![CDATA[<p><p>Although it is a situation I try to avoid, it is not uncommon to share project files between solutions. If you are using NuGet package restore on these solutions, and one or more of these shared projects is consuming NuGet packages, you'll likely hit issues. <a href="http://stackoverflow.com/questions/17797052/nuget-not-getting-missing-packages">This StackOverflow question</a> is an illustration of exactly this problem.
</p><h1>Symptoms
</h1><p>Developer A:
</p>

<blockquote><p> "I can't compile Solution2 anymore after pulling the latest version!"
</p>

</blockquote>

<p>Followed by:
</p>

<blockquote><p>"That's strange… it works on my machine." – Developer B
</p>

</blockquote>

<p>Instantly followed by handing out a Pink Sombrero™ to Developer B: (yes, you broke the build! Hopefully…)
</p><p><img src="/get/072313_2304_HowtoNuGetP1_635102175057965339.jpg" alt="" />
    </p><p>Many teams have lost time debugging this issue, and although I already have quite <a href="/debugging-nuget-package-restore">an exhaustive checklist</a>, this particular issue is not covered as I never really had to deal with this one. I prefer to consume the NuGet package instead of sharing the project…
</p><h1>Example
</h1><p>Behold the following sample folder structure containing 2 solutions. <code>Solution2.sln</code> also references the existing <code>Library1.csproj</code> file (note that it is not inside the solution's root directory):
</p><p><img src="/get/072313_2304_HowtoNuGetP2_635102175062339946.png" alt="" />
    </p><p>Both solutions have package restore enabled. Solution1.sln has no issues at all.
</p><p><code>Solution2.sln</code> cannot build, because the referenced <code>Library1.csproj</code> project cannot reference its packages. This is tricky: <strong>package restore did work</strong>! But by convention, the packages consumed by <code>Library1.csproj</code> got installed into the solution's Packages folder, which in this case is <code>Solution2\Packages</code>. Package restore (behind the scenes <code>nuget.exe install</code> – horrible command name mismatch) does not <em>install</em> any packages: it downloads and extracts them. None of the package scripts are run, no content is injected, no references added.
</p><p>If you locally have both solutions and you restored the packages consumed by <code>Solution1.sln</code>, then you'll be in the situation of Developer B where <em>it works on your machine</em>. However, Developer A who only opened Solution2 and never built Solution1 will get build failures (as will the build server).
</p><h1>Root Cause
</h1><ol><li>NuGet Package Restore is MSBuild-based at the moment. It is being redesigned so I expect great improvements in the foreseeable future.
</li><li>You're sharing projects and code between solutions. Why not package them instead? Wait, here comes the "debugging experience complex"… It is so convenient to just reference the damn code. I agree within the scope of a <span style="text-decoration:underline">single</span> solution.
</li></ol><p>Sharing between multiple solutions? Here's the deal: set up continuous (package) delivery and use <a href="http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-symbol-package">symbols packages</a> (or a symbols server as the one built-in to TFS). You can use <a href="http://www.symbolsource.org">SymbolSource.org</a> or <a href="/setting-up-your-own-symbolsource-server-step-by-step">set up your own SymbolSource Server</a>. If you need more in order to debug your solution, then frankly you might want to rethink what you're sharing here… This smells like tight coupling and a missed opportunity to share a package.
</p><h1>Patching up the open wound
</h1><p>Although I'd strongly recommend taking a closer look at these projects you're sharing, a short term solution to your problem is also MSBuild-based. You'll need to tweak the package restore command per project. The easiest way to do this is by introducing a new MSBuild property and only deviate from the default conventions when absolutely required. The projects that will require a deviation are those that are being shared obviously.
</p><p>If you disregard the concerns I raised earlier in this post, then here's what I would do to fix this mess (quick-n-dirty style):
</p><ul><li>In <code>Solution1.nuget\nuget.targets</code>, add the following MSBuild property before the <code>&lt;RestoreCommand&gt;</code> element:
</li></ul><p><pre><span style="color:blue">&lt;</span><span style="color:#a31515">PackageRestoreDir </span><span style="color:red">Condition</span>=<span style="color:black">"</span>$(PackageRestoreDir) == ''<span style="color:black">"</span><span style="color:blue">&gt;</span><span style="color:black">$(SolutionDir)\Packages</span><span style="color:blue">&lt;</span>/<span style="color:#a31515">PackageRestoreDir</span><span style="color:blue">&gt;</span></pre></p><ul><li>Within the same file, update the &lt;RestoreCommand&gt; by appending the following:
</li></ul><p><pre><span style="color:blue">&lt;</span><span style="color:#a31515">RestoreCommand<span style="color:blue">&gt;</span><span style="color:black">$(NuGetCommand) install … -o "$(PackageRestoreDir) "<span style="color:blue">&lt;</span>/</span><span style="color:#a31515">RestoreCommand<span style="color:blue">&gt;</span></span></span></pre></p><ul><li>In the Library1.csproj file, add the following MSBuild property (mind the order of precedence with &lt;SolutionDir&gt;):
</li></ul><p><pre><span style="color:blue">&lt;</span><span style="color:#a31515">SolutionDir </span><span style="color:red">Condition</span>=<span style="color:black">"</span>$(SolutionDir) == '' Or $(SolutionDir) == '<em>Undefined</em>'<span style="color:black">"</span><span style="color:blue">&gt;</span><span style="color:black">..\</span><span style="color:blue">&lt;</span>/<span style="color:#a31515">SolutionDir</span><span style="color:blue">&gt;</span><span style="color:black"></span><br /><span style="color:blue">&lt;</span><span style="color:#a31515">RestorePackages</span><span style="color:blue">&gt;</span><span style="color:black">true</span><span style="color:blue">&lt;</span>/<span style="color:#a31515">RestorePackages</span><span style="color:blue">&gt;</span><span style="color:black"></span><br /><span style="color:blue">&lt;</span><span style="color:#a31515">PackageRestoreDir</span><span style="color:blue">&gt;</span><span style="color:black">$(SolutionDir)..\Libraries\Packages</span><span style="color:blue">&lt;</span>/<span style="color:#a31515">PackageRestoreDir</span><span style="color:blue">&gt;</span></pre></p><p>Repeat the last step for each existing shared project you referenced in your second solution. The <code>&lt;PackageRestoreDir&gt;</code> should match the project reference and the default package restore directory of the main solution of that project.</p><p>You can download a sample solution <a href="/images/2013-07-24/multisolutionroot.zip">here</a>.
</p><p>Happy packaging!</p></p>]]></content><author><name>Xavier Decoster</name></author><category term="post" /><category term="ALM" /><category term="NuGet" /><category term="Package Management" /><summary type="html"><![CDATA[Although it is a situation I try to avoid, it is not uncommon to share project files between solutions. If you are using NuGet package restore on these solutions, and one or more of these shared projects is consuming NuGet packages, you'll likely hit issues. This StackOverflow question is an illustration of exactly this problem. Symptoms Developer A: "I can't compile Solution2 anymore after pulling the latest version!" Followed by: "That's strange… it works on my machine." – Developer B Instantly followed by handing out a Pink Sombrero™ to Developer B: (yes, you broke the build! Hopefully…) Many teams have lost time debugging this issue, and although I already have quite an exhaustive checklist, this particular issue is not covered as I never really had to deal with this one. I prefer to consume the NuGet package instead of sharing the project… Example Behold the following sample folder structure containing 2 solutions. Solution2.sln also references the existing Library1.csproj file (note that it is not inside the solution's root directory): Both solutions have package restore enabled. Solution1.sln has no issues at all. Solution2.sln cannot build, because the referenced Library1.csproj project cannot reference its packages. This is tricky: package restore did work! But by convention, the packages consumed by Library1.csproj got installed into the solution's Packages folder, which in this case is Solution2\Packages. Package restore (behind the scenes nuget.exe install – horrible command name mismatch) does not install any packages: it downloads and extracts them. None of the package scripts are run, no content is injected, no references added. If you locally have both solutions and you restored the packages consumed by Solution1.sln, then you'll be in the situation of Developer B where it works on your machine. However, Developer A who only opened Solution2 and never built Solution1 will get build failures (as will the build server). Root Cause NuGet Package Restore is MSBuild-based at the moment. It is being redesigned so I expect great improvements in the foreseeable future. You're sharing projects and code between solutions. Why not package them instead? Wait, here comes the "debugging experience complex"… It is so convenient to just reference the damn code. I agree within the scope of a single solution. Sharing between multiple solutions? Here's the deal: set up continuous (package) delivery and use symbols packages (or a symbols server as the one built-in to TFS). You can use SymbolSource.org or set up your own SymbolSource Server. If you need more in order to debug your solution, then frankly you might want to rethink what you're sharing here… This smells like tight coupling and a missed opportunity to share a package. Patching up the open wound Although I'd strongly recommend taking a closer look at these projects you're sharing, a short term solution to your problem is also MSBuild-based. You'll need to tweak the package restore command per project. The easiest way to do this is by introducing a new MSBuild property and only deviate from the default conventions when absolutely required. The projects that will require a deviation are those that are being shared obviously. If you disregard the concerns I raised earlier in this post, then here's what I would do to fix this mess (quick-n-dirty style): In Solution1.nuget\nuget.targets, add the following MSBuild property before the &lt;RestoreCommand&gt; element: &lt;PackageRestoreDir Condition="$(PackageRestoreDir) == ''"&gt;$(SolutionDir)\Packages&lt;/PackageRestoreDir&gt;Within the same file, update the &lt;RestoreCommand&gt; by appending the following: &lt;RestoreCommand&gt;$(NuGetCommand) install … -o "$(PackageRestoreDir) "&lt;/RestoreCommand&gt;In the Library1.csproj file, add the following MSBuild property (mind the order of precedence with &lt;SolutionDir&gt;): &lt;SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == 'Undefined'"&gt;..\&lt;/SolutionDir&gt;&lt;RestorePackages&gt;true&lt;/RestorePackages&gt;&lt;PackageRestoreDir&gt;$(SolutionDir)..\Libraries\Packages&lt;/PackageRestoreDir&gt;Repeat the last step for each existing shared project you referenced in your second solution. The &lt;PackageRestoreDir&gt; should match the project reference and the default package restore directory of the main solution of that project.You can download a sample solution here. Happy packaging!]]></summary></entry><entry><title type="html">Commit, Push, Consume: continuous delivery of ReSharper extensions</title><link href="https://www.xavierdecoster.com/post/2013/05/10/commit-push-consume-continuous-delivery-of-resharper-extensions.html" rel="alternate" type="text/html" title="Commit, Push, Consume: continuous delivery of ReSharper extensions" /><published>2013-05-10T13:07:00+02:00</published><updated>2013-05-10T13:07:00+02:00</updated><id>https://www.xavierdecoster.com/post/2013/05/10/commit-push-consume-continuous-delivery-of-resharper-extensions</id><content type="html" xml:base="https://www.xavierdecoster.com/post/2013/05/10/commit-push-consume-continuous-delivery-of-resharper-extensions.html"><![CDATA[<p><p>I've recently <a href="/a-resharper-plugin-to-detect-suspicious-semicolons-in-razor-views">announced my ReSharper Razor plugin</a> and published the EAP package to the brand new ReSharper Plugin feed. I've originally built it against the ReSharper 7 SDK and only recently added support for the <a href="http://confluence.jetbrains.com/display/ReSharper/ReSharper+8+EAP">ReSharper 8 EAP SDK</a>. One of the questions I asked myself when I built the R# 7 version was: how do I ship it? I was quite thrilled to receive an email from Matt Ellis (<a href="https://twitter.com/citizenmatt">@citizenmatt</a>) inviting me to take a look at the latest SDK bits which included the new NuGet-based Extension Manager! In this post I want to show you how I'm using free tools to develop, build, package, test &amp; publish a ReSharper plugin.
</p><h1>The missing link?
</h1><p>The plugin obviously is open source. The source repository for this plugin can be found on GitHub: <a href="https://github.com/xavierdecoster/ReSharper.RazorExtensions">https://github.com/xavierdecoster/ReSharper.RazorExtensions</a>.
</p><p>One of the first things I do when starting a new project is setting up Continuous Integration. Yes! Even for a little OSS pet project! In this case, the output of my build should be a NuGet package containing the plugin, so I need a repository to serve these CI packages for consumption to facilitate testing. Each GitHub repository has this great feature called <a href="https://help.github.com/articles/post-receive-hooks"><em>Post-Receive Hooks</em></a> which allows you to trigger another service whenever someone commits to the repository. Sounds useful, right?
</p><p>Let's rephrase that: whenever GitHub triggers a service, it should <em>build</em> the sources, <em>package</em> the plugin and <em>publish</em> it on a NuGet feed for consumption. I know another free service for that: <a href="http://www.myget.org/">MyGet</a>!
</p><p>MyGet "Wonka" <a href="http://blog.myget.org/post/2013/03/22/Whats-new-in-Build-Services.aspx">Build Services</a> allows you to connect your GitHub repository to a MyGet feed. It is designed to take care of building, testing, packaging and publishing <em>consumables</em>. I like to think in terms of <em>consumables</em> and <em>consumers</em>: don't try to build and package your enterprise web sites on there. We're likely missing some fancy SDKs anyway and we refuse to install Visual Studio <span style="font-family:Wingdings">J</span> For this scenario however it's perfect! But I'm biased <span style="font-family:Wingdings">J</span>
    </p><h1>Connecting the services
</h1><p>To develop a ReSharper plugin you need to reference the ReSharper SDK. It's not available on NuGet, so you'll need to download the MSI. It comes with some nice project and item templates for Visual Studio, and the SDK is quite large. My plugin only used a limited set of binaries from this SDK so I decided to commit them into Git (yeah, I know, bite me…). It's for the greater good, as the SDK won't be installed on the build agent and isn't available as a NuGet package to restore.
</p><p>When you're a MyGet feed owner, you can add and configure a <em>build source</em> for your feed. Click on the <em>Add from GitHub</em> button and select the repository you want.
</p><p><img src="/get/043013_2028_CommitPushC1_635029505354155325.png" alt="" style="max-width:600px;" />
    </p><p>You'll need to authorize MyGet to get access to your GitHub repository, and you'll be prompted with a dialog to select the repository you want to connect to.
</p><p><img src="/get/043013_2028_CommitPushC2_635029505359311245.png" alt="" style="max-width:600px;" />
    </p><p>We'll select the master branch by default, but you can obviously change that if you want. You don't need to edit anything else on this build source for now as you're already presented with a HTTP POST hook URL.
</p><p><img src="/get/043013_2028_CommitPushC3_635029505361654845.png" alt="" style="max-width:600px;" />
    </p><p>Next up, connect your build source to GitHub. Browse your GitHub repository settings and look for the Service Hooks tab. There you're able to enter a <em>WebHook URL</em> as shown below. This URL will be hit with a POST request whenever someone pushes to your GitHub repository and passes some information about the push event.
</p><p><img src="/get/043013_2028_CommitPushC4_635029505365248365.png" alt="" style="max-width:600px;" />
    </p><p>This provides enough information to MyGet in order to clone this repository and run a build. MyGet Build Services uses a conventional approach and selects one of the following artifacts in order of precedence:
</p><ol><li>Build.bat (or build.cmd or build.ps1)
</li><li>MyGet.sln
</li><li>Any other .sln
</li><li>All .csproj files (or other project types)
</li><li>All .nuspec files
</li></ol><p>It is up to you to ensure your repository is in a suitable format for an automated build. If you like full control over the build process, then you'll be happy to find a <a href="https://github.com/xavierdecoster/ReSharper.RazorExtensions/blob/master/build.bat">build.bat file in my repository</a>. That's it, whenever I push a commit to my GitHub repository, a MyGet build will be triggered: it will compile my sources, run any tests available, create a NuGet package for the plugin in the <a href="http://confluence.jetbrains.com/display/ReSharper/1.9+Packaging+%28R8%29">ReSharper plugin package format</a>, and push the package on my MyGet feed for consumption.
</p><h1>Consuming the plugin from a MyGet feed
</h1><p>Open the ReSharper Extension Manager (of all places, it's available in ReSharper &gt; Extension Manager), and click on <em>Settings</em>. Just as with the NuGet Visual Studio extension, the ReSharper Extension Manager allows you to configure any NuGet feed for consumption. Simply add your MyGet feed url into the list:
</p><p><img src="/get/043013_2028_CommitPushC5_635029505369623085.png" alt="" style="max-width:600px;" />
    </p><p>Save your settings and reopen the Extension Manager: you'll find your newly added feed in there. All CI packages you publish on that feed will be available for consumption.
</p><p><img src="/get/043013_2028_CommitPushC6_635029505374466525.png" alt="" style="max-width:600px;" />
    </p><p>Even better: ReSharper will notify you about available updates for your plugins!
</p><p><img src="/get/043013_2028_CommitPushC7_635029505377278845.png" alt="" style="max-width:600px;" />
    </p><h1>Release some!
</h1><p>As soon as you're satisfied with your plugin, you can release it to the masses. Here I'm going to use MyGet's <em>package sources</em> feature: any MyGet feed can have one or more upstream NuGet feeds. This allows for various scenarios such as aggregating feeds, filtering, proxying &amp; mirroring, but also <em>package promotion</em>.
</p><p>In order release a CI package, you need to promote a package to the ReSharper Plugin feed (and optionally change the package version, e.g. strip the pre-release tag). To be able to do this, you first have to configure the ReSharper plugin feed as an upstream package source. We just <a href="http://blog.myget.org/post/2013/04/29/Create-a-list-of-favorite-ReSharper-plugins.aspx">announced the availability of a new <em>preset</em></a> for this on the MyGet blog.
</p><p>Browse to your feed settings and select the Package Sources tab. Select <em>Add Package Source</em> and click on the <em>Preset</em> button in the top-left of the dialog. You'll find a new <em>ReSharper extension gallery</em> preset. Don't forget to configure your API key for the <a href="http://resharper-plugins.jetbrains.com/">ReSharper Gallery</a> or your package can't be pushed upstream as the request would be unauthorized.
</p><p><img src="/get/043013_2028_CommitPushC8_635029505380559885.png" alt="" style="max-width:600px;" />
    </p><p>Whenever you want to release a new version for consumption, simply promote your package to the release repository with a click of a button.<br />
<img src="/images/2013-05-10_1504.png" style="max-width:600px;" alt="" />
</p><h1>Conclusion
</h1><p>Matt and the ReSharper team have really done a great job by adopting NuGet as a protocol for distributing plugins. It makes these plugins more discoverable and it's a breeze to install them or keep them up to date. As a plugin author (actually, any OSS developer), you should really leverage all the (often free for OSS!) tooling available: many organizations can only dream of such a streamlined development workflow. Releasing a new version of my plugin is really just a commit (or a pull request) away! Commit, push &amp; consume!</p></p>]]></content><author><name>Xavier Decoster</name></author><category term="post" /><category term="ReSharper" /><category term="Visual Studio" /><category term="NuGet" /><category term="Package Management" /><summary type="html"><![CDATA[I've recently announced my ReSharper Razor plugin and published the EAP package to the brand new ReSharper Plugin feed. I've originally built it against the ReSharper 7 SDK and only recently added support for the ReSharper 8 EAP SDK. One of the questions I asked myself when I built the R# 7 version was: how do I ship it? I was quite thrilled to receive an email from Matt Ellis (@citizenmatt) inviting me to take a look at the latest SDK bits which included the new NuGet-based Extension Manager! In this post I want to show you how I'm using free tools to develop, build, package, test &amp; publish a ReSharper plugin. The missing link? The plugin obviously is open source. The source repository for this plugin can be found on GitHub: https://github.com/xavierdecoster/ReSharper.RazorExtensions. One of the first things I do when starting a new project is setting up Continuous Integration. Yes! Even for a little OSS pet project! In this case, the output of my build should be a NuGet package containing the plugin, so I need a repository to serve these CI packages for consumption to facilitate testing. Each GitHub repository has this great feature called Post-Receive Hooks which allows you to trigger another service whenever someone commits to the repository. Sounds useful, right? Let's rephrase that: whenever GitHub triggers a service, it should build the sources, package the plugin and publish it on a NuGet feed for consumption. I know another free service for that: MyGet! MyGet "Wonka" Build Services allows you to connect your GitHub repository to a MyGet feed. It is designed to take care of building, testing, packaging and publishing consumables. I like to think in terms of consumables and consumers: don't try to build and package your enterprise web sites on there. We're likely missing some fancy SDKs anyway and we refuse to install Visual Studio J For this scenario however it's perfect! But I'm biased J Connecting the services To develop a ReSharper plugin you need to reference the ReSharper SDK. It's not available on NuGet, so you'll need to download the MSI. It comes with some nice project and item templates for Visual Studio, and the SDK is quite large. My plugin only used a limited set of binaries from this SDK so I decided to commit them into Git (yeah, I know, bite me…). It's for the greater good, as the SDK won't be installed on the build agent and isn't available as a NuGet package to restore. When you're a MyGet feed owner, you can add and configure a build source for your feed. Click on the Add from GitHub button and select the repository you want. You'll need to authorize MyGet to get access to your GitHub repository, and you'll be prompted with a dialog to select the repository you want to connect to. We'll select the master branch by default, but you can obviously change that if you want. You don't need to edit anything else on this build source for now as you're already presented with a HTTP POST hook URL. Next up, connect your build source to GitHub. Browse your GitHub repository settings and look for the Service Hooks tab. There you're able to enter a WebHook URL as shown below. This URL will be hit with a POST request whenever someone pushes to your GitHub repository and passes some information about the push event. This provides enough information to MyGet in order to clone this repository and run a build. MyGet Build Services uses a conventional approach and selects one of the following artifacts in order of precedence: Build.bat (or build.cmd or build.ps1) MyGet.sln Any other .sln All .csproj files (or other project types) All .nuspec files It is up to you to ensure your repository is in a suitable format for an automated build. If you like full control over the build process, then you'll be happy to find a build.bat file in my repository. That's it, whenever I push a commit to my GitHub repository, a MyGet build will be triggered: it will compile my sources, run any tests available, create a NuGet package for the plugin in the ReSharper plugin package format, and push the package on my MyGet feed for consumption. Consuming the plugin from a MyGet feed Open the ReSharper Extension Manager (of all places, it's available in ReSharper &gt; Extension Manager), and click on Settings. Just as with the NuGet Visual Studio extension, the ReSharper Extension Manager allows you to configure any NuGet feed for consumption. Simply add your MyGet feed url into the list: Save your settings and reopen the Extension Manager: you'll find your newly added feed in there. All CI packages you publish on that feed will be available for consumption. Even better: ReSharper will notify you about available updates for your plugins! Release some! As soon as you're satisfied with your plugin, you can release it to the masses. Here I'm going to use MyGet's package sources feature: any MyGet feed can have one or more upstream NuGet feeds. This allows for various scenarios such as aggregating feeds, filtering, proxying &amp; mirroring, but also package promotion. In order release a CI package, you need to promote a package to the ReSharper Plugin feed (and optionally change the package version, e.g. strip the pre-release tag). To be able to do this, you first have to configure the ReSharper plugin feed as an upstream package source. We just announced the availability of a new preset for this on the MyGet blog. Browse to your feed settings and select the Package Sources tab. Select Add Package Source and click on the Preset button in the top-left of the dialog. You'll find a new ReSharper extension gallery preset. Don't forget to configure your API key for the ReSharper Gallery or your package can't be pushed upstream as the request would be unauthorized. Whenever you want to release a new version for consumption, simply promote your package to the release repository with a click of a button. Conclusion Matt and the ReSharper team have really done a great job by adopting NuGet as a protocol for distributing plugins. It makes these plugins more discoverable and it's a breeze to install them or keep them up to date. As a plugin author (actually, any OSS developer), you should really leverage all the (often free for OSS!) tooling available: many organizations can only dream of such a streamlined development workflow. Releasing a new version of my plugin is really just a commit (or a pull request) away! Commit, push &amp; consume!]]></summary></entry><entry><title type="html">A ReSharper plugin to detect suspicious semicolons in Razor views</title><link href="https://www.xavierdecoster.com/post/2013/04/30/a-resharper-plugin-to-detect-suspicious-semicolons-in-razor-views.html" rel="alternate" type="text/html" title="A ReSharper plugin to detect suspicious semicolons in Razor views" /><published>2013-04-30T17:06:00+02:00</published><updated>2013-04-30T17:06:00+02:00</updated><id>https://www.xavierdecoster.com/post/2013/04/30/a-resharper-plugin-to-detect-suspicious-semicolons-in-razor-views</id><content type="html" xml:base="https://www.xavierdecoster.com/post/2013/04/30/a-resharper-plugin-to-detect-suspicious-semicolons-in-razor-views.html"><![CDATA[<p><p>I must admit, every now and then I find myself typing yet another semicolon in one of my razor views. I usually also hit the backspace key immediately after. But sometimes, a lone wolf semicolon gets through and is rendered in the resulting HTML page. I HATE this! It's the most silly bug report you'll ever spend time on. The effort-value ratio of filing the bug and resolving it is far below zero, but as it is a UI issue it most likely will get prioritized over other more important stuff. It's still waste. <a href="http://www.jetbrains.com/resharper/">ReSharper</a> is great at reducing waste, so I figured it'd be a good idea to have a ReSharper code inspection to highlight these semicolons and generate warnings. To my surprise I found this wasn't built-in so the idea of a plug-in was born.
</p><p>I've built <a href="https://github.com/xavierdecoster/Resharper-XML-Minifier">a very simple XML-minification plug-in for ReSharper</a> before, but didn't really plan the time for building another one. The <a href="http://www.jetbrains.com/resharper/download/">ReSharper SDK</a> is quite awesome, though it could use some more loose-coupling and perhaps be <em>NuGetized</em>? I popped the idea on Twitter to see if people would think it's useful or not, and in the hopes to find someone who had the time or was willing to assist. A huge thanks to Matt Ellis (<a href="https://twitter.com/citizenmatt">@citizenmatt</a>) and Igal Tabachnik (<a href="https://twitter.com/hmemcpy">@hmemcpy</a>) for your enthousiasm and sharing some very useful <a href="http://t.co/M369JEySWS">pointers</a> on how this plug-in could be implemented! Your input made it look like a no-brainer so I figured it couldn't harm to spend half-an-hour on it.
</p><p>The idea was to build a custom <a href="http://confluence.jetbrains.com/display/ReSharper/2.4+Daemons+and+Daemon+Stages+(R7)"><em>daemon</em></a> to analyze HTML <em>tokens</em> within a Razor file. Razor files can contain HTML, JavaScript, Razor-syntax, C#, CSS… and hence are considered a <a href="http://confluence.jetbrains.com/display/ReSharper/3.4+Multi-Language+PSI+(R7)">multi-language PSI</a> file. Bear with me, it's actually pretty straightforward and there's a great sample daemon implementation included in the SDK as well. It's a matter of understanding the concepts, reading the sample code, writing some similar code and hitting F5 a few times to debug your own implementation. This plug-in is only 5 classes!
</p><p>The SDK comes with a set of project and item-templates, pre-configured to provide the necessary "devenv.exe /ReSharper.Internal" instructions to unlock some ReSharper internal utilities in the Visual Studio instance you'll be debugging. The PSI Browser is a kind of document explorer and provides a ton of information on each element, character and its context within the file.
</p><p>That's how I found out I only needed to inspect the HTML tokens. It also showed me that a <em>whitespace</em> character is a separate token, thus splitting up HTML tokens containing text. Finding the <em>suspicious semicolon</em> (usually at the end of a Razor statement and at the beginning of meaningful HTML tokens) is as easy as finding the HTML token that only contains a single semicolon character. This covers about 95% of semicolon mistakes I believe, which is good enough for me at the moment. I also didn't want this plug-in to generate warnings for the semicolon character in code snippets, in <a href="http://www.w3schools.com/tags/ref_entities.asp">HTML entities</a> (such as <em>&amp;copy; </em>for instance), or in smileys ;-).
</p><p>This plug-in will provide warnings and highlighting when a suspicious semicolon has been detected in a Razor view, and a quick-fix to get rid of it ALT-ENTER-style.
</p><p><img src="/get/040913_0959_AReSharperp1_635010983939422428.jpg" alt="" style="max-width:600px;" />
    </p><p>Just file an issue on my <a href="https://github.com/xavierdecoster/ReSharper.RazorExtensions">GitHub repo</a> if you find something fishy, and note that I accept pull requests (and will happily add your name to the Author's tag of the NuGet package that this plug-in will ship in).
</p><p>JetBrains just <a href="http://blogs.jetbrains.com/dotnet/2013/04/new-features-in-the-latest-resharper-8-ea/" target="_blank">announced</a> the new ReSharper Extension Manager using a NuGet feed which is now <a href="http://blog.myget.org/post/2013/04/29/Create-a-list-of-favorite-ReSharper-plugins.aspx" target="_blank">also available as a package source preset on MyGet</a>. For those interested: I've hooked up my GitHub repository with my <a href="http://www.myget.org">MyGet</a> feed's POST hook, so I can automatically package-n-publish the plug-in for testing and release it with a click of a button. I'll do a follow-up post on how I did this, but for those who can't wait, there's useful info in <a href="http://blog.myget.org/post/2013/03/06/MyGet-Build-Services-Package-Versioning-Explained.aspx">this blog post</a> (I'm using a <a href="https://github.com/xavierdecoster/ReSharper.RazorExtensions/blob/master/build.bat">build.bat</a> file to hook into the build process).
</p><p>
To install my ReSharper extension, you need ReSharper 8 EAP or higher. For those on an earlier version of ReSharper, check for a compatible download in my GitHub repository.</p>
<img src="/images/2013-04-30/2013-04-29_1901.png" style="max-width:600px" /></p>

<p>Installing ReSharper plug-ins shipped as NuGet packages and get notifications about available updates: killer feature if you ask me!</p>]]></content><author><name>Xavier Decoster</name></author><category term="post" /><category term="ReSharper" /><category term="Visual Studio" /><category term="Open source" /><summary type="html"><![CDATA[I must admit, every now and then I find myself typing yet another semicolon in one of my razor views. I usually also hit the backspace key immediately after. But sometimes, a lone wolf semicolon gets through and is rendered in the resulting HTML page. I HATE this! It's the most silly bug report you'll ever spend time on. The effort-value ratio of filing the bug and resolving it is far below zero, but as it is a UI issue it most likely will get prioritized over other more important stuff. It's still waste. ReSharper is great at reducing waste, so I figured it'd be a good idea to have a ReSharper code inspection to highlight these semicolons and generate warnings. To my surprise I found this wasn't built-in so the idea of a plug-in was born. I've built a very simple XML-minification plug-in for ReSharper before, but didn't really plan the time for building another one. The ReSharper SDK is quite awesome, though it could use some more loose-coupling and perhaps be NuGetized? I popped the idea on Twitter to see if people would think it's useful or not, and in the hopes to find someone who had the time or was willing to assist. A huge thanks to Matt Ellis (@citizenmatt) and Igal Tabachnik (@hmemcpy) for your enthousiasm and sharing some very useful pointers on how this plug-in could be implemented! Your input made it look like a no-brainer so I figured it couldn't harm to spend half-an-hour on it. The idea was to build a custom daemon to analyze HTML tokens within a Razor file. Razor files can contain HTML, JavaScript, Razor-syntax, C#, CSS… and hence are considered a multi-language PSI file. Bear with me, it's actually pretty straightforward and there's a great sample daemon implementation included in the SDK as well. It's a matter of understanding the concepts, reading the sample code, writing some similar code and hitting F5 a few times to debug your own implementation. This plug-in is only 5 classes! The SDK comes with a set of project and item-templates, pre-configured to provide the necessary "devenv.exe /ReSharper.Internal" instructions to unlock some ReSharper internal utilities in the Visual Studio instance you'll be debugging. The PSI Browser is a kind of document explorer and provides a ton of information on each element, character and its context within the file. That's how I found out I only needed to inspect the HTML tokens. It also showed me that a whitespace character is a separate token, thus splitting up HTML tokens containing text. Finding the suspicious semicolon (usually at the end of a Razor statement and at the beginning of meaningful HTML tokens) is as easy as finding the HTML token that only contains a single semicolon character. This covers about 95% of semicolon mistakes I believe, which is good enough for me at the moment. I also didn't want this plug-in to generate warnings for the semicolon character in code snippets, in HTML entities (such as &amp;copy; for instance), or in smileys ;-). This plug-in will provide warnings and highlighting when a suspicious semicolon has been detected in a Razor view, and a quick-fix to get rid of it ALT-ENTER-style. Just file an issue on my GitHub repo if you find something fishy, and note that I accept pull requests (and will happily add your name to the Author's tag of the NuGet package that this plug-in will ship in). JetBrains just announced the new ReSharper Extension Manager using a NuGet feed which is now also available as a package source preset on MyGet. For those interested: I've hooked up my GitHub repository with my MyGet feed's POST hook, so I can automatically package-n-publish the plug-in for testing and release it with a click of a button. I'll do a follow-up post on how I did this, but for those who can't wait, there's useful info in this blog post (I'm using a build.bat file to hook into the build process). To install my ReSharper extension, you need ReSharper 8 EAP or higher. For those on an earlier version of ReSharper, check for a compatible download in my GitHub repository.]]></summary></entry></feed>