Console unavailable in class library c#

蹲街弑〆低调 提交于 2019-12-04 00:38:09

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.

System.Diagnostics.Debug.WriteLine("test");

https://msdn.microsoft.com/en-us/library/9z9k5ydz(v=vs.110).aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!