Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrzysztof Wicher <mordotymoja@gmail.com>2017-06-08 04:13:40 +0300
committerDan Moseley <danmose@microsoft.com>2017-06-08 04:13:40 +0300
commit271ea583e8419c86ba5e14680f6dd83383919918 (patch)
tree2a578fc16c8d267e0a57e5f1f928df7d8af16d83
parent3762665ac271a2a8b83488aad49cdc51effb62d0 (diff)
Disable XSLT on UAP (Ref.Emit not available) (#20783)
* disable XSLT on UAP * replace uapaot with uap to match Ctrl-F5 with aot
-rw-r--r--src/System.Private.Xml/src/Configurations.props1
-rw-r--r--src/System.Private.Xml/src/Resources/Strings.resx68
-rw-r--r--src/System.Private.Xml/src/System.Private.Xml.csproj20
-rw-r--r--src/System.Private.Xml/src/System/Xml/Serialization/CodeGenerator.cs2
-rw-r--r--src/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs4
-rw-r--r--src/System.Private.Xml/src/System/Xml/Serialization/SourceInfo.cs2
-rw-r--r--src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationILGen.cs2
-rw-r--r--src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs2
-rw-r--r--src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReaderILGen.cs2
-rw-r--r--src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriter.cs2
-rw-r--r--src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriterILGen.cs2
-rw-r--r--src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs24
-rw-r--r--src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryRuntime.cs6
-rw-r--r--src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryStaticData.cs4
-rw-r--r--src/System.Private.Xml/src/System/Xml/Xsl/Xslt/Compiler.cs2
-rw-r--r--src/System.Private.Xml/src/System/Xml/Xsl/Xslt/Scripts.cs2
-rw-r--r--src/System.Private.Xml/src/System/Xml/Xslt/XslCompiledTransform.cs30
-rw-r--r--src/System.Private.Xml/tests/XmlSerializer/Configurations.props2
-rw-r--r--src/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/Configurations.props2
-rw-r--r--src/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/System.Xml.XmlSerializer.ReflectionOnly.Tests.csproj6
-rw-r--r--src/System.Private.Xml/tests/XmlSerializer/System.Xml.XmlSerializer.Tests.csproj6
-rw-r--r--src/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs4
-rw-r--r--src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Configurations.props2
23 files changed, 151 insertions, 46 deletions
diff --git a/src/System.Private.Xml/src/Configurations.props b/src/System.Private.Xml/src/Configurations.props
index 11b4c45db2..f23f6fb540 100644
--- a/src/System.Private.Xml/src/Configurations.props
+++ b/src/System.Private.Xml/src/Configurations.props
@@ -5,7 +5,6 @@
netcoreapp-Windows_NT;
netcoreapp-Unix;
uap-Windows_NT;
- uapaot-Windows_NT;
</BuildConfigurations>
</PropertyGroup>
</Project> \ No newline at end of file
diff --git a/src/System.Private.Xml/src/Resources/Strings.resx b/src/System.Private.Xml/src/Resources/Strings.resx
index c446d1c06d..e77bbd0d65 100644
--- a/src/System.Private.Xml/src/Resources/Strings.resx
+++ b/src/System.Private.Xml/src/Resources/Strings.resx
@@ -1,5 +1,64 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
@@ -3298,7 +3357,7 @@
<data name="ErrDirectoryExists" xml:space="preserve">
<value>Cannot generate serialization assembly '{0}' because a directory with the same name already exists.</value>
</data>
- <data name="ErrDirectoryNotExists" xml:space="preserve">
+ <data name="ErrDirectoryNotExists" xml:space="preserve">
<value>Cannot generate serialization assembly '{0}' because directory {1} doesn't exist.</value>
</data>
<data name="ErrInvalidArgument" xml:space="preserve">
@@ -3314,7 +3373,7 @@
<value>The name of the source assembly.</value>
</data>
<data name="InfoGeneratedAssembly" xml:space="preserve">
- <value>Generated serialization assembly for assembly {0} --> '{1}'.</value>
+ <value>Generated serialization assembly for assembly {0} --&gt; '{1}'.</value>
</data>
<data name="InfoAssemblyName" xml:space="preserve">
<value>Serialization Assembly Name: {0}.</value>
@@ -3331,4 +3390,7 @@
<data name="DirectoryAccessDenied" xml:space="preserve">
<value>Access to directory {0} is denied. The process under which XmlSerializer is running does not have sufficient permission to access the directory.</value>
</data>
-</root>
+ <data name="Xslt_NotSupported" xml:space="preserve">
+ <value>Compilation of XSLT is not supported on this platform.</value>
+ </data>
+</root> \ No newline at end of file
diff --git a/src/System.Private.Xml/src/System.Private.Xml.csproj b/src/System.Private.Xml/src/System.Private.Xml.csproj
index 85a72ad9f6..89f12d9ca6 100644
--- a/src/System.Private.Xml/src/System.Private.Xml.csproj
+++ b/src/System.Private.Xml/src/System.Private.Xml.csproj
@@ -7,7 +7,7 @@
<RootNamespace>System.Xml</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<NoWarn>$(NoWarn),649</NoWarn>
- <DefineConstants Condition="'$(TargetGroup)' == 'uapaot'">$(DefineConstants);uapaot</DefineConstants>
+ <DefineConstants Condition="'$(TargetGroup)' == 'uap'">$(DefineConstants);uap</DefineConstants>
</PropertyGroup>
<!-- Default configurations to help VS understand the configurations -->
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Unix-Debug|AnyCPU'" />
@@ -16,8 +16,6 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netcoreapp-Windows_NT-Release|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Windows_NT-Release|AnyCPU'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Windows_NT-Debug|AnyCPU'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Windows_NT-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="$(CommonPath)\System\IO\StringBuilderCache.cs">
<Link>System\StringBuilderCache.cs</Link>
@@ -499,6 +497,11 @@
<ItemGroup>
<EmbeddedResource Include="Resources\$(AssemblyName).rd.xml" />
</ItemGroup>
+ <ItemGroup Condition="'$(TargetGroup)' != 'uap'">
+ <Reference Include="System.Reflection.Emit" />
+ <Reference Include="System.Reflection.Emit.ILGeneration" />
+ <Reference Include="System.Reflection.Emit.Lightweight" />
+ </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\System.Threading.Tasks.Extensions\src\System.Threading.Tasks.Extensions.csproj" />
<Reference Include="System.Collections" />
@@ -515,9 +518,6 @@
<Reference Include="System.Net.Requests" />
<Reference Include="System.Net.Primitives" />
<Reference Include="System.ObjectModel" />
- <Reference Include="System.Reflection.Emit" />
- <Reference Include="System.Reflection.Emit.ILGeneration" />
- <Reference Include="System.Reflection.Emit.Lightweight" />
<Reference Include="System.Reflection.Primitives" />
<Reference Include="System.Resources.ResourceManager" />
<Reference Include="System.Runtime" />
@@ -528,7 +528,7 @@
<Reference Include="System.Threading" />
<Reference Include="System.Threading.Tasks" />
</ItemGroup>
- <ItemGroup>
+ <ItemGroup Condition="'$(TargetGroup)' != 'uap'">
<Compile Include="System\Xml\Xsl\IlGen\GenerateHelper.cs" />
<Compile Include="System\Xml\Xsl\IlGen\IteratorDescriptor.cs" />
<Compile Include="System\Xml\Xsl\IlGen\OptimizerPatterns.cs" />
@@ -542,6 +542,10 @@
<Compile Include="System\Xml\Xsl\IlGen\XmlILTrace.cs" />
<Compile Include="System\Xml\Xsl\IlGen\XmlIlTypeHelper.cs" />
<Compile Include="System\Xml\Xsl\IlGen\XmlIlVisitor.cs" />
+ <Compile Include="System\Xml\Xsl\XmlIlGenerator.cs" />
+ <Compile Include="System\Xml\Xsl\XmlILCommand.cs" />
+ </ItemGroup>
+ <ItemGroup>
<Compile Include="System\Xml\Xsl\ISourceLineInfo.cs" />
<Compile Include="System\Xml\Xsl\ListBase.cs" />
<Compile Include="System\Xml\Xsl\Pair.cs" />
@@ -617,8 +621,6 @@
<Compile Include="System\Xml\Xsl\Runtime\XsltFunctions.cs" />
<Compile Include="System\Xml\Xsl\Runtime\XsltLibrary.cs" />
<Compile Include="System\Xml\Xsl\SourceLineInfo.cs" />
- <Compile Include="System\Xml\Xsl\XmlILCommand.cs" />
- <Compile Include="System\Xml\Xsl\XmlIlGenerator.cs" />
<Compile Include="System\Xml\Xsl\XmlNodeKindFlags.cs" />
<Compile Include="System\Xml\Xsl\XmlQualifiedNameTest.cs" />
<Compile Include="System\Xml\Xsl\XmlQueryCardinality.cs" />
diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/CodeGenerator.cs b/src/System.Private.Xml/src/System/Xml/Serialization/CodeGenerator.cs
index 31de4e268b..8e5fba9b19 100644
--- a/src/System.Private.Xml/src/System/Xml/Serialization/CodeGenerator.cs
+++ b/src/System.Private.Xml/src/System/Xml/Serialization/CodeGenerator.cs
@@ -7,7 +7,7 @@ using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
-#if !uapaot
+#if !uap
#if XMLSERIALIZERGENERATOR
namespace Microsoft.XmlSerializer.Generator
#else
diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs b/src/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs
index 0c138c9a3a..7a7908e0b2 100644
--- a/src/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs
+++ b/src/System.Private.Xml/src/System/Xml/Serialization/Compilation.cs
@@ -61,7 +61,7 @@ namespace System.Xml.Serialization
internal TempAssembly(XmlMapping[] xmlMappings, Type[] types, string defaultNamespace, string location)
{
-#if !uapaot
+#if !uap
bool containsSoapMapping = false;
for (int i = 0; i < xmlMappings.Length; i++)
{
@@ -408,7 +408,7 @@ namespace System.Xml.Serialization
#endif
#if !XMLSERIALIZERGENERATOR
-#if !uapaot
+#if !uap
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2106:SecureAsserts", Justification = "It is safe because the serialization assembly is generated by the framework code, not by the user.")]
internal static Assembly GenerateRefEmitAssembly(XmlMapping[] xmlMappings, Type[] types, string defaultNamespace)
{
diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/SourceInfo.cs b/src/System.Private.Xml/src/System/Xml/Serialization/SourceInfo.cs
index 0c5a174eb3..c340e2036d 100644
--- a/src/System.Private.Xml/src/System/Xml/Serialization/SourceInfo.cs
+++ b/src/System.Private.Xml/src/System/Xml/Serialization/SourceInfo.cs
@@ -10,7 +10,7 @@ using System.Reflection.Emit;
using System.Text.RegularExpressions;
using System.Xml.Extensions;
-#if !uapaot
+#if !uap
#if XMLSERIALIZERGENERATOR
namespace Microsoft.XmlSerializer.Generator
#else
diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationILGen.cs b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationILGen.cs
index 262a182ca4..81b5a1f40b 100644
--- a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationILGen.cs
+++ b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationILGen.cs
@@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
-#if !uapaot
+#if !uap
namespace System.Xml.Serialization
{
using System;
diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs
index f5da895afb..a92966ccf7 100644
--- a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs
+++ b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReader.cs
@@ -119,7 +119,7 @@ namespace System.Xml.Serialization
protected abstract void InitIDs();
-#if uapaot
+#if uap
// this method must be called before any generated deserialization methods are called
internal void Init(XmlReader r, XmlDeserializationEvents events, string encodingStyle)
{
diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReaderILGen.cs b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReaderILGen.cs
index f5d9841e3f..8cb50863d6 100644
--- a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReaderILGen.cs
+++ b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationReaderILGen.cs
@@ -3,7 +3,7 @@
// See the LICENSE file in the project root for more information.
-#if !uapaot
+#if !uap
namespace System.Xml.Serialization
{
using System;
diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriter.cs b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriter.cs
index a77e45ad91..99425447d9 100644
--- a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriter.cs
+++ b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriter.cs
@@ -41,7 +41,7 @@ namespace System.Xml.Serialization
private bool _soap12;
private bool _escapeName = true;
-#if uapaot
+#if uap
// this method must be called before any generated serialization methods are called
internal void Init(XmlWriter w, XmlSerializerNamespaces namespaces, string encodingStyle, string idBase)
{
diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriterILGen.cs b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriterILGen.cs
index dc50b39a0a..b137a5f494 100644
--- a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriterILGen.cs
+++ b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializationWriterILGen.cs
@@ -13,7 +13,7 @@ using System.Text;
using System.Xml.Schema;
using System.Xml.Extensions;
-#if !uapaot
+#if !uap
namespace System.Xml.Serialization
{
internal class XmlSerializationWriterILGen : XmlSerializationILGen
diff --git a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs
index d3cbf98dad..309b86fffb 100644
--- a/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs
+++ b/src/System.Private.Xml/src/System/Xml/Serialization/XmlSerializer.cs
@@ -121,7 +121,7 @@ namespace System.Xml.Serialization
/// </devdoc>
public class XmlSerializer
{
-#if uapaot
+#if uap
public enum SerializationMode
#else
internal enum SerializationMode
@@ -132,7 +132,7 @@ namespace System.Xml.Serialization
ReflectionAsBackup
}
-#if uapaot
+#if uap
public static SerializationMode Mode { get; set; } = SerializationMode.ReflectionAsBackup;
#else
internal static SerializationMode Mode { get; set; } = SerializationMode.ReflectionAsBackup;
@@ -153,7 +153,7 @@ namespace System.Xml.Serialization
private Type _primitiveType;
private XmlMapping _mapping;
private XmlDeserializationEvents _events = new XmlDeserializationEvents();
-#if uapaot
+#if uap
private XmlSerializer innerSerializer;
public string DefaultNamespace = null;
#else
@@ -231,7 +231,7 @@ namespace System.Xml.Serialization
if (xmlTypeMapping == null)
throw new ArgumentNullException(nameof(xmlTypeMapping));
-#if !uapaot
+#if !uap
_tempAssembly = GenerateTempAssembly(xmlTypeMapping);
#endif
_mapping = xmlTypeMapping;
@@ -263,7 +263,7 @@ namespace System.Xml.Serialization
_primitiveType = type;
return;
}
-#if !uapaot
+#if !uap
_tempAssembly = s_cache[defaultNamespace, type];
if (_tempAssembly == null)
{
@@ -320,7 +320,7 @@ namespace System.Xml.Serialization
DefaultNamespace = defaultNamespace;
_rootType = type;
_mapping = GenerateXmlTypeMapping(type, overrides, extraTypes, root, defaultNamespace);
-#if !uapaot
+#if !uap
_tempAssembly = GenerateTempAssembly(_mapping, type, defaultNamespace, location);
#endif
}
@@ -446,7 +446,7 @@ namespace System.Xml.Serialization
{
SerializeUsingReflection(xmlWriter, o, namespaces, encodingStyle, id);
}
-#if !uapaot
+#if !uap
else if (_tempAssembly == null || _typedSerializer)
{
// The contion for the block is never true, thus the block is never hit.
@@ -586,7 +586,7 @@ namespace System.Xml.Serialization
{
return DeserializeUsingReflection(xmlReader, encodingStyle, events);
}
-#if !uapaot
+#if !uap
else if (_tempAssembly == null || _typedSerializer)
{
XmlSerializationReader reader = CreateReader();
@@ -679,7 +679,7 @@ namespace System.Xml.Serialization
TypeDesc typeDesc = (TypeDesc)TypeScope.PrimtiveTypes[_primitiveType];
return xmlReader.IsStartElement(typeDesc.DataType.Name, string.Empty);
}
-#if !uapaot
+#if !uap
else if (_tempAssembly != null)
{
return _tempAssembly.CanRead(_mapping, xmlReader);
@@ -716,7 +716,7 @@ namespace System.Xml.Serialization
public static XmlSerializer[] FromMappings(XmlMapping[] mappings, Type type)
{
if (mappings == null || mappings.Length == 0) return Array.Empty<XmlSerializer>();
-#if uapaot
+#if uap
XmlSerializer[] serializers = GetReflectionBasedSerializers(mappings, type);
return serializers;
#else
@@ -894,7 +894,7 @@ namespace System.Xml.Serialization
if (types == null)
return Array.Empty<XmlSerializer>();
-#if uapaot
+#if uap
var serializers = new XmlSerializer[types.Length];
for (int i = 0; i < types.Length; i++)
{
@@ -912,7 +912,7 @@ namespace System.Xml.Serialization
#endif
}
-#if uapaot
+#if uap
// this the global XML serializer contract introduced for multi-file
private static XmlSerializerImplementation xmlSerializerContract;
diff --git a/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryRuntime.cs b/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryRuntime.cs
index b4eae12c0f..32d76d8d75 100644
--- a/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryRuntime.cs
+++ b/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryRuntime.cs
@@ -15,7 +15,9 @@ using System.Globalization;
using System.Reflection;
using System.Reflection.Emit;
using System.Xml.Xsl.Qil;
+#if !uap
using System.Xml.Xsl.IlGen;
+#endif
using System.ComponentModel;
using MS.Internal.Xml.XPath;
using System.Runtime.Versioning;
@@ -492,8 +494,10 @@ namespace System.Xml.Xsl.Runtime
/// </summary>
internal object ChangeTypeXsltArgument(XmlQueryType xmlType, object value, Type destinationType)
{
+#if !uap
Debug.Assert(XmlILTypeHelper.GetStorageType(xmlType).IsAssignableFrom(value.GetType()),
"Values passed to ChangeTypeXsltArgument should be in ILGen's default Clr representation.");
+#endif
Debug.Assert(destinationType == XsltConvert.ObjectType || !destinationType.IsAssignableFrom(value.GetType()),
"No need to call ChangeTypeXsltArgument since value is already assignable to destinationType " + destinationType);
@@ -691,7 +695,9 @@ namespace System.Xml.Xsl.Runtime
}
}
+#if !uap
Debug.Assert(XmlILTypeHelper.GetStorageType(xmlType).IsAssignableFrom(value.GetType()), "Xml type " + xmlType + " is not represented in ILGen as " + value.GetType().Name);
+#endif
return value;
}
diff --git a/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryStaticData.cs b/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryStaticData.cs
index 874dad00e7..d3c3d15a61 100644
--- a/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryStaticData.cs
+++ b/src/System.Private.Xml/src/System/Xml/Xsl/Runtime/XmlQueryStaticData.cs
@@ -6,7 +6,9 @@ using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
+#if !uap
using System.Xml.Xsl.IlGen;
+#endif
using System.Xml.Xsl.Qil;
namespace System.Xml.Xsl.Runtime
@@ -33,6 +35,7 @@ namespace System.Xml.Xsl.Runtime
private string[] _globalNames;
private EarlyBoundInfo[] _earlyBound;
+#if !uap
/// <summary>
/// Constructor.
/// </summary>
@@ -67,6 +70,7 @@ namespace System.Xml.Xsl.Runtime
_earlyBound = copy._earlyBound;
#endif
}
+#endif
/// <summary>
/// Deserialize XmlQueryStaticData object from a byte array.
diff --git a/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/Compiler.cs b/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/Compiler.cs
index f9581b8643..72c66863b5 100644
--- a/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/Compiler.cs
+++ b/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/Compiler.cs
@@ -13,7 +13,7 @@ using System.Runtime.Versioning;
namespace System.Xml.Xsl.Xslt
{
using TypeFactory = XmlQueryTypeFactory;
-#if DEBUG
+#if DEBUG && !uap
using XmlILTrace = System.Xml.Xsl.IlGen.XmlILTrace;
#endif
diff --git a/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/Scripts.cs b/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/Scripts.cs
index 7c0497bb2e..d3e450dd9e 100644
--- a/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/Scripts.cs
+++ b/src/System.Private.Xml/src/System/Xml/Xsl/Xslt/Scripts.cs
@@ -15,7 +15,9 @@ using System.Reflection;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Threading;
+#if !uap
using System.Xml.Xsl.IlGen;
+#endif
using System.Xml.Xsl.Runtime;
using System.Runtime.Versioning;
diff --git a/src/System.Private.Xml/src/System/Xml/Xslt/XslCompiledTransform.cs b/src/System.Private.Xml/src/System/Xml/Xslt/XslCompiledTransform.cs
index 066f5b5027..066b1e73b4 100644
--- a/src/System.Private.Xml/src/System/Xml/Xslt/XslCompiledTransform.cs
+++ b/src/System.Private.Xml/src/System/Xml/Xslt/XslCompiledTransform.cs
@@ -64,8 +64,10 @@ namespace System.Xml.Xsl
private XmlWriterSettings _outputSettings = null;
private QilExpression _qil = null;
+#if !uap
// Executable command for the compiled stylesheet
private XmlILCommand _command = null;
+#endif
public XslCompiledTransform() { }
@@ -82,7 +84,9 @@ namespace System.Xml.Xsl
_compilerErrorColl = null;
_outputSettings = null;
_qil = null;
+#if !uap
_command = null;
+#endif
}
/// <summary>
@@ -197,9 +201,13 @@ namespace System.Xml.Xsl
private void CompileQilToMsil(XsltSettings settings)
{
+#if !uap
_command = new XmlILGenerator().Generate(_qil, /*typeBuilder:*/null);
_outputSettings = _command.StaticData.DefaultWriterSettings;
_qil = null;
+#else
+ throw new PlatformNotSupportedException(SR.Xslt_NotSupported);
+#endif
}
//------------------------------------------------
@@ -208,6 +216,7 @@ namespace System.Xml.Xsl
public void Load(Type compiledStylesheet)
{
+#if !uap
Reset();
if (compiledStylesheet == null)
throw new ArgumentNullException(nameof(compiledStylesheet));
@@ -247,10 +256,14 @@ namespace System.Xml.Xsl
// Throw an exception if the command was not loaded
if (_command == null)
throw new ArgumentException(SR.Format(SR.Xslt_NotCompiledStylesheet, compiledStylesheet.FullName), nameof(compiledStylesheet));
+#else
+ throw new PlatformNotSupportedException(SR.Xslt_NotSupported);
+#endif
}
public void Load(MethodInfo executeMethod, byte[] queryData, Type[] earlyBoundTypes)
{
+#if !uap
Reset();
if (executeMethod == null)
@@ -264,6 +277,9 @@ namespace System.Xml.Xsl
Delegate delExec = (dm != null) ? dm.CreateDelegate(typeof(ExecuteDelegate)) : executeMethod.CreateDelegate(typeof(ExecuteDelegate));
_command = new XmlILCommand((ExecuteDelegate)delExec, new XmlQueryStaticData(queryData, earlyBoundTypes));
_outputSettings = _command.StaticData.DefaultWriterSettings;
+#else
+ throw new PlatformNotSupportedException(SR.Xslt_NotSupported);
+#endif
}
//------------------------------------------------
@@ -415,18 +431,26 @@ namespace System.Xml.Xsl
// It's OK to suppress the SxS warning.
public void Transform(XmlReader input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
{
+#if !uap
CheckArguments(input, results);
CheckCommand();
_command.Execute((object)input, documentResolver, arguments, results);
+#else
+ throw new PlatformNotSupportedException(SR.Xslt_NotSupported);
+#endif
}
// SxS: This method does not take any resource name and does not expose any resources to the caller.
// It's OK to suppress the SxS warning.
public void Transform(IXPathNavigable input, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
{
+#if !uap
CheckArguments(input, results);
CheckCommand();
_command.Execute((object)input.CreateNavigator(), documentResolver, arguments, results);
+#else
+ throw new PlatformNotSupportedException(SR.Xslt_NotSupported);
+#endif
}
//------------------------------------------------
@@ -453,10 +477,14 @@ namespace System.Xml.Xsl
private void CheckCommand()
{
+#if !uap
if (_command == null)
{
throw new InvalidOperationException(SR.Xslt_NoStylesheetLoaded);
}
+#else
+ throw new InvalidOperationException(SR.Xslt_NoStylesheetLoaded);
+#endif
}
private static XmlResolver CreateDefaultResolver()
@@ -488,10 +516,12 @@ namespace System.Xml.Xsl
CompileQilToMsil(settings);
}
+#if !uap
private void Transform(string inputUri, XsltArgumentList arguments, XmlWriter results, XmlResolver documentResolver)
{
_command.Execute(inputUri, documentResolver, arguments, results);
}
+#endif
}
#endif // ! HIDE_XSL
}
diff --git a/src/System.Private.Xml/tests/XmlSerializer/Configurations.props b/src/System.Private.Xml/tests/XmlSerializer/Configurations.props
index bd930d0f90..fc197b085e 100644
--- a/src/System.Private.Xml/tests/XmlSerializer/Configurations.props
+++ b/src/System.Private.Xml/tests/XmlSerializer/Configurations.props
@@ -3,7 +3,7 @@
<PropertyGroup>
<BuildConfigurations>
netstandard;
- uapaot;
+ uap;
</BuildConfigurations>
</PropertyGroup>
</Project> \ No newline at end of file
diff --git a/src/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/Configurations.props b/src/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/Configurations.props
index c2acc14951..e5a14ac3af 100644
--- a/src/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/Configurations.props
+++ b/src/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/Configurations.props
@@ -3,7 +3,7 @@
<PropertyGroup>
<BuildConfigurations>
netstandard;
- uapaot;
+ uap;
</BuildConfigurations>
</PropertyGroup>
</Project>
diff --git a/src/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/System.Xml.XmlSerializer.ReflectionOnly.Tests.csproj b/src/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/System.Xml.XmlSerializer.ReflectionOnly.Tests.csproj
index 12df4834f1..64a6facf54 100644
--- a/src/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/System.Xml.XmlSerializer.ReflectionOnly.Tests.csproj
+++ b/src/System.Private.Xml/tests/XmlSerializer/ReflectionOnly/System.Xml.XmlSerializer.ReflectionOnly.Tests.csproj
@@ -4,12 +4,12 @@
<PropertyGroup>
<DefineConstants>$(DefineConstants);ReflectionOnly</DefineConstants>
<ProjectGuid>{4050F1D1-1DD2-4B48-A17B-E3F955518C4B}</ProjectGuid>
- <DefineConstants Condition="'$(TargetGroup)' == 'uapaot'">$(DefineConstants);uapaot</DefineConstants>
+ <DefineConstants Condition="'$(TargetGroup)' == 'uap'">$(DefineConstants);uap</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Debug|AnyCPU'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Release|AnyCPU'" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Debug|AnyCPU'" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="$(TestSourceFolder)..\..\..\..\System.Runtime.Serialization.Xml\tests\Utils.cs" />
<Compile Include="$(TestSourceFolder)..\..\..\..\System.Runtime.Serialization.Xml\tests\SerializationTypes.cs" />
diff --git a/src/System.Private.Xml/tests/XmlSerializer/System.Xml.XmlSerializer.Tests.csproj b/src/System.Private.Xml/tests/XmlSerializer/System.Xml.XmlSerializer.Tests.csproj
index 762a57fe25..46923e4eb6 100644
--- a/src/System.Private.Xml/tests/XmlSerializer/System.Xml.XmlSerializer.Tests.csproj
+++ b/src/System.Private.Xml/tests/XmlSerializer/System.Xml.XmlSerializer.Tests.csproj
@@ -4,12 +4,12 @@
<PropertyGroup>
<AppDesignerFolder>Properties</AppDesignerFolder>
<ProjectGuid>{4050F1D1-1DD2-4B48-A17B-E3F90DD18C4B}</ProjectGuid>
- <DefineConstants Condition="'$(TargetGroup)' == 'uapaot'">$(DefineConstants);uapaot</DefineConstants>
+ <DefineConstants Condition="'$(TargetGroup)' == 'uap'">$(DefineConstants);uap</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Debug|AnyCPU'" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'netstandard-Release|AnyCPU'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Debug|AnyCPU'" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uapaot-Release|AnyCPU'" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Debug|AnyCPU'" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'uap-Release|AnyCPU'" />
<ItemGroup>
<Compile Include="$(TestSourceFolder)..\..\..\System.Runtime.Serialization.Xml\tests\Utils.cs" />
<Compile Include="$(TestSourceFolder)..\..\..\System.Runtime.Serialization.Xml\tests\SerializationTypes.cs" />
diff --git a/src/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs b/src/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs
index 11988b9f4d..884c57aea4 100644
--- a/src/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs
+++ b/src/System.Private.Xml/tests/XmlSerializer/XmlSerializerTests.cs
@@ -1817,7 +1817,7 @@ string.Format(@"<?xml version=""1.0"" encoding=""utf-8""?>
}
[Fact]
- [ActiveIssue("dotnet/corefx #19897", TargetFrameworkMonikers.UapAot)]
+ [ActiveIssue("dotnet/corefx #19897", TargetFrameworkMonikers.Uap)]
public static void Xml_TypeWithTwoDimensionalArrayProperty1()
{
SimpleType[][] simpleType2D = GetObjectwith2DArrayOfSimpleType();
@@ -3280,7 +3280,7 @@ string.Format(@"<?xml version=""1.0"" encoding=""utf-8""?>
Assert.Equal(value.value, ((DerivedClass)actual).value);
}
-#if !uapaot
+#if !uap
[Fact]
public static void Xml_DefaultValueAttributeSetToNaNTest()
{
diff --git a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Configurations.props b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Configurations.props
index 77a4b65bc9..b40e1de422 100644
--- a/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Configurations.props
+++ b/src/System.Private.Xml/tests/Xslt/XslCompiledTransformApi/Configurations.props
@@ -2,7 +2,7 @@
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<BuildConfigurations>
- netstandard;
+ netfx;
netcoreapp;
</BuildConfigurations>
</PropertyGroup>