代码之家  ›  专栏  ›  技术社区  ›  Morasiu

如何在使用.Net Core的Linux上使用Console.SetWindowSize();呢?

  •  0
  • Morasiu  · 技术社区  · 7 年前

    我目前正在开发一些高级的控制台应用程序。我正在使用.Net Core2.1。当我在Windows上工作的时候,一切都很好,但后来我想在Linux上测试它,并使用那辉煌的“跨平台”。具体来说,我用的是:

    System.Console.SetWindowSize();
    

    他们。。。

    Exception has occurred: CLR/System.PlatformNotSupportedException An unhandled exception of type 'System.PlatformNotSupportedException' occurred in System.Console.dll: 'Operation is not supported on this platform.' at System.ConsolePal.SetWindowSize(Int32 width, Int32 height)

    所以。。。是 啊 System.PlatformNotSupportedException

    0 回复  |  直到 7 年前