Unity's assembly definition wrong

Okay, so I’ve just been attempting to encrypt an Xml file that we’re using to store our player’s stats, and while switching over to the unity window for a second I got this thrown at me:

error CS0234: The type or namespace
name Xml' does not exist in the namespace System.Security.Cryptography’. Are
you missing an assembly reference?

Now, obviously the first thing to check is the Assembly Reference within Visual Studio - checked and System.Security is definitely there, which doesn’t really make sense in the first place as Unity is moaning about the Xml Namespace.

I then added all three of the Namespaces within System.Security.Cryptography and checked what Unity had to say, it proceeded to moan about the Xml and the Pkcs Namespaces but didn’t feel like telling me X509Certificates didn’t exist within System.Security.Cryptography.

The only conclusion that I can draw from this is that Unity’s definition of System.Security.Cryptography is wrong and I should look for alternate methods of encrypting my Xml file.

If any of you could reproduce this that’d be swell, otherwise tell me I’m missing something very obvious and should be slapped for my silly oversight.


I’m targetting PC, and I’ve already checked the Mono documentation and the namespace System.Security.Cryptography.Xml does exist.

Nevermind, I was under the impression that Unity used the Mono runtime directly for some reason and I was looking at the Monodoc for this assembly. I then found the Unity Mono Documentation:
And it seems as if X509Certificates is the only class within Cryptography, so it’s not supported after all, lame.