0

我正在托管一个需要 Console.ReadKey() 语句才能正常工作的 C# 应用程序。AppHarbor 似乎不支持这一点,它终止了我的应用程序并出现以下错误:

InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.]
mscorlib_ni!System.Console.ReadKey(Boolean)+0x1ec
ZiFM!ZiFM.Program.Main(System.String[])+0xc0
4

1 回答 1

3

It doesn't make sense to read from the console on AppHarbor; your console apps run non-interactively and are intended for background processes.

Can you explain a little more about what you're trying to do? If you're wanting to read keys via a users browser, you'd need to build a website and deploy that, which is very different to writing a console application.

于 2012-09-21T17:31:05.333 回答