WinRT compiler directive?

WinRT compiler directive?

Old forum URL: forums.lhotka.net/forums/t/11453.aspx


TSF posted on Wednesday, July 04, 2012

I read a previous post where Rocky referred to a WINRT directive.  However, in my first WinRT project that I've created, it doesn't seem to be recognized.

I have two projects, one for the .NET side, the other for the WinRT side...similar to what I've done many times for SL projects.  In my WinRT project, I've defined a region that is encapsulated with #if WINRT. However, the code inside this block becomes greyed out, even though it is on the WinRT side.

Am I missing something?  Thanks.

TSF replied on Wednesday, July 04, 2012

I think I posted too quickly.  It looks like under the build tab, I see a conditional compilation symbol for NETFX_CORE.  (I never realized until now that that is where the SILVERLIGHT symbol was also defined.)  So I think I'm good at this point, unless someone else tells me I still need to do something different.

RockfordLhotka replied on Thursday, July 05, 2012

In the consumer preview Microsoft didn't define a symbol, so I made one called WINRT.

In the release preview Microsoft defined NETFX_CORE, and I'm switching to that.

I recommend using NETFX_CORE, because that is now the official symbol.

Copyright (c) Marimer LLC