title: ASP.NET Core - Not able to read static HTML file using C# StreamReader inside Controller
body: <p>I have a asp.net core project with angular template with below files structure.</p>
  
  <p><a href="https://i.stack.imgur.com/9JNmX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9JNmX.png" alt="enter image description here"></a></p>
  
  <p>I want to read the static HTML file (<strong>EmailConfirmation.html</strong>) from Template folder.</p>
  
  <p>My code to read this file inside a controller as below.</p>
  
  <pre><code>string body = string.Empty;
  using (StreamReader reader = new StreamReader("./Template/EmailConfirmation.html"))
  {
  body = reader.ReadToEnd();
  }
  </code></pre>
  
  <p>But when I publish this app to azure, There is no folder created with the name <strong>Template</strong> inside <strong>wwwroot</strong> folder. Thus  caught with an error</p>
  
  <blockquote>
    <p>Something went wrong: System.IO.DirectoryNotFoundException: Could not
    find a part of the path
    'D:\home\site\wwwroot\Template\EmailConfirmation.html'</p>
  </blockquote>
  
  <p>For your note : I have tried with steps mentioned in the below article</p>
  
  <p><a href="https://docs.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-2.2" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/aspnet/core/fundamentals/static-files?view=aspnetcore-2.2</a></p>
  
  <p>But not worked out !</p>
  
  <p>How can I solve this problem. Thanks for your attention. I’m looking forward to your reply.</p>