File.Exists() doesn't work on webplayer?

I’m trying to use System.IO.File.Exists() on a webplayer application in a C# script to check if a given file is present on the local drive.
As far as the documentation goes, this method is supposed to be compatible with the webplayer.

It compiles fine in editor when setting the target to webplayer.

However, when running it in a browser, it seems to generate an exception, stopping the script execution.
Am I missing something?

You can’t use System.IO in WebPlayer. I’ve tried it before too and I read somewhere that you’re not allowed to (safety reasons maybe).

ya gib3d is correct, u r not allowed to use any of the file processing or registry access functions from web player…

Right, i was kind of expecting that. It’s odd that the documentation on mon compatibility would say otherwise, though.
Tks anyway

You are not allowed to access the system in any form. This not only means File IO, but also System.Environment and larger parts of System.Encryption which rely on System.Environment and similar things that access the system on a low level

You can’t rely on Mono documentation because Unity has a fork of Mono.

The documentation is of no relevance there.
Not due to unity not being the the regular mono but because depending on the platform various to a large number of assemblies are not allowed by definition.

If you want something to checkup, look at the supported namespaces and classes list on the website which mentions whats available in what assembly restriction. Its not fully correct on all aspects, but for fundamental stuff like webplayer subset and mobiles its correct enough to prevent you from wasting time.

A thing to keep in mind with webplayer that also saves time: Anything that relies internally on p/invoke or interopservices will not work for granted basically

I would advice u to follow http://unity3d.com/support/documentation/ScriptReference/MonoCompatibility.html than the mono docs

That’s the documentation I was referring to.
The confusion comes from this very piece of doc.

Go to that page:
http://unity3d.com/support/documentation/ScriptReference/MonoCompatibility.html

Search for ‘Class: File (namespace System.IO, assembly mscorlib)’

You will see that it states that the Exist() method is supported by Webplayer (and when you use it in the editor with webplayer as a target, it compiles fine).

If so (I’m not loading that page :P) it sounds like unity have made a stuff up. Report it as a bug.