title: How to load custom stylesheet with NSwag's UseSwaggerUi3
body: <p>I'm trying to customize the swagger UI with my own .css stylesheet.</p>
  
  <p>I am using asp net core 2.1 and NSwag.AspNetCore 12.2.5.</p>
  
  <p>I've searched around and found that in previous versions this would be done by embedding my custom stylesheet and then injecting it in my middleware configuration with something like:</p>
  
  <pre><code>app.UseSwagger(o =&gt;
  {
     o.InjectStylesheet("/css/custom.css");
  });
  </code></pre>
  
  <p>In the latest version of NSwag this seems to have changed to:</p>
  
  <pre><code>app.UseSwaggerUi3(cfg =&gt;
  {
     cfg.CustomStylesheetUri = new Uri("/css/custom.css", UriKind.Relative);
  });
  </code></pre>
  
  <p>But either I'm not making the stylesheet available, or my uri is not pointing at it correctly.</p>
  
  <p>I don't fully understand how the web server serves up the swagger files (I assume they are loaded from the NSwag nuget package, but I don't see them in my build output folder), so I assume I am not making the stylesheet available correctly.</p>
  
  <p>Doing the above, I see the <code>&lt;link rel="stylesheet" href="css/custom.css"&gt;</code> added to the swagger index.html, but chrome developer tools says the file cannot be found.</p>
  
  <p>I have tried:
  1. Adding my stylesheet to wwwroot.
  2. Adding my stylesheet somewhere in the project and explicitly copying it to the output folder in my csproj.
  3. Embedding my stylesheet in the build artifact.</p>
  
  <p>I have <code>.UseStaticFiles()</code> in my middleware pipeline.</p>
  
  <p>What am I missing? Does anyone have a working example?</p>