title: How do we set ContentRootPath and WebRootPath?
body: <p>We're ending up with the following ContentRoot and WebRoot when we run our app from IIS.</p>
  
  <pre><code>ContentRoot:  C:\MyApp\wwwroot
  WebRoot:      C:\MyApp\wwwroot\wwwroot
  </code></pre>
  
  <p>Here is how we are setting <code>ContentRoot</code> and <code>WebRoot</code>. </p>
  
  <pre><code>public class Startup
  {
      private readonly IHostingEnvironment _hostingEnv;
  
      public Startup(IHostingEnvironment hostingEnv)
      {
          _hostingEnv = hostingEnv;
      }
  
      public void Configure(IApplicationBuilder app)
      {
          app.Run(context =&gt;
          {
              // test output
              context.Response.WriteAsync(_hostingEnv.ContentRootPath + "\r\n");
              return context.Response.WriteAsync(_hostingEnv.WebRootPath + "\r\n");
          });
      }
  
      public static void Main(string[] args)
      {
          var contentRoot = Directory.GetCurrentDirectory();
          var webRoot = Path.Combine(contentRoot, "wwwroot");
  
          var host = new WebHostBuilder()
              .UseKestrel()
              .UseIISPlatformHandlerUrl()
              .UseContentRoot(contentRoot)  // set content root
              .UseWebRoot(webRoot)          // set web root
              .UseStartup&lt;Startup&gt;()
              .Build();
  
          host.Run();
      }
  }
  </code></pre>
  
  <p>From intellisense I see that...</p>
  
  <ul>
  <li><strong>ContentRootPath</strong> contains the application content files.</li>
  <li><strong>WebRootPath</strong> contains the web-servable content files.</li>
  </ul>
  
  <p>How do we make the test output look instead like this: </p>
  
  <pre><code>ContentRoot:  C:\MyApp\
  WebRoot:      C:\MyApp\wwwroot\
  </code></pre>