title: How to get directory of hosting environment .net core 2 to upload file
body: <p>I have deployed a .NET core 2 web application to IIS on a Microsoft 2016 server and I can't upload files now (a regular functionality working in DEV).
  I have looked through a bunch of solutions and none work.</p>
  
  <p>Here is my upload code:
  var path = Path.Combine(ROOT, "/uploads", FileName);</p>
  
  <p>For ROOT:</p>
  
  <p>Directory.GetCurrentDirectory: doesn't work properly on the server. It defaults to the C: drive (This works in DEV)</p>
  
  <p>HostingEnvironment.MapPath: Apparently HostingEnvironment doesn't contain a definition for MapPath</p>
  
  <p>HttpContext.Current.Server.MapPath: Apparently HttpContext doesn't contain a definition for Current</p>
  
  <p>Does anyone know what I could do?
  This .net core 2 framework has honestly been an uphill battle with everything compared to the .net framework.</p>
  
  <p>Thanks!</p>