Compilation order, scripts in "Plugins" can't access full .Net

As simple as possible:
In one script, i use System.IO.DirectoryInfo.GetFiles (string pattern). This works great, however if I place the script inside the Plugins folder (or actually Plugins/Editor instead of just Editor). I get a compiler error saying that DirectoryInfo doesn’t have the function GetFiles. Really odd since the System.x classes shouldn’t have to be compiled differently depending on where in the compilation order a script in Unity is, they should always be compiled first, shouldn’t they?

Thanks

Sorry to answer such an old post - but Unity searches anywhere, any numbers of levels deep for editor folders - except in /Plugins or /Standard assets.

If you want to include editor scripts in Unity’s first compilation pass, they must be placed inside /Assets/Plugins/Editor/.

Are you building for WebPlayer? File access is not permitted there. It’s a sandbox.

Seems like a weird error, could be to do with the compile order?

What happens if you put that function outside of Editor et al and call it with a SendMessage?