Why does PowerShell ISE hang on this C# program? -


if compile c# code exe file , run in windows command shell runs fine: outputting prompt, waiting on same line user input followed enter, echoing input. running in powershell v3 shell runs fine. if, however, run same exe file in powershell ise v3, never emits output write , hangs on readline. (as aside, emit output write if later followed writeline.)

namespace consoleapplication1 {     class program     {         static void main(string[] args)         {             system.console.write("invisible prompt: ");             var s = system.console.readline();             system.console.writeline("echo " + s);         }     } } 

is ise bug or there property adjust make work...?

the ise has no support console class.

  • no support [console] class, try [console]::backgroundcolor = 'white'.
    • in general, scripts should use host api's (write-host, instead of [console] class, work in both console, ise, remoting , other shells.

reference: http://blogs.msdn.com/b/powershell/archive/2009/04/17/differences-between-the-ise-and-powershell-console.aspx


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -