Error in unity 3d when building for windows phone but works fine for android?

Error building Player: Exception: Error: type System.Security.Cryptography.MD5CryptoServiceProvider doesn’t exist in target framework. It is referenced from Assembly-CSharp-firstpass.dll at System.Void UnityEngine.Advertisements.Event.Event::init().
Error: type System.Security.Cryptography.MD5CryptoServiceProvider doesn’t exist in target framework. It is referenced from Assembly-CSharp-firstpass.dll at System.Void UnityEngine.Advertisements.Event.Event::init().
Error: method System.Void System.Security.Cryptography.MD5CryptoServiceProvider::.ctor() doesn’t exist in target framework. It is referenced from Assembly-CSharp-firstpass.dll at System.Void UnityEngine.Advertisements.Event.Event::init().
Error: method System.Void System.Collections.Hashtable::.ctor(System.Collections.IDictionary) doesn’t exist in target framework. It is referenced from Assembly-CSharp-firstpass.dll at System.Boolean UnityEngine.Advertisements.HTTPLayer.HTTPRequest/c__Iterator1::MoveNext().
Error: method System.Void System.IO.File::WriteAllBytes(System.String,System.Byte[]) doesn’t exist in target framework. It is referenced from Assembly-CSharp-firstpass.dll at System.Void UnityEngine.Advertisements.PictureAdsRequest::HTTPFileCallback(UnityEngine.Advertisements.HTTPLayer.HTTPResponse).

WP8 doesn’t support every class that you may be familiar with. Perhaps read the MSDN documentation.

You can use this instead: