Skip to main content
 首页 » 编程设计

c#之WINRT_NOT_PRESENT 的目的是什么

2024年02月20日12arxive

在一些 Windows 8 应用程序代码示例中,我看到了由这些预处理器指令封装的代码块

#if !WINRT_NOT_PRESENT 
#endif 

WinRT 不是总是存在于 Windows 8 商店应用程序中吗?

请您参考如下方法:

这由 Microsoft 的 NotificationsExtensions 库使用。如果要使用 ASP.NET 将推送通知发送到 Windows 推送通知服务 (WNS),则需要指定此构建符号。

来自 Quickstart: Using the NotificationsExtensions library in your code (Windows) :

You can also use NotificationsExtensions in your app server code if you are using ASP.NET to send push notifications to Windows Push Notification Services (WNS). The only caveat is that you must add the WINRT_NOT_PRESENT compilation build symbol in the NotificationsExtensions project properties.