Hi guys, I’m trying to build a WSA phone 8.1 app using the NETFX_CORE define to add windows store specific features. However it always seems to return false so my code won’t build. I have compilation override set to Use .NET Core, is there anything else I’m missing?
For reference I have code like this
#if !NETFX_CORE
// do mono stuff
#else
// do WSA stuff
#endif
From description and given sample, everything looks ok. Does it always go to mono code path?
Note, that both paths should be correct, because the code is also built for editor, where mono is used.
Yep it always goes the mono way - compiles fine for android but when I set to windows store apps it still goes down the mono path and dies.
Can you reproduce it on a simple project?
BTW, which Unity version are you on?
Latest version of unity 5.something, made a brand new project with just a simple script and that seemed to work? Any idea what could have gone wrong in my main project?
Are those scripts placed in a directory like Plugins or Standard Assets?
Another thing you can try is to reimport scripts or delete the Library folder, maybe something got corrupted.
Jackal16> to really see if define is set or not, you can do this, introduce a script error in your script, try building to WSA, it should fail, open Editor.log, and see what defines were being passed to compiler. Additionally could you try attaching Editor.log here?
Thanks guys, Scripts are in Assets/Scripts/etc, I’ll take a look at the log file this evening. If I delete the library folder I take it that it won’t break everything?
Back up first… but before deleting Library folder, check Editor.log for those defines
Ok looks as though NETFX_CORE is being defined but isn’t making it into my project?
-----Compiler Commandline Arguments:
Filename: C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Csc.exe
Arguments: /noconfig @ /UnityTempFile-5d492f3b20cfc2a49bee5d2b6520503a
index: 11
Responsefile: Temp/UnityTempFile-5d492f3b20cfc2a49bee5d2b6520503a Contents:
/debug:pdbonly
/optimize+
/target:library
/nowarn:0169
/out:Temp/Assembly-CSharp.dll
/nostdlib+
/define:NETFX_CORE
Ok guys managed to fix it! I assumed it would’nt compile my mono specific file if there were no references to it in the code, I was wrong… Wrapped it in the !NETFX_CORE defines and all’s fine! Thanks for the help guys.