Unrecognised #pragma directive?

Hey, all,

After making some minor changes to my game, the Console log is now showing tonnes of messages saying:

“Unrecognised #pragma directive”

These errors are all picking up the #pragma strict directives at the top of every C# file in my game. These directives have been there for about a year, without being touched.

The problem is that this stops the game from actually building - I get the annoying error: Exception: Error building player because scripts had compiler errors.

…but there are no errors! The game plays fine in the editor, so all I can think is that this is down to the warnings about the suddenly rejected #pragma directive.

Has anyone else come across this? Any advice on how to fix it?

Thanks!

SB

What prompted you to ever use it in C#? It’s weird that it worked, but it’s good that Unity is helping you avoid clutter now.