title: Load html file in a C# WebBrowser component
body: <p>In my WPF app I am trying to load an html file(from inside my project, name of html file is index.html) in to a WebBrowser component. </p>
  
  <p>I followed an answer byghostJago from this question: <a href="https://stackoverflow.com/questions/7194851/load-local-html-file-in-a-c-sharp-webbrowser">Load local HTML file in a C# WebBrowser</a> , but the problem is, the directory of the html file I get points to a Debug folder ( E.g <em>C:\Users\user1\source\repos\AppName\AppName\bin\Debug</em> ). </p>
  
  <p>The first time I ran my project in debug mode, the html file wasn't in the debug folder, I had to paste it in there. So is it possible to load a html file from within visual studio project at runtime? If so, how do I do it?</p>
  
  <p>Code that points to Debug folder:</p>
  
  <pre><code>string curDir = Directory.GetCurrentDirectory();
  string myFile = System.IO.Path.Combine(curDir, "index.html");
  WebView.Navigate("file:///" + myFile);
  </code></pre>