diff --git a/tests/common/mac/MacTestMain.cs b/tests/common/mac/MacTestMain.cs index 9422947c04..d1e3b57a2e 100644 --- a/tests/common/mac/MacTestMain.cs +++ b/tests/common/mac/MacTestMain.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Security.Cryptography; #if XAMCORE_2_0 || __UNIFIED__ using AppKit; using Foundation; @@ -24,6 +25,12 @@ namespace Xamarin.Mac.Tests { #if !NO_GUI_TESTING NSApplication.Init(); +#endif +#if MOBILE + // there is no machine.config supplied in the modern profile + // even if one is provided it would not be linker friendly + if (CryptoConfig.CreateFromName ("MD2") == null) + CryptoConfig.AddAlgorithm (typeof (Mono.Security.Cryptography.MD2Managed), "MD2"); #endif RunTests (args); } diff --git a/tests/xharness/BCLTestInfo.cs b/tests/xharness/BCLTestInfo.cs index 03a3f4c012..ac624b10f2 100644 --- a/tests/xharness/BCLTestInfo.cs +++ b/tests/xharness/BCLTestInfo.cs @@ -199,6 +199,7 @@ namespace xharness inputProject.SetTargetFrameworkVersion ("v2.0"); inputProject.RemoveNode ("UseXamMacFullFramework"); inputProject.AddAdditionalDefines ("MOBILE;XAMMAC"); + inputProject.AddReference ("Mono.Security"); break; case MacFlavors.Full: inputProject.AddAdditionalDefines ("XAMMAC_4_5"); diff --git a/tests/xharness/ProjectFileExtensions.cs b/tests/xharness/ProjectFileExtensions.cs index b5e39e99b7..70b15cff3d 100644 --- a/tests/xharness/ProjectFileExtensions.cs +++ b/tests/xharness/ProjectFileExtensions.cs @@ -245,6 +245,16 @@ namespace xharness SetAssemblyReference (csproj, "Xamarin.iOS", value); } + public static void AddReference (this XmlDocument csproj, string projectName) + { + var reference = csproj.SelectSingleNode ("/*/*/*[local-name() = 'Reference' and @Include = 'System']"); + var node = csproj.CreateElement ("Reference", MSBuild_Namespace); + var include_attribute = csproj.CreateAttribute ("Include"); + include_attribute.Value = projectName; + node.Attributes.Append (include_attribute); + reference.ParentNode.AppendChild (node); + } + public static void SetAssemblyReference (this XmlDocument csproj, string current, string value) { var project = csproj.ChildNodes [1];