title: Access to path is denied, Asp.net core 2.0 running on Ubuntu
body: <p>I am not able to use the bellow line of code. On my development machine (Windows) it is working. Yes, I am developing the application on Windows and deploying on Ubuntu. The next application I won't do this.</p>
  
  <p>I got the error message "access to the path /var/... is defined".</p>
  
  <pre><code>try
  {
     Directory.CreateDirectory(dirInfo.FullName + "/" + numDirs);
  }
  catch(Exception e)
  {
     return e.Message; // access to the path /var/... is defined
  }
  </code></pre>
  
  <p>I am using nginx as proxy server for Kestrel. As described in the <a href="https://docs.microsoft.com/pt-br/aspnet/core/host-and-deploy/linux-nginx?tabs=aspnetcore2x" rel="nofollow noreferrer">Microsoft guide</a></p>
  
  <p>I tried to fire some permission commands randomly, as I am far from being an expert on Ubuntu but the CreateDirectory method is still generating error.</p>
  
  <p>the permission commands I've tried:</p>
  
  <pre><code>sudo chown -R www-data:www-data /var/www/PROJECTDIR
  
  sudo find /var/PROJECTDIR -type d -exec chmod 770 {} \;
  sudo find /var/PROJECTDIR -type f -exec chmod 660 {} \;
  </code></pre>
  
  <p>I am not setting my project inside /var/www I am using something like /var/anotherdir/anotherdir, is it a issue?</p>