- Home /
[Win app] CS0246 & CS0234 :BindingFlags and Cryptography
I want to implant an Android game app to Win store app. It is ok when running game on unity. But there are errors when I build and run its solution:
CS0234: The type or namespace name 'System.Security' does not exist in the namespace 'Cryptography' (are you missing an assembly reference?)
CS0246: The type or namespace name 'BindingFlags' could not be found (are you missing a using directive or an assembly reference?)
Here are the codes where CS0243 happen:
using UnityEngine;
using System.Collections;
using System.Security.Cryptography; //CS0243
using System.Text;
CS0246 is(this is class Ani.Mate for animation):
static BindingFlags bFlags = BindingFlags.Public | BindingFlags.NonPublic |
BindingFlags.Instance | BindingFlags.Static;
I don't know why it happens? They are built-in classes. Did I miss any reference? If
My MonoDevelop version is 2.8.2. Unity version is 4.2.2.
Answer by RudinUnity · Dec 02, 2013 at 03:17 AM
It seems that no such classes can be used in win8 store app even if they can be search in the web of msdn under win store app api. So I will closed this question with this answer or anyone can give me other advises?
Answer by unimechanic · Dec 10, 2013 at 06:39 PM
Regarding Cryptography classes, at the moment you can use open source libraries that can be found around in Internet, i.e. this one is for MD5 and it's working with WP8 and WSA:
http://farazmahmood.wordpress.com/projects/md5-implementation-in-c/
And the whole reflection API changed with WSA:
http://blogs.msdn.com/b/dotnet/archive/2012/08/28/evolving-the-reflection-api.aspx
Specifically see section titled "Writing code for the new reflection API – Windows Store and Portable Class Library".
EDIT: Here is an example to calculate MD5 in WSA: http://forum.unity3d.com/threads/221534
Thanks for your reply. Because I use the basic $$anonymous$$D5 control, I found a built-in method Windows.Crypto.Compute$$anonymous$$D5Hash in Unity for Windows store app to replace the basic functionality of System.Security.Cryptography.$$anonymous$$D5CryptoServiceProvider.