title: StreamWriter and StreamReader Not Working Properly
body: <p>I have been trying to understand for hours now why my project (full desktop app) won't let me use StreamWriter or StreamReader in a proper manner. The issue is that if I try to give either the StreamWriter or StreamReader a filePath (just a simple string) as shown below ...</p>
  
  <pre><code>private readonly string _filePath = @"...Text.txt";
  
  public string TestMethod(string text)
  {    
          // Does not accept a string as an argument, which it should based on the documentation
          StreamReader reader = new StreamReader();
          text = reader.ReadToEnd();
          reader.Close();
  
          return text;
  }
  </code></pre>
  
  <p>Edit: Running the above code trying to make all the red lines go away will case the error posted further down this post.</p>
  
  <p>Below is what it currently looks like (wrong)</p>
  
  <p><a href="https://i.stack.imgur.com/fYGj0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fYGj0.png" alt="Wrong"></a></p>
  
  <p><a href="https://i.stack.imgur.com/0SRSm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0SRSm.png" alt="Correct"></a></p>
  
  <p>Above is what it should look like (correct - with a path paramter)</p>
  
  <p>Documentation: <a href="https://msdn.microsoft.com/en-us/library/f2ke0fzy(v=vs.110).aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/f2ke0fzy(v=vs.110).aspx</a></p>
  
  <p>... I get errors all over the place and if I try to do it another way giving it other arguments I get an error saying: </p>
  
  <pre><code>System.IO.FileNotFoundException: 'Could not load file or assembly 'System.Console, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.'
  </code></pre>
  
  <p>I tried to create a whole new solution, which consists of 2 class libraries (so 2 projects for 1 solution, I guess would be correct to say?) and it pretty much works. I did this because my other solution consists of 3 class libraries, so I thought it would be a good idea to be consistent in reproducing the problem, if I could. So, I created a simple text file, populated it with some text, and got it as output on the screen in a TextBox in the new solution. This basically left me with no idea what to do now.  </p>
  
  <p>Does anybody know what might cause this issue?</p>