title: How to read user input using f# interactive in visual studio?
body: <p>So I am trying to do something simple:</p>
  
  <pre><code> printfn "Enter a number:"
      try
         let x = System.Console.ReadLine();
         Some(int32(x))
      with
         | :? System.FormatException -&gt; printfn "Invalid number!"
                                        Some(0)
  </code></pre>
  
  <p>I want to print the message, then get the user to input a number, and try to convert it to an int and return it.</p>
  
  <p>If I just compile the code (by typing fsc a3.fs on the command line), it works fine. It pauses, waits for input, then returns Some(int).</p>
  
  <p>If I copy and paste the code into the FSI on the command line, it works great. </p>
  
  <p>But when I am in visual studio, and I run the code in the FSI (highlight + alt+enter), it just goes right over the input part and the exception is thrown (and caught).</p>
  
  <p>Here is the output when I run in the FSI (in visual studio):</p>
  
  <pre><code>Enter a number:
  Invalid number!
  0
  </code></pre>
  
  <p>As you can see, It doesnt ever actually pause and wait for me to enter input.</p>
  
  <p>Anyone know how to make this work?</p>
  
  <p>Thanks!</p>