MonoGame Cross-Platform Conditional Compilation Symbol for Universal Windows Platform

Hi everyone, I’m trying to find the correct Cross-Platform conditional compilation symbol for UWP applications.

I found an old stack exchange thread on the subject but it didn’t list the UWP directive. I’m just trying to run this:

#if WINDOWSUNIVERSAL
    using Windows.Storage;
#endif

Basically if it’s a windows UWP app then run the “using Windows.Storage” otherwise don’t run it.

The used symbol is ‘WINDOWS_UAP’. Note that you can’t use that in your game code if you reference MG (it can only be used in MG itself) since defines from libraries don’t carry over to your project. If you want to use preprocessor symbols, you should define them yourself in your platform specific project.

1 Like

yes! thank you very much sir!

1 Like