<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jim Buck</title>
    <description>The latest articles on DEV Community by Jim Buck (@jimbuck).</description>
    <link>https://dev.to/jimbuck</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F170071%2Fd2474899-860e-4ca4-872a-bc1ab0c55b38.png</url>
      <title>DEV Community: Jim Buck</title>
      <link>https://dev.to/jimbuck</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jimbuck"/>
    <language>en</language>
    <item>
      <title>Demystifying the ASP.NET Core Request Pipeline: Part 1 - Receiving Requests</title>
      <dc:creator>Jim Buck</dc:creator>
      <pubDate>Fri, 12 Jul 2019 18:31:01 +0000</pubDate>
      <link>https://dev.to/jimbuck/demystifying-the-asp-net-core-request-pipeline-part-1-receiving-requests-i02</link>
      <guid>https://dev.to/jimbuck/demystifying-the-asp-net-core-request-pipeline-part-1-receiving-requests-i02</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;This is Part 1 of a 3 part series on the ASP.NET Core Request Pipeline. Check back here for links to the follow-up articles!&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://jimbuck.io/asp-net-core-req-pipe-0" rel="noopener noreferrer"&gt;Preface&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Part I - Receiving Requests&lt;/li&gt;
&lt;li&gt;Part II - &lt;em&gt;Coming Soon&lt;/em&gt;
&lt;/li&gt;
&lt;li&gt;Part III - &lt;em&gt;Coming Soon&lt;/em&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1543674892-7d64d45df18b%3Fixlib%3Drb-1.2.1%26q%3D80%26fm%3Djpg%26crop%3Dentropy%26cs%3Dtinysrgb%26w%3D1080%26fit%3Dmax%26ixid%3DeyJhcHBfaWQiOjExNzczfQ" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1543674892-7d64d45df18b%3Fixlib%3Drb-1.2.1%26q%3D80%26fm%3Djpg%26crop%3Dentropy%26cs%3Dtinysrgb%26w%3D1080%26fit%3Dmax%26ixid%3DeyJhcHBfaWQiOjExNzczfQ" alt="Demystifying the ASP.NET Core Request Pipeline: Part 1 - Receiving Requests"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For many developers the area between a browser request and a controller action is a land a of &lt;em&gt;mystery and magic&lt;/em&gt;. Any why shouldn't it be? In &lt;strong&gt;MVC/WebAPI and ASP.NET Core convention is king&lt;/strong&gt; when it comes to routing and controllers. As long your naming scheme follows convention, you can safely expect requests to magically hit your code.&lt;/p&gt;

&lt;p&gt;But what happens when you don't follow convention? Or when you need to support a more complex configuration that is not provided by out-of-the-box project templates? Don't be afraid, the &lt;strong&gt;request pipeline doesn't have to be a black box&lt;/strong&gt;. And having a solid understanding of the request pipeline can take you from &lt;strong&gt;zero to hero&lt;/strong&gt; by the end of the sprint.&lt;/p&gt;

&lt;p&gt;In this article I break down of each type of server implementation and outline their differences. Check out the &lt;code&gt;tl;dr&lt;/code&gt; table at the end for a quick summary. After that I outline some common scenarios and which implementation is best suited for the job.&lt;/p&gt;




&lt;h2&gt;
  
  
  Server Implementations
&lt;/h2&gt;

&lt;p&gt;When it comes to web apps, something must be listening on a port (typically 80 or 443) to receive the request. Listening for and maintaining connections to requests are the primary responsibilities of a web server. When it comes to ASP.NET Core, there are a few implementations and hosting models that &lt;strong&gt;each have their own benefits&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Standalone with Kestrel
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fjimbuck.io%2Fcontent%2Fimages%2F2019%2F07%2Fkestrel-standalone-1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fjimbuck.io%2Fcontent%2Fimages%2F2019%2F07%2Fkestrel-standalone-1.png" alt="Demystifying the ASP.NET Core Request Pipeline: Part 1 - Receiving Requests"&gt;&lt;/a&gt;Standalone Kestrel&lt;/p&gt;

&lt;p&gt;Kestrel is the &lt;strong&gt;light-weight, cross-platform web server&lt;/strong&gt; built specifically for ASP.NET Core. It's &lt;a href="https://github.com/aspnet/AspNetCore/tree/master/src/Servers/Kestrel" rel="noopener noreferrer"&gt;open source&lt;/a&gt;, can easily &lt;a href="https://msit.powerbi.com/view?r=eyJrIjoiYTZjMTk3YjEtMzQ3Yi00NTI5LTg5ZDItNmUyMGRlOTkwMGRlIiwidCI6IjcyZjk4OGJmLTg2ZjEtNDFhZi05MWFiLTJkN2NkMDExZGI0NyIsImMiOjV9" rel="noopener noreferrer"&gt;exceed 1M+ practical requests per second&lt;/a&gt;, and is the default when starting a new project for ASP.NET Core 3. Kestrel will listen on the specified hosts/ports and runs right within your web app.&lt;/p&gt;

&lt;p&gt;Once connections are made, the requests are handled directly by the request pipeline. &lt;strong&gt;It's a great option to use for new projects&lt;/strong&gt; since there are no additional dependencies and, even better, it works on Windows, Mac, AND Linux! I highly recommend using Kestrel during development and for open source projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Out-of-Process with IIS and Kestrel
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fjimbuck.io%2Fcontent%2Fimages%2F2019%2F07%2Fiis-out-of-process-2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fjimbuck.io%2Fcontent%2Fimages%2F2019%2F07%2Fiis-out-of-process-2.png" alt="Demystifying the ASP.NET Core Request Pipeline: Part 1 - Receiving Requests"&gt;&lt;/a&gt;Out-of-Process IIS with Kestrel&lt;/p&gt;

&lt;p&gt;When building enterprise server applications that run on Windows, you almost always will rely on the de facto web server: &lt;a href="https://www.iis.net/" rel="noopener noreferrer"&gt;IIS&lt;/a&gt;. Originally released for &lt;a href="https://support.microsoft.com/en-us/help/224609/how-to-obtain-versions-of-internet-information-server-iis#section-2" rel="noopener noreferrer"&gt;Windows NT&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/Internet_Information_Services#History" rel="noopener noreferrer"&gt;rewritten for Windows Server 2008&lt;/a&gt;, it's currently on version 10 and provides stability, security, and management tools for production applications. &lt;strong&gt;To say that IIS has been battle tested is a massive understatement.&lt;/strong&gt; And any enterprise developer/IT professional has probably relied on IIS at some point in there career.&lt;/p&gt;

&lt;p&gt;IIS Out-of-Process hosting uses IIS as a reverse proxy that forwards requests to your ASP.NET Core app running on Kestrel (thanks to &lt;a href="https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/aspnet-core-module" rel="noopener noreferrer"&gt;the ASP.NET Core Module&lt;/a&gt;). The primary benefit to this setup is the &lt;strong&gt;ability to host and configure a mix of .NET Framework and .NET Core apps&lt;/strong&gt;. This simplifies configuration for things like SSL, caching, and authentication since they can be shared across applications.&lt;/p&gt;

&lt;p&gt;Other reverse proxies can also be used (&lt;a href="https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-apache" rel="noopener noreferrer"&gt;Apache for Windows/Linux&lt;/a&gt;, and &lt;a href="https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx" rel="noopener noreferrer"&gt;Nginx for Linux&lt;/a&gt;). While they do provide support for other platforms, IIS provides dedicated support which will result in the best experience.&lt;/p&gt;

&lt;h3&gt;
  
  
  In-Process with IIS
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fjimbuck.io%2Fcontent%2Fimages%2F2019%2F07%2Fiis-in-process.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fjimbuck.io%2Fcontent%2Fimages%2F2019%2F07%2Fiis-in-process.png" alt="Demystifying the ASP.NET Core Request Pipeline: Part 1 - Receiving Requests"&gt;&lt;/a&gt;In-Process IIS&lt;/p&gt;

&lt;p&gt;Starting with ASP.NET Core 2.2 if you app targets .NET Core (not the full .NET Framework) then you can take advantage of in-process hosting. This means that the IIS worker process (&lt;code&gt;w3wp.exe&lt;/code&gt;) actually loads up the CoreCLR and your ASP.NET Core app &lt;strong&gt;in the same process&lt;/strong&gt;. This enables &lt;strong&gt;faster time to first byte&lt;/strong&gt; by allowing requests to be passed directly into the pipeline!&lt;/p&gt;

&lt;p&gt;This is improved performance does come at a cost. Only one application can be used per IIS Application Pool and there is no support for .NET Framework. But the benefit is &lt;strong&gt;2x-3x improved requests per second&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  HTTP.sys
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fjimbuck.io%2Fcontent%2Fimages%2F2019%2F07%2Fhttpsys.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fjimbuck.io%2Fcontent%2Fimages%2F2019%2F07%2Fhttpsys.png" alt="Demystifying the ASP.NET Core Request Pipeline: Part 1 - Receiving Requests"&gt;&lt;/a&gt;HTTP.sys&lt;/p&gt;

&lt;p&gt;&lt;a href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/servers/httpsys" rel="noopener noreferrer"&gt;HTTP.sys&lt;/a&gt; is a Windows-only web server focused on security and additional features (compared to Kestrel). &lt;strong&gt;Prior to ASP.NET Core 2.0, Kestrel was not secure enough to expose directly to the public internet&lt;/strong&gt;. HTTP.sys allowed apps to be accessible on the public web without the need for IIS. Additionally it provides a few features not available to Kestrel, such as Windows Authentication.&lt;/p&gt;

&lt;h3&gt;
  
  
  Custom OWIN-based Server
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fjimbuck.io%2Fcontent%2Fimages%2F2019%2F07%2Fcustom-owin.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fjimbuck.io%2Fcontent%2Fimages%2F2019%2F07%2Fcustom-owin.png" alt="Demystifying the ASP.NET Core Request Pipeline: Part 1 - Receiving Requests"&gt;&lt;/a&gt;Custom OWIN Server&lt;/p&gt;

&lt;p&gt;Custom servers can be used in the off chance that a feature is not supported in Kestrel/IIS or HTTP.sys. Conforming to the Open Web Interface for .NET (OWIN), these servers implement a set of interfaces used to manage and interact with ASP.NET Core apps. &lt;a href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/owin#using-aspnet-core-hosting-on-an-owin-based-server" rel="noopener noreferrer"&gt;You can learn about the &lt;code&gt;IServer&lt;/code&gt; interface and how to implement it here.&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  tl;dr
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Server Implementation&lt;/th&gt;
&lt;th&gt;Notes&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;In-process with IIS&lt;/td&gt;
&lt;td&gt;Maximum Performance, but for Windows only.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kestrel (standalone)&lt;/td&gt;
&lt;td&gt;Lightweight and cross-platform.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Out of process IIS with Kestrel&lt;/td&gt;
&lt;td&gt;Host alongside existing .NET Framework apps.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;HTTP.sys&lt;/td&gt;
&lt;td&gt;Advanced features, Windows only.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Custom OWIN Server&lt;/td&gt;
&lt;td&gt;Complete control, highest complexity.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

Summary of Server Implementations


&lt;h2&gt;
  
  
  Which Implementation is right for me?
&lt;/h2&gt;

&lt;p&gt;The following scenarios are just a few possible cases to consider. Your specific project might have special circumstances or specific requirements from your organization.&lt;/p&gt;

&lt;h3&gt;
  
  
  Open Source Project
&lt;/h3&gt;

&lt;p&gt;Kestrel (standalone) is probably your best bet. The two main benefits for open source projects is &lt;strong&gt;cross-platform support&lt;/strong&gt; and super simple workflow ( &lt;strong&gt;no messing with IIS Express&lt;/strong&gt; ). While cross-platform is not a requirement for open source projects, there is nothing more annoying than finding a good project that doesn't have support for your platform. Now a simple developer workflow is something that we should all strive for, but not always obtainable. Regardless using standalone Kestrel is without a doubt the best option for new open source projects.&lt;/p&gt;

&lt;h3&gt;
  
  
  Enterprise Project with Legacy Apps
&lt;/h3&gt;

&lt;p&gt;In most enterprise scenarios, &lt;strong&gt;legacy applications must be considered&lt;/strong&gt; when building new applications. Some companies/administrators have &lt;strong&gt;strict rules&lt;/strong&gt; on how sites get hosted. IIS can easily host new and legacy apps together, but you have to consider 2 things.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;If performance (speed and memory usage) are important, then In-Process with IIS is the way to go. By letting IIS load and execute the ASP.NET Core application, reverse proxy HTTP calls are avoided and request data is shared in memory. This results is &lt;strong&gt;faster response times and reduced memory&lt;/strong&gt; consumption.&lt;/li&gt;
&lt;li&gt;If sharing AppPools is important, then use Out-Of-Process with IIS. IIS will act like a reverse proxy, which allows you to &lt;strong&gt;share AppPools between legacy apps and new apps&lt;/strong&gt;. Your ASP.NET Core app will have a Kestrel server running, but will be completely managed by IIS. While this does slow down the request speed, it does provided benefits around &lt;strong&gt;shared security, availability&lt;/strong&gt; , etc.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Greenfield Project
&lt;/h3&gt;

&lt;p&gt;For brand new projects, Kestrel (standalone) is your best place to start. Kestrel provides a lightweight server for easy development, allowing your team to spend &lt;strong&gt;more time focusing on building the app&lt;/strong&gt;. If you are developing for Windows-only and using IIS, then consider deploying with IIS In-Process. In addition to an easier configuration, you will find less memory usage and faster response time.&lt;/p&gt;

&lt;h3&gt;
  
  
  High Performance Project
&lt;/h3&gt;

&lt;p&gt;If you need to squeeze every ounce of performance out of your tech stack, then believe it or not but Kestrel (standalone) is probably your best bet. The ASP.NET team has put in a &lt;strong&gt;tremendous amount of effort to make Kestrel a top tier&lt;/strong&gt; web server when it comes to requests per second. The key to keeping your server performant is through the use of &lt;strong&gt;custom middleware instead of the "general use"&lt;/strong&gt; implementations used by most projects. Kestrel, when stripped down to simple text-based requests, can &lt;strong&gt;handle about 6 MILLION requests per second&lt;/strong&gt;. With some smart authentication and body parsing optimized for your domain, you would be surprised at how fast Kestrel can fly.&lt;/p&gt;

&lt;h3&gt;
  
  
  Not Sure?
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Without a doubt the first server to try is Kestrel (standalone)&lt;/strong&gt;. With complete security implementation (ASP.NET Core 2.0 and beyond) and a highly dedicated team pushing its performance to the max, &lt;strong&gt;most projects will be perfectly happy relying on Kestrel&lt;/strong&gt;. The best part is that you can use standalone Kestrel during development and deploy with IIS In-Process or Out-of-Process with just a few configuration changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;All projects, &lt;em&gt;big or small&lt;/em&gt;, benefit when starting off on the right foot. Plan ahead and learn about the options you have available when it comes to project architecture. &lt;strong&gt;The most difficult projects don't always have the most complex logic; they have the least amount of high-level planning.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Keep an eye out for Part 2 of this series on the ASP.NET Core Request Pipeline. It will dive into the details of pipeline configuration and MVC middleware!&lt;/p&gt;

&lt;p&gt;Questions? Comments? Disagreements? Hit me up on &lt;a href="https://twitter.com/jimbuckio" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;!&lt;/p&gt;

</description>
      <category>aspnet</category>
      <category>iis</category>
      <category>kestrel</category>
      <category>net</category>
    </item>
    <item>
      <title>Demystifying the ASP.NET Core Request Pipeline: Preface</title>
      <dc:creator>Jim Buck</dc:creator>
      <pubDate>Tue, 09 Jul 2019 19:48:47 +0000</pubDate>
      <link>https://dev.to/jimbuck/demystifying-the-asp-net-core-request-pipeline-preface-2mnp</link>
      <guid>https://dev.to/jimbuck/demystifying-the-asp-net-core-request-pipeline-preface-2mnp</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;This is Part 0 of a 3 part series on the ASP.NET Core Request Pipeline. Check back here for links to the follow-up articles!&lt;/p&gt;
&lt;/blockquote&gt;




&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--HatNh-FW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1513828646384-e4d8ec30d2bb%3Fixlib%3Drb-1.2.1%26q%3D80%26fm%3Djpg%26crop%3Dentropy%26cs%3Dtinysrgb%26w%3D1080%26fit%3Dmax%26ixid%3DeyJhcHBfaWQiOjExNzczfQ" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--HatNh-FW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1513828646384-e4d8ec30d2bb%3Fixlib%3Drb-1.2.1%26q%3D80%26fm%3Djpg%26crop%3Dentropy%26cs%3Dtinysrgb%26w%3D1080%26fit%3Dmax%26ixid%3DeyJhcHBfaWQiOjExNzczfQ" alt="Demystifying the ASP.NET Core Request Pipeline: Preface"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Every day we use products and services that we could consider a "black box". Look at cell phones for example. Most people (myself included) have absolutely no grasp of exactly how two people can be connected when thousands of miles apart. &lt;a href="https://www.hanselman.com/blog/ImJustACavemanTheHanselmanCorollaryToTheClarkeWheelerLaws.aspx"&gt;Scott Hanselman eloquently phrases it&lt;/a&gt; as &lt;strong&gt;"each new layer of abstraction becomes indistinguishable from magic"&lt;/strong&gt;. Life would be pretty rough if we could only use things we had a complete technical understanding of.&lt;/p&gt;

&lt;p&gt;But there are times when &lt;strong&gt;learning about that "magic" can provide a ton of value&lt;/strong&gt;. It could be as simple as having a better understand when problems hit, which could save you time and frustration. Or it could help steer your logic away from potentially problematic scenarios, &lt;strong&gt;improving performance and avoiding security nightmares&lt;/strong&gt;.  &lt;/p&gt;

&lt;p&gt;When working with ASP.NET it's very easy to get started and just breeze over the architecture details. In this series I am going to &lt;strong&gt;dive into the ASP.NET Core Request Pipeline from start to finish&lt;/strong&gt;. I will cover everything from hosting models and pipeline fundamentals to building your own custom middleware. While I will focus on ASP.NET Core 2.2 and beyond, &lt;strong&gt;the same general tips should also apply to any OWIN based app&lt;/strong&gt; , even in ASP.NET MVC5.&lt;/p&gt;

&lt;p&gt;I hope you enjoy the series and get to learn something new! If you have any comments or questions hit me on &lt;a href="https://twitter.com/jimbuckio"&gt;Twitter&lt;/a&gt;! Follow me to get notified about the next part!&lt;/p&gt;

</description>
      <category>aspnet</category>
      <category>net</category>
      <category>kestrel</category>
      <category>iis</category>
    </item>
    <item>
      <title>Contributing to OSS: Getting Started</title>
      <dc:creator>Jim Buck</dc:creator>
      <pubDate>Thu, 09 May 2019 01:56:44 +0000</pubDate>
      <link>https://dev.to/jimbuck/contributing-to-oss-getting-started-5dm0</link>
      <guid>https://dev.to/jimbuck/contributing-to-oss-getting-started-5dm0</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Fb41Svfw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1507652955-f3dcef5a3be5%3Fixlib%3Drb-1.2.1%26q%3D80%26fm%3Djpg%26crop%3Dentropy%26cs%3Dtinysrgb%26w%3D1080%26fit%3Dmax%26ixid%3DeyJhcHBfaWQiOjExNzczfQ" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Fb41Svfw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1507652955-f3dcef5a3be5%3Fixlib%3Drb-1.2.1%26q%3D80%26fm%3Djpg%26crop%3Dentropy%26cs%3Dtinysrgb%26w%3D1080%26fit%3Dmax%26ixid%3DeyJhcHBfaWQiOjExNzczfQ" alt="Contributing to OSS: Getting Started"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;One of the most beautiful aspects to software development is having the opportunity to contribute to Open Source Software. For a long time I wanted to contribute to a library or framework that I used every day.&lt;/p&gt;

&lt;p&gt;The only problem was that every time I had the motivation to try, I easily got intimidated by what seemed like a high-pressure situation (spoiler alert: it doesn't have to be). By starting small and staying focused, making your first PR for a widely used project can be both fun and beneficial for the community.&lt;/p&gt;


&lt;blockquote class="ltag__twitter-tweet"&gt;
      &lt;div class="ltag__twitter-tweet__media"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--J4azJKFU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/media/D6EUN-9U0AAElo-.jpg" alt="unknown tweet media content"&gt;
      &lt;/div&gt;

  &lt;div class="ltag__twitter-tweet__main"&gt;
    &lt;div class="ltag__twitter-tweet__header"&gt;
      &lt;img class="ltag__twitter-tweet__profile-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--sunDxB9f--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://pbs.twimg.com/profile_images/909106094559027201/FXPtVIJe_normal.jpg" alt="Jon Galloway profile image"&gt;
      &lt;div class="ltag__twitter-tweet__full-name"&gt;
        Jon Galloway
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__username"&gt;
        @jongalloway
      &lt;/div&gt;
      &lt;div class="ltag__twitter-tweet__twitter-logo"&gt;
        &lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--B8bbACBj--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://practicaldev-herokuapp-com.freetls.fastly.net/assets/twitter-99c56e7c338b4d5c17d78f658882ddf18b0bbde5b3f42f84e7964689e7e8fb15.svg" alt="twitter logo"&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__body"&gt;
      Talked to &lt;a href="https://twitter.com/jimbuckio"&gt;@jimbuckio&lt;/a&gt; Monday night about how to get started contributing to &lt;a href="https://twitter.com/dotnet"&gt;@dotnet&lt;/a&gt; open source by contributing small fixes to &lt;a href="https://twitter.com/docsmsft"&gt;@docsmsft&lt;/a&gt;. He stopped by the .NET Open Source booth to tell me his first pull request had just been merged. &lt;a href="https://twitter.com/hashtag/MSBuild"&gt;#MSBuild&lt;/a&gt; 
    &lt;/div&gt;
    &lt;div class="ltag__twitter-tweet__date"&gt;
      19:14 PM - 08 May 2019
    &lt;/div&gt;


    &lt;div class="ltag__twitter-tweet__actions"&gt;
      &lt;a href="https://twitter.com/intent/tweet?in_reply_to=1126203620511248384" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-reply-action.svg" alt="Twitter reply action"&gt;
      &lt;/a&gt;
      &lt;a href="https://twitter.com/intent/retweet?tweet_id=1126203620511248384" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-retweet-action.svg" alt="Twitter retweet action"&gt;
      &lt;/a&gt;
      0
      &lt;a href="https://twitter.com/intent/like?tweet_id=1126203620511248384" class="ltag__twitter-tweet__actions__button"&gt;
        &lt;img src="/assets/twitter-like-action.svg" alt="Twitter like action"&gt;
      &lt;/a&gt;
      5
    &lt;/div&gt;
  &lt;/div&gt;
&lt;/blockquote&gt;


&lt;p&gt;So after chatting with Jon Galloway of the .NET Foundation, I sat down and fixed an issue that I had discovered in the ASP.NET Core documentation. I created my pull request and the next morning I woke up to it already merged in! It's not always that easy, but follow these simple steps and you'll be a well-respected contributor in no time.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Find an Issue
&lt;/h2&gt;

&lt;p&gt;Although it may seem obvious, the most important step is finding a issue. And not just any issue, a &lt;em&gt;good issue&lt;/em&gt;. What makes an issue good? Just find something that seems wrong and ask yourself these questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Is there a clear and obvious reason for the change?&lt;/strong&gt; If a change fixes a breaking bug, then it is a fix worth pursuing. If there is indisputable evidence that a section of documentation is wrong, then a fix is worth pursuing. The key is making sure that the motivation for the change is shared among users and maintainers alike. If you want to make a change to the API because you think it will be better, then maybe you should start by creating an issue to first get some input from the maintainers before spending more time on it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Can you fix it in a clean and concise way?&lt;/strong&gt; To some people refactoring/rewriting can be a cathartic exercise. But just because you feel better after a rewrite doesn't mean it was a good idea. Keeping the changes minimal and specific will help in two ways. The first is that it will keep your changes easy to read, which will help speed up the review process. The second is by minimizing the chance for new bugs or issues. No amount of cleanup is worth it if new bugs are introduced.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Is there already a fix out there?&lt;/strong&gt; Before diving too deep into a solution, make sure that someone else didn't already take a shot at it. If they did, double check the status. It might be pending, abandoned, or simply obsolete at this point. Open source moves fast, so investigate first to avoid wasting time.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Step 2: Fork &amp;amp; Fix
&lt;/h2&gt;

&lt;p&gt;Believe it or not, the easiest part of your first open source contribution should be forking and fixing. GitHub makes forking super easy, just navigate to the repository and click the "Fork" button!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2vB4Os-o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://jimbuck.io/content/images/2019/05/image.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2vB4Os-o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://jimbuck.io/content/images/2019/05/image.png" alt="Contributing to OSS: Getting Started"&gt;&lt;/a&gt;GitHub's Repository Interaction Options&lt;/p&gt;

&lt;p&gt;Once you have your own fork of the repo you can clone it to your development environment for editing. You &lt;em&gt;technically&lt;/em&gt; have the option to edit it online from GitHub, but as I cover in the next step it's best to clone the repo so you can ensure the changes pass tests and coding standards.&lt;/p&gt;

&lt;p&gt;Finally, when applying fixes try to limit changes to those required for the fix. Small changes means fast reviews, which probably increases the chances of getting it merged. If you feel like the changes are beginning to snowball, reach out to the project maintainers for some guidance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Test &amp;amp; Pull Request
&lt;/h2&gt;

&lt;p&gt;The world would be a better place if everyone tested their code. And to me, it's absolutely CRAZY that people make changes and commit it without verifying that it works! Continuous Integration has been a blessing by allowing teams to move fast while maintaining stable branches. But that doesn't mean we should rely on CI alone. It's crucial to test your changes as rigorously as possible before making your PR. It helps to ensure that the changes you made were correct, and helps to avoid wasting the valuable time of a maintainer.&lt;/p&gt;

&lt;p&gt;Once you've successfully tested your changes your good to &lt;a href="https://help.github.com/en/articles/creating-a-pull-request"&gt;create your PR&lt;/a&gt;! Be sure to provide a clear and concise title so maintainers can easily triage the PR. In the description be sure to include details about the motivation for the change, how the issue was solved, and any other supporting details that would help a maintainer review the changes.&lt;/p&gt;

&lt;p&gt;When creating a PR, sometimes repositories will have a Contributor License Agreement (CLA). This is just an agreement that means the community can use your changes. It typically takes less than 5 minutes and only has to be done once, so don't be intimidated by it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Be Patient, Listen, and Stick with it
&lt;/h2&gt;

&lt;p&gt;With some luck and hard work, your PR will get merged in once the maintainers take a look. They could also provide some requests for more changes or simply ask some questions.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;An important part of Open Source Software is being able to work together and receive criticism. Respect is paramount in a community.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Take the time to understand their feedback and work with them to arrive at the best outcome. If it results in a merged PR, then that's great! But if they are still not happy with the changes, don't let that get you down. Stick with it and use it as an opportunity to learn and grow.&lt;/p&gt;

&lt;p&gt;Finally, if they close it (or worse, never respond to it) then do not worry! Anyone who contributes to Open Source Software will get a closed PR at some point in their career. My recommendation is to start back at Step 1 and find a good issue to fix. GitHub projects usually have issues with a tag like &lt;code&gt;good first issue&lt;/code&gt; or &lt;code&gt;help wanted&lt;/code&gt; that are great for new contributors.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Contributing to Open Source Software is an exercise that all developers should try at some point. There are so many fantastic tools and frameworks out there that we use for free every day. But they are not free for the maintainers and their families. Give back to those who work so hard and help make &lt;em&gt;your&lt;/em&gt; community a better place.&lt;/p&gt;

&lt;p&gt;If you have any questions please &lt;a href="https://twitter.com/jimbuckio"&gt;hit me up on twitter&lt;/a&gt;! I'm happy to help anyone with their first (or 100th) PR!&lt;/p&gt;

</description>
      <category>opensource</category>
    </item>
    <item>
      <title>SSL Certificates in Development</title>
      <dc:creator>Jim Buck</dc:creator>
      <pubDate>Fri, 12 Apr 2019 02:15:22 +0000</pubDate>
      <link>https://dev.to/jimbuck/ssl-certificates-in-development-4g71</link>
      <guid>https://dev.to/jimbuck/ssl-certificates-in-development-4g71</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FIHoM4iC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1531417666976-ed2bdbeb043b%3Fixlib%3Drb-1.2.1%26q%3D80%26fm%3Djpg%26crop%3Dentropy%26cs%3Dtinysrgb%26w%3D1080%26fit%3Dmax%26ixid%3DeyJhcHBfaWQiOjExNzczfQ" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FIHoM4iC--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://images.unsplash.com/photo-1531417666976-ed2bdbeb043b%3Fixlib%3Drb-1.2.1%26q%3D80%26fm%3Djpg%26crop%3Dentropy%26cs%3Dtinysrgb%26w%3D1080%26fit%3Dmax%26ixid%3DeyJhcHBfaWQiOjExNzczfQ" alt="SSL Certificates in Development"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Recently I've been working a lot with multiple multi-app servers and their SSL certificates. Once you get more than two or three environments up and running it can get a little tricky finding and wrangling certificates from each instance. Thankfully I've found a few super tips that have been a big time saver when it comes to solving issues with certs when your working in less than ideal system setups.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tip 1: Find and Destroy
&lt;/h3&gt;

&lt;p&gt;I find there are certain times when the dev certs on my PC are just out of hand. The first step to cleaning them up is by removing the old ones. The &lt;a href="https://docs.microsoft.com/en-us/dotnet/framework/wcf/feature-details/how-to-view-certificates-with-the-mmc-snap-in"&gt;certificates snap-in&lt;/a&gt; for the Microsoft Management Console is a decent tool if you want to look at a specific cert. Simply select the folder on the left and you can easily find the certs you need. But when you're looking for one or more possible certs, then try the following Powershell snippet:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls Cert:\ -Recurse | where { $_.Issuer -like "*Jim Buck*" }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This snippet will recursively search all installed certificates but only display those that match the criteria (in this case the &lt;code&gt;Issuer&lt;/code&gt; must contain &lt;code&gt;Jim Buck&lt;/code&gt;. You can filter on any of the following fields:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;Subject&lt;/code&gt; - text (might be generic or the same as issuer)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Issuer&lt;/code&gt; - text (typically quite reliable to filter on)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Thumbprint&lt;/code&gt; - hash (unique per certificate)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;FriendlyName&lt;/code&gt; - string (sometimes empty)&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;NotBefore&lt;/code&gt; - Datetime&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;NotAfter&lt;/code&gt; - Datetime&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Extensions&lt;/code&gt; - List of &lt;code&gt;Oid&lt;/code&gt; objects (they have &lt;code&gt;FriendlyName&lt;/code&gt; and &lt;code&gt;Value&lt;/code&gt; properties).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Early in the development process you might be adding quite a few certs to your store. Run the same command but pipe it to the &lt;code&gt;rm&lt;/code&gt; command and you can easily remove all of the pesky old certificates:&lt;/p&gt;



&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ls Cert:\ -Recurse | where { $_.Issuer -like "*Jim Buck*" } | rm
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;I don't recommend clearing out certs too often though. Ideally you only have to do it before installing the "good" certs. Once you have a nice clean cert store adding new certs that are known to be good should be just fine to have installed.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tip 2: Trust the CA Root certificate
&lt;/h3&gt;

&lt;p&gt;Our application relies on an in-house data service. During the install of this service, it generates a CA Root certificate and an end-user certificate for the server's &lt;a href="https://en.wikipedia.org/wiki/Fully_qualified_domain_name"&gt;FQDN&lt;/a&gt; (signed by the generated CA Root). We can't modify the install logic of the service, so we have to make due with the certs it produces. The best approach is to simply download the CA Root cert from each instance and install it in the Trusted Root of our Local Machine.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--fDozoENT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://jimbuck.io/content/images/2019/04/cert-install-guide-01.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--fDozoENT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://jimbuck.io/content/images/2019/04/cert-install-guide-01.png" alt="SSL Certificates in Development"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mP-3yzn2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://jimbuck.io/content/images/2019/04/cert-install-guide-02.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mP-3yzn2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://jimbuck.io/content/images/2019/04/cert-install-guide-02.png" alt="SSL Certificates in Development"&gt;&lt;/a&gt;&lt;/p&gt;
I typically select "Local Machine" (just in case) and manually select "Trusted Root Certification Authorities".



&lt;p&gt;Don't be fooled, certs of the same name (but different thumbprint) can be installed side-by-side. Just remember to restart your browser/client apps so they pick up the new certificates.&lt;/p&gt;

&lt;h3&gt;
  
  
  Tip 3:  Use a shared CA Root certificate
&lt;/h3&gt;

&lt;p&gt;By far the best approach is to simply make your certificate generation use a shared CA Root. This would allow a project or even a whole department to use one common root cert that signs all server-specific development/test certs. No more downloading of certs to trust, no more hacks to ignore cert errors. No more rummaging through each environment trying to update all references of which cert to use. Just one shared cert that keeps developers, testers, managers, and product owners safe and secure.&lt;/p&gt;

&lt;p&gt;I am currently finalizing a script to help create (dev-only) CA Root and SSL certs. Once I can test it a bit more and get the usage as simple as possible I will write a special article all about it.&lt;/p&gt;

</description>
      <category>security</category>
      <category>powershell</category>
    </item>
  </channel>
</rss>
