From bc756706aae09d12ef04c705addb7a10c8daf9e9 Mon Sep 17 00:00:00 2001 From: Hao Kung Date: Tue, 4 Mar 2014 13:02:56 -0800 Subject: [PATCH] Add empty crypto and fix user validator compilation --- src/Microsoft.AspNet.Identity/Crypto.cs | 17 +++++++++++++++++ src/Microsoft.AspNet.Identity/UserValidator.cs | 4 ++++ 2 files changed, 21 insertions(+) create mode 100644 src/Microsoft.AspNet.Identity/Crypto.cs diff --git a/src/Microsoft.AspNet.Identity/Crypto.cs b/src/Microsoft.AspNet.Identity/Crypto.cs new file mode 100644 index 0000000000..eae67a17c1 --- /dev/null +++ b/src/Microsoft.AspNet.Identity/Crypto.cs @@ -0,0 +1,17 @@ +#if K10 + +using System; +using System.Runtime.CompilerServices; +//using System.Security.Cryptography; + +namespace Microsoft.AspNet.Identity +{ + public class Foo + { + public Foo() + { + System.Security.Cryptography.Rfc2898DeriveBytes foo = null; + } + } +} +#endif \ No newline at end of file diff --git a/src/Microsoft.AspNet.Identity/UserValidator.cs b/src/Microsoft.AspNet.Identity/UserValidator.cs index bd96c8c25f..3c673213af 100644 --- a/src/Microsoft.AspNet.Identity/UserValidator.cs +++ b/src/Microsoft.AspNet.Identity/UserValidator.cs @@ -1,7 +1,9 @@ using System; using System.Collections.Generic; using System.Globalization; +#if NET45 using System.Net.Mail; +#endif using System.Text.RegularExpressions; using System.Threading.Tasks; @@ -96,6 +98,7 @@ namespace Microsoft.AspNet.Identity errors.Add(String.Format(CultureInfo.CurrentCulture, Resources.PropertyTooShort, "Email")); return; } +#if NET45 try { var m = new MailAddress(email); @@ -105,6 +108,7 @@ namespace Microsoft.AspNet.Identity errors.Add(String.Format(CultureInfo.CurrentCulture, Resources.InvalidEmail, email)); return; } +#endif var owner = await Manager.FindByEmail(email); if (owner != null && !EqualityComparer.Default.Equals(owner.Id, user.Id)) {