title: asp.net mvc5 when login to an account can't create or upload file
body: <p>there was no problem with the local debugging.But when I uploaded the program to the hosting, In the case of no login account, run this Controller:</p>
  
  <pre><code>System.IO.File.WriteAllText(HttpContext.Server.MapPath("~/1.txt"), "123", System.Text.Encoding.UTF8);
  ViewBag.content = System.IO.File.ReadAllText(HttpContext.Server.MapPath("~/1.txt"));
  </code></pre>
  
  <p>it can create a file to the root directory, but when I login an account, run the Controller again, it can't create a file.It said <strong>that access to the path "XX" is denied.</strong><br />is the hosting problem or the code?<br />
  when i upload the mvc5 simple membership website to the hosting, the problem again.<br /></p>
  
  <pre><code>public ClaimsIdentity CreateIdentity(User user, string authenticationType)
      {
          ClaimsIdentity _identity = new ClaimsIdentity(DefaultAuthenticationTypes.ApplicationCookie);
          _identity.AddClaim(new Claim(ClaimTypes.Name, user.UserName));
          _identity.AddClaim(new Claim(ClaimTypes.NameIdentifier, user.UserID.ToString()));
          _identity.AddClaim(new Claim("http://schemas.microsoft.com/accesscontrolservice/2010/07/claims/identityprovider", "ASP.NET Identity"));
          return _identity;
      }
  </code></pre>
  
  <p><br /></p>
  
  <pre><code>var _identity = userService.CreateIdentity(_user, DefaultAuthenticationTypes.ApplicationCookie);</code></pre>
  
  <p>If it's a question of the hosting folder permissions, when I not logged in, it can 't create a file, right?</p>