Console unavailable in class library c#

后端 未结 2 748
后悔当初
后悔当初 2021-02-19 15:15

This question here seems contrary to what I have experienced. I cannot access the console from within a new class library. I have using System; at the top. I am usi

2条回答
  •  無奈伤痛
    2021-02-19 15:48

    If you created a Metro style application, there's no Console in WinRT. Don't search for it as you won't find any. This is explained in this article:

    The subset of managed types and members was designed with a clear focus on Metro style app development. As a result, it omits the following:

    • Types and members that are not applicable to developing Metro style apps (such as console and ASP.NET types).

    • Obsolete and legacy types.

    • Types that overlap with Windows Runtime types.

    • Types and members that wrap operating system functionality (such as System.Diagnostics.EventLog and performance counters).

    • Members that cause confusion (such as the Close method on I/O types).

    You could use the debugging API or logging framework.

提交回复
热议问题