From b985a5d265855008057a70607666bfdeab66bf6a Mon Sep 17 00:00:00 2001
From: carlossanlop <1175054+carlossanlop@users.noreply.github.com>
Date: Thu, 18 Aug 2022 09:17:19 -0700
Subject: [PATCH 01/21] Update assembly version from hardcoded to MajorVersion
---
eng/Versions.props | 2 +-
src/libraries/Microsoft.VisualBasic.Core/Directory.Build.props | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/eng/Versions.props b/eng/Versions.props
index 0fbb79a4394254..8fa3b9caa5d9be 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -14,7 +14,7 @@
1
- 7.$(MinorVersion).0.0
+ $(MajorVersion).$(MinorVersion).0.0
false
release
diff --git a/src/libraries/Microsoft.VisualBasic.Core/Directory.Build.props b/src/libraries/Microsoft.VisualBasic.Core/Directory.Build.props
index 03812cb3386763..e1dd239477f25a 100644
--- a/src/libraries/Microsoft.VisualBasic.Core/Directory.Build.props
+++ b/src/libraries/Microsoft.VisualBasic.Core/Directory.Build.props
@@ -4,8 +4,7 @@
$([MSBuild]::Add($(MajorVersion), 5))
-
- 12.$(MinorVersion).0.0
+ $(MajorVersion).$(MinorVersion).0.0
Microsoft
true
From 371465c20034eaaa7aff271f6962d040fb0a79ef Mon Sep 17 00:00:00 2001
From: carlossanlop
Date: Wed, 24 Aug 2022 13:58:35 -0700
Subject: [PATCH 02/21] Bump version to 8 in XsdDataContractExporterTests
---
.../tests/XsdDataContractExporterTests/ExporterTypesTests.cs | 2 +-
.../tests/XsdDataContractExporterTests/SurrogateTests.cs | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs
index 211d2013296590..b075f0f8dbb73a 100644
--- a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs
+++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs
@@ -74,7 +74,7 @@ public void TypesTest()
[InlineData(typeof(NoDataContractWithoutParameterlessConstructor), typeof(InvalidDataContractException), @"Type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+NoDataContractWithoutParameterlessConstructor' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.")]
[InlineData(typeof(DataContractWithInvalidMember), typeof(InvalidDataContractException), @"Type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+NoDataContractWithoutParameterlessConstructor' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.")]
[InlineData(typeof(SerializableWithInvalidMember), typeof(InvalidDataContractException), @"Type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+NoDataContractWithoutParameterlessConstructor' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.")]
- [InlineData(typeof(TypeWithReadWriteCollectionAndNoCtorOnCollection), typeof(InvalidDataContractException), @"System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+CollectionWithoutParameterlessCtor`1[[System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+Person, System.Runtime.Serialization.Xml.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]] does not have a default constructor.")]
+ [InlineData(typeof(TypeWithReadWriteCollectionAndNoCtorOnCollection), typeof(InvalidDataContractException), @"System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+CollectionWithoutParameterlessCtor`1[[System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+Person, System.Runtime.Serialization.Xml.Tests, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]] does not have a default constructor.")]
// Yes, the exception type for this next one is different. It was different in NetFx as well.
[InlineData(typeof(ArrayContainer), typeof(InvalidOperationException), @"DataContract for type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+ArrayB' cannot be added to DataContractSet since type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+ArrayA' with the same data contract name 'Array' in namespace 'http://schemas.datacontract.org/2004/07/System.Runtime.Serialization.Xml.XsdDataContractExporterTests' is already present and the contracts are not equivalent.")]
[InlineData(typeof(KeyValueNameSame), typeof(InvalidDataContractException), @"The collection data contract type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+KeyValueNameSame' specifies the same value 'MyName' for both the KeyName and the ValueName properties. This is not allowed. Consider changing either the KeyName or the ValueName property.")]
diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
index 7a2c32aa527d96..e7c20a0adf552b 100644
--- a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
+++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
@@ -55,7 +55,7 @@ public static IEnumerable SurrogateProvider_MemberData()
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
- SchemaUtils.OrderedContains(@"7 ", ref s);
+ SchemaUtils.OrderedContains(@"8 ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"", ref s);
@@ -69,7 +69,7 @@ public static IEnumerable SurrogateProvider_MemberData()
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
- SchemaUtils.OrderedContains(@"7 ", ref s);
+ SchemaUtils.OrderedContains(@"8 ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"", ref s);
From 6ef101cb842afed43ea444f4b910276434eec9f4 Mon Sep 17 00:00:00 2001
From: carlossanlop
Date: Wed, 24 Aug 2022 14:25:31 -0700
Subject: [PATCH 03/21] Retrieve major version dynamically for expected message
in TypesTest_Negative
---
.../ExporterTypesTests.cs | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs
index b075f0f8dbb73a..6c9ac368fae3f3 100644
--- a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs
+++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs
@@ -69,16 +69,26 @@ public void TypesTest()
SchemaUtils.OrderedContains(@"", ref schemas);
}
+ public static IEnumerable GetDynamicallyVersionedTypesTestNegativeData()
+ {
+ // Need this case in a member data because inline data only accepts constant expressions
+ yield return new object[] {
+ typeof(TypeWithReadWriteCollectionAndNoCtorOnCollection),
+ typeof(InvalidDataContractException),
+ $@"System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+CollectionWithoutParameterlessCtor`1[[System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+Person, System.Runtime.Serialization.Xml.Tests, Version={Reflection.Assembly.GetExecutingAssembly().GetName().Version.Major}.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]] does not have a default constructor."
+ };
+ }
+
[Theory]
[SkipOnPlatform(TestPlatforms.Browser, "Inconsistent and unpredictable results.")] // TODO - Why does 'TypeWithReadWriteCollectionAndNoCtorOnCollection' only cause an exception sometimes, but not all the time? What's special about wasm here?
[InlineData(typeof(NoDataContractWithoutParameterlessConstructor), typeof(InvalidDataContractException), @"Type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+NoDataContractWithoutParameterlessConstructor' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.")]
[InlineData(typeof(DataContractWithInvalidMember), typeof(InvalidDataContractException), @"Type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+NoDataContractWithoutParameterlessConstructor' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.")]
[InlineData(typeof(SerializableWithInvalidMember), typeof(InvalidDataContractException), @"Type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+NoDataContractWithoutParameterlessConstructor' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.")]
- [InlineData(typeof(TypeWithReadWriteCollectionAndNoCtorOnCollection), typeof(InvalidDataContractException), @"System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+CollectionWithoutParameterlessCtor`1[[System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+Person, System.Runtime.Serialization.Xml.Tests, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]] does not have a default constructor.")]
// Yes, the exception type for this next one is different. It was different in NetFx as well.
[InlineData(typeof(ArrayContainer), typeof(InvalidOperationException), @"DataContract for type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+ArrayB' cannot be added to DataContractSet since type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+ArrayA' with the same data contract name 'Array' in namespace 'http://schemas.datacontract.org/2004/07/System.Runtime.Serialization.Xml.XsdDataContractExporterTests' is already present and the contracts are not equivalent.")]
[InlineData(typeof(KeyValueNameSame), typeof(InvalidDataContractException), @"The collection data contract type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+KeyValueNameSame' specifies the same value 'MyName' for both the KeyName and the ValueName properties. This is not allowed. Consider changing either the KeyName or the ValueName property.")]
[InlineData(typeof(AnyWithRoot), typeof(InvalidDataContractException), @"Type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+AnyWithRoot' cannot specify an XmlRootAttribute attribute because its IsAny setting is 'true'. This type must write all its contents including the root element. Verify that the IXmlSerializable implementation is correct.")]
+ [MemberData(nameof(GetDynamicallyVersionedTypesTestNegativeData))]
public void TypesTest_Negative(Type badType, Type exType, string exMsg = null)
{
XsdDataContractExporter exporter = new XsdDataContractExporter();
From 0780ab4cc526185a73e39985becc49607d08dbdd Mon Sep 17 00:00:00 2001
From: carlossanlop
Date: Wed, 24 Aug 2022 14:27:53 -0700
Subject: [PATCH 04/21] Retrieve major version dynamically for expected message
in SurrogateProvider_MemberData
---
.../tests/XsdDataContractExporterTests/SurrogateTests.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
index e7c20a0adf552b..dfa09a1b22e1a3 100644
--- a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
+++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
@@ -55,7 +55,7 @@ public static IEnumerable SurrogateProvider_MemberData()
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
- SchemaUtils.OrderedContains(@"8 ", ref s);
+ SchemaUtils.OrderedContains($@"{Assembly.GetExecutingAssembly().GetName().Version.Major} ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"", ref s);
From b27254a47d1c1bb3644d5696565513307daea645 Mon Sep 17 00:00:00 2001
From: carlossanlop
Date: Thu, 25 Aug 2022 12:28:51 -0700
Subject: [PATCH 05/21] Manually generate the TestData.resources. The dotnet
exec command generated by the msbuild Target had to be manually executed in
the cmdline with the target framework folders for RemoteExecutor hardcoded to
net7.0-windows so the resources file could be generated.
---
.../System.Resources.Extensions.Tests.csproj | 8 +++++---
.../tests/TestData.resources | Bin 8046 -> 8046 bytes
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj b/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj
index ad289dc63190c6..f8a1aed6152a18 100644
--- a/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj
+++ b/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj
@@ -26,11 +26,13 @@
-
+ Important:
+ When invoking this target, pass the target framework in as well, substituting
+ the X with the current major version:
+ dotnet build -f netX.0-windows /t:GenerateTestResourcesFile. -->
<_executor>Microsoft.DotNet.RemoteExecutor.dll
diff --git a/src/libraries/System.Resources.Extensions/tests/TestData.resources b/src/libraries/System.Resources.Extensions/tests/TestData.resources
index 9b9413df94091d91930baa714ab84b03e0342ec0..00f4f0b1aff01d01568684cc5143236ab54486cd 100644
GIT binary patch
delta 18
acmaE7_s(v^6=p_@$%3pJoBuKwN&^5*a0e*>
delta 18
acmaE7_s(v^6=p{B$%3pJoBuKwN&^5*W(Oz$
From 727f422b336e11e1bc3e8a171253af76f9f19402 Mon Sep 17 00:00:00 2001
From: carlossanlop
Date: Wed, 19 Oct 2022 14:50:41 -0700
Subject: [PATCH 06/21] Avoid hardcoded 8 in additional SurrogateTests line
---
.../tests/XsdDataContractExporterTests/SurrogateTests.cs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
index dfa09a1b22e1a3..8e17f7b375610b 100644
--- a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
+++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
@@ -38,6 +38,7 @@ public void SurrogateProvider(Type type, ISerializationSurrogateProvider surroga
}
public static IEnumerable SurrogateProvider_MemberData()
{
+ int majorVersion = Assembly.GetExecutingAssembly().GetName().Version.Major;
yield return new object[] { typeof(SurrogateTests.CircleContainer), new NodeToSerializableNode(new CircleToSquare(new XmlSerializerToXmlFormatter(null))), (string s, XmlSchemaSet ss) => {
SchemaUtils.OrderedContains(@"", ref s);
@@ -55,7 +56,7 @@ public static IEnumerable SurrogateProvider_MemberData()
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
- SchemaUtils.OrderedContains($@"{Assembly.GetExecutingAssembly().GetName().Version.Major} ", ref s);
+ SchemaUtils.OrderedContains($@"{majorVersion} ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"", ref s);
@@ -69,7 +70,7 @@ public static IEnumerable SurrogateProvider_MemberData()
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
- SchemaUtils.OrderedContains(@"8 ", ref s);
+ SchemaUtils.OrderedContains($@"{majorVersion} ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"", ref s);
From 2ae65a54b0a052c9fa76dde6f23a3c532c53f755 Mon Sep 17 00:00:00 2001
From: carlossanlop
Date: Mon, 24 Oct 2022 11:59:02 -0700
Subject: [PATCH 07/21] Fix Diagnostics.EventLog supression message
---
.../src/CompatibilitySuppressions.xml | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/src/libraries/System.Diagnostics.EventLog/src/CompatibilitySuppressions.xml b/src/libraries/System.Diagnostics.EventLog/src/CompatibilitySuppressions.xml
index 1da76fc4ded031..03b9b4ff68aeb1 100644
--- a/src/libraries/System.Diagnostics.EventLog/src/CompatibilitySuppressions.xml
+++ b/src/libraries/System.Diagnostics.EventLog/src/CompatibilitySuppressions.xml
@@ -2,16 +2,8 @@
CP0004
- System.Diagnostics.EventLog.Messages, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
- left
- runtimes/win/lib/net6.0/System.Diagnostics.EventLog.Messages.dll
-
-
- CP0004
- System.Diagnostics.EventLog.Messages, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
- left
- runtimes/win/lib/net7.0/System.Diagnostics.EventLog.Messages.dll
-
+ System.Diagnostics.EventLog.Messages, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
+
CP0015
F:System.Diagnostics.Eventing.Reader.StandardEventKeywords.CorrelationHint:[T:System.ObsoleteAttribute]
From 40405692805f2e0f8d96baeba86d8172d8ac0d97 Mon Sep 17 00:00:00 2001
From: carlossanlop <1175054+carlossanlop@users.noreply.github.com>
Date: Thu, 18 Aug 2022 09:17:19 -0700
Subject: [PATCH 08/21] Update assembly version from hardcoded to MajorVersion
---
eng/Versions.props | 2 +-
src/libraries/Microsoft.VisualBasic.Core/Directory.Build.props | 3 +--
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/eng/Versions.props b/eng/Versions.props
index beb3ed9e8751b9..fbb5dfe431ee6f 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -14,7 +14,7 @@
1
- 7.$(MinorVersion).0.0
+ $(MajorVersion).$(MinorVersion).0.0
false
release
diff --git a/src/libraries/Microsoft.VisualBasic.Core/Directory.Build.props b/src/libraries/Microsoft.VisualBasic.Core/Directory.Build.props
index 03812cb3386763..e1dd239477f25a 100644
--- a/src/libraries/Microsoft.VisualBasic.Core/Directory.Build.props
+++ b/src/libraries/Microsoft.VisualBasic.Core/Directory.Build.props
@@ -4,8 +4,7 @@
$([MSBuild]::Add($(MajorVersion), 5))
-
- 12.$(MinorVersion).0.0
+ $(MajorVersion).$(MinorVersion).0.0
Microsoft
true
From c906e67205d9c8d7022891ea07f7975bc32a03df Mon Sep 17 00:00:00 2001
From: carlossanlop
Date: Wed, 24 Aug 2022 13:58:35 -0700
Subject: [PATCH 09/21] Bump version to 8 in XsdDataContractExporterTests
---
.../tests/XsdDataContractExporterTests/ExporterTypesTests.cs | 2 +-
.../tests/XsdDataContractExporterTests/SurrogateTests.cs | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs
index 211d2013296590..b075f0f8dbb73a 100644
--- a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs
+++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs
@@ -74,7 +74,7 @@ public void TypesTest()
[InlineData(typeof(NoDataContractWithoutParameterlessConstructor), typeof(InvalidDataContractException), @"Type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+NoDataContractWithoutParameterlessConstructor' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.")]
[InlineData(typeof(DataContractWithInvalidMember), typeof(InvalidDataContractException), @"Type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+NoDataContractWithoutParameterlessConstructor' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.")]
[InlineData(typeof(SerializableWithInvalidMember), typeof(InvalidDataContractException), @"Type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+NoDataContractWithoutParameterlessConstructor' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.")]
- [InlineData(typeof(TypeWithReadWriteCollectionAndNoCtorOnCollection), typeof(InvalidDataContractException), @"System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+CollectionWithoutParameterlessCtor`1[[System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+Person, System.Runtime.Serialization.Xml.Tests, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]] does not have a default constructor.")]
+ [InlineData(typeof(TypeWithReadWriteCollectionAndNoCtorOnCollection), typeof(InvalidDataContractException), @"System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+CollectionWithoutParameterlessCtor`1[[System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+Person, System.Runtime.Serialization.Xml.Tests, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]] does not have a default constructor.")]
// Yes, the exception type for this next one is different. It was different in NetFx as well.
[InlineData(typeof(ArrayContainer), typeof(InvalidOperationException), @"DataContract for type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+ArrayB' cannot be added to DataContractSet since type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+ArrayA' with the same data contract name 'Array' in namespace 'http://schemas.datacontract.org/2004/07/System.Runtime.Serialization.Xml.XsdDataContractExporterTests' is already present and the contracts are not equivalent.")]
[InlineData(typeof(KeyValueNameSame), typeof(InvalidDataContractException), @"The collection data contract type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+KeyValueNameSame' specifies the same value 'MyName' for both the KeyName and the ValueName properties. This is not allowed. Consider changing either the KeyName or the ValueName property.")]
diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
index 7a2c32aa527d96..e7c20a0adf552b 100644
--- a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
+++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
@@ -55,7 +55,7 @@ public static IEnumerable SurrogateProvider_MemberData()
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
- SchemaUtils.OrderedContains(@"7 ", ref s);
+ SchemaUtils.OrderedContains(@"8 ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"", ref s);
@@ -69,7 +69,7 @@ public static IEnumerable SurrogateProvider_MemberData()
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
- SchemaUtils.OrderedContains(@"7 ", ref s);
+ SchemaUtils.OrderedContains(@"8 ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"", ref s);
From 7085bbf44242f95abdcd41df6d137491cbbdbb38 Mon Sep 17 00:00:00 2001
From: carlossanlop
Date: Wed, 24 Aug 2022 14:25:31 -0700
Subject: [PATCH 10/21] Retrieve major version dynamically for expected message
in TypesTest_Negative
---
.../ExporterTypesTests.cs | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs
index b075f0f8dbb73a..6c9ac368fae3f3 100644
--- a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs
+++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/ExporterTypesTests.cs
@@ -69,16 +69,26 @@ public void TypesTest()
SchemaUtils.OrderedContains(@"", ref schemas);
}
+ public static IEnumerable GetDynamicallyVersionedTypesTestNegativeData()
+ {
+ // Need this case in a member data because inline data only accepts constant expressions
+ yield return new object[] {
+ typeof(TypeWithReadWriteCollectionAndNoCtorOnCollection),
+ typeof(InvalidDataContractException),
+ $@"System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+CollectionWithoutParameterlessCtor`1[[System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+Person, System.Runtime.Serialization.Xml.Tests, Version={Reflection.Assembly.GetExecutingAssembly().GetName().Version.Major}.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]] does not have a default constructor."
+ };
+ }
+
[Theory]
[SkipOnPlatform(TestPlatforms.Browser, "Inconsistent and unpredictable results.")] // TODO - Why does 'TypeWithReadWriteCollectionAndNoCtorOnCollection' only cause an exception sometimes, but not all the time? What's special about wasm here?
[InlineData(typeof(NoDataContractWithoutParameterlessConstructor), typeof(InvalidDataContractException), @"Type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+NoDataContractWithoutParameterlessConstructor' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.")]
[InlineData(typeof(DataContractWithInvalidMember), typeof(InvalidDataContractException), @"Type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+NoDataContractWithoutParameterlessConstructor' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.")]
[InlineData(typeof(SerializableWithInvalidMember), typeof(InvalidDataContractException), @"Type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+NoDataContractWithoutParameterlessConstructor' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.")]
- [InlineData(typeof(TypeWithReadWriteCollectionAndNoCtorOnCollection), typeof(InvalidDataContractException), @"System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+CollectionWithoutParameterlessCtor`1[[System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+Person, System.Runtime.Serialization.Xml.Tests, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51]] does not have a default constructor.")]
// Yes, the exception type for this next one is different. It was different in NetFx as well.
[InlineData(typeof(ArrayContainer), typeof(InvalidOperationException), @"DataContract for type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+ArrayB' cannot be added to DataContractSet since type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+ArrayA' with the same data contract name 'Array' in namespace 'http://schemas.datacontract.org/2004/07/System.Runtime.Serialization.Xml.XsdDataContractExporterTests' is already present and the contracts are not equivalent.")]
[InlineData(typeof(KeyValueNameSame), typeof(InvalidDataContractException), @"The collection data contract type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+KeyValueNameSame' specifies the same value 'MyName' for both the KeyName and the ValueName properties. This is not allowed. Consider changing either the KeyName or the ValueName property.")]
[InlineData(typeof(AnyWithRoot), typeof(InvalidDataContractException), @"Type 'System.Runtime.Serialization.Xml.XsdDataContractExporterTests.ExporterTypesTests+AnyWithRoot' cannot specify an XmlRootAttribute attribute because its IsAny setting is 'true'. This type must write all its contents including the root element. Verify that the IXmlSerializable implementation is correct.")]
+ [MemberData(nameof(GetDynamicallyVersionedTypesTestNegativeData))]
public void TypesTest_Negative(Type badType, Type exType, string exMsg = null)
{
XsdDataContractExporter exporter = new XsdDataContractExporter();
From 72a91218ce126e1335431916f9df86f04d1213fc Mon Sep 17 00:00:00 2001
From: carlossanlop
Date: Wed, 24 Aug 2022 14:27:53 -0700
Subject: [PATCH 11/21] Retrieve major version dynamically for expected message
in SurrogateProvider_MemberData
---
.../tests/XsdDataContractExporterTests/SurrogateTests.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
index e7c20a0adf552b..dfa09a1b22e1a3 100644
--- a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
+++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
@@ -55,7 +55,7 @@ public static IEnumerable SurrogateProvider_MemberData()
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
- SchemaUtils.OrderedContains(@"8 ", ref s);
+ SchemaUtils.OrderedContains($@"{Assembly.GetExecutingAssembly().GetName().Version.Major} ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"", ref s);
From 9b7515e2aacd309685d172dcc0cd4c3041eab822 Mon Sep 17 00:00:00 2001
From: carlossanlop
Date: Thu, 25 Aug 2022 12:28:51 -0700
Subject: [PATCH 12/21] Manually generate the TestData.resources. The dotnet
exec command generated by the msbuild Target had to be manually executed in
the cmdline with the target framework folders for RemoteExecutor hardcoded to
net7.0-windows so the resources file could be generated.
---
.../System.Resources.Extensions.Tests.csproj | 8 +++++---
.../tests/TestData.resources | Bin 8046 -> 8046 bytes
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj b/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj
index ad289dc63190c6..f8a1aed6152a18 100644
--- a/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj
+++ b/src/libraries/System.Resources.Extensions/tests/System.Resources.Extensions.Tests.csproj
@@ -26,11 +26,13 @@
-
+ Important:
+ When invoking this target, pass the target framework in as well, substituting
+ the X with the current major version:
+ dotnet build -f netX.0-windows /t:GenerateTestResourcesFile. -->
<_executor>Microsoft.DotNet.RemoteExecutor.dll
diff --git a/src/libraries/System.Resources.Extensions/tests/TestData.resources b/src/libraries/System.Resources.Extensions/tests/TestData.resources
index 9b9413df94091d91930baa714ab84b03e0342ec0..00f4f0b1aff01d01568684cc5143236ab54486cd 100644
GIT binary patch
delta 18
acmaE7_s(v^6=p_@$%3pJoBuKwN&^5*a0e*>
delta 18
acmaE7_s(v^6=p{B$%3pJoBuKwN&^5*W(Oz$
From 38ef5beee2964369641b93879948778cab00e9c2 Mon Sep 17 00:00:00 2001
From: carlossanlop
Date: Wed, 19 Oct 2022 14:50:41 -0700
Subject: [PATCH 13/21] Avoid hardcoded 8 in additional SurrogateTests line
---
.../tests/XsdDataContractExporterTests/SurrogateTests.cs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
index dfa09a1b22e1a3..8e17f7b375610b 100644
--- a/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
+++ b/src/libraries/System.Runtime.Serialization.Xml/tests/XsdDataContractExporterTests/SurrogateTests.cs
@@ -38,6 +38,7 @@ public void SurrogateProvider(Type type, ISerializationSurrogateProvider surroga
}
public static IEnumerable SurrogateProvider_MemberData()
{
+ int majorVersion = Assembly.GetExecutingAssembly().GetName().Version.Major;
yield return new object[] { typeof(SurrogateTests.CircleContainer), new NodeToSerializableNode(new CircleToSquare(new XmlSerializerToXmlFormatter(null))), (string s, XmlSchemaSet ss) => {
SchemaUtils.OrderedContains(@"", ref s);
@@ -55,7 +56,7 @@ public static IEnumerable SurrogateProvider_MemberData()
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
- SchemaUtils.OrderedContains($@"{Assembly.GetExecutingAssembly().GetName().Version.Major} ", ref s);
+ SchemaUtils.OrderedContains($@"{majorVersion} ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"", ref s);
@@ -69,7 +70,7 @@ public static IEnumerable SurrogateProvider_MemberData()
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
- SchemaUtils.OrderedContains(@"8 ", ref s);
+ SchemaUtils.OrderedContains($@"{majorVersion} ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"0 ", ref s);
SchemaUtils.OrderedContains(@"", ref s);
From d760fa50bc50fd2258703ef486cd25617f0f1195 Mon Sep 17 00:00:00 2001
From: carlossanlop
Date: Mon, 24 Oct 2022 11:59:02 -0700
Subject: [PATCH 14/21] Fix Diagnostics.EventLog supression message
---
.../src/CompatibilitySuppressions.xml | 12 ++----------
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/src/libraries/System.Diagnostics.EventLog/src/CompatibilitySuppressions.xml b/src/libraries/System.Diagnostics.EventLog/src/CompatibilitySuppressions.xml
index 1da76fc4ded031..03b9b4ff68aeb1 100644
--- a/src/libraries/System.Diagnostics.EventLog/src/CompatibilitySuppressions.xml
+++ b/src/libraries/System.Diagnostics.EventLog/src/CompatibilitySuppressions.xml
@@ -2,16 +2,8 @@
CP0004
- System.Diagnostics.EventLog.Messages, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
- left
- runtimes/win/lib/net6.0/System.Diagnostics.EventLog.Messages.dll
-
-
- CP0004
- System.Diagnostics.EventLog.Messages, Version=7.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
- left
- runtimes/win/lib/net7.0/System.Diagnostics.EventLog.Messages.dll
-
+ System.Diagnostics.EventLog.Messages, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
+
CP0015
F:System.Diagnostics.Eventing.Reader.StandardEventKeywords.CorrelationHint:[T:System.ObsoleteAttribute]
From d3bfb5645cfb21f1b9c8fd3f14a05a869581f775 Mon Sep 17 00:00:00 2001
From: Ankit Jain
Date: Fri, 28 Oct 2022 04:01:05 +0000
Subject: [PATCH 15/21] Extract the LocalEchoServer bits from the projects
.. so that the helix bits are in a LocalEchoServer.helix.targets ,
instead of being special-cased in sendtohelix-wasm.targets .
- And this is setup and used by the test projects by importing one file.
---
.../Prerequisites/LocalEchoServer.helix.targets | 17 +++++++++++++++++
.../Net/Prerequisites/LocalEchoServer.props | 17 +++++++++++++++++
.../System.Net.Http.Functional.Tests.csproj | 12 ++----------
.../System.Net.WebSockets.Client.Tests.csproj | 11 ++---------
...stem.Net.WebSockets.Client.Wasm.Tests.csproj | 12 ++----------
src/libraries/sendtohelix-wasm.targets | 7 -------
6 files changed, 40 insertions(+), 36 deletions(-)
create mode 100644 src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.helix.targets
diff --git a/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.helix.targets b/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.helix.targets
new file mode 100644
index 00000000000000..17dd1e0334a89d
--- /dev/null
+++ b/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.helix.targets
@@ -0,0 +1,17 @@
+
+
+
+ $(HelixExtensionTargets);_AddMiddlewarePayload
+ $([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin', 'NetCoreServer', '$(Configuration)', '$(AspNetCoreAppCurrent)'))
+ $([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin', 'RemoteLoopServer', '$(Configuration)', '$(AspNetCoreAppCurrent)'))
+
+
+
+
+
+
+
+
+
diff --git a/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.props b/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.props
index 9b7b8670f463ad..6563ceb74e7e1f 100644
--- a/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.props
+++ b/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.props
@@ -1,5 +1,8 @@
+ <_TargetFrameworkForXHarness>$(AspNetCoreAppCurrent)
+ LocalEchoServer.helix.targets
+
<_TestEchoMiddleware Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(OS)' == 'Windows_NT'">%HELIX_CORRELATION_PAYLOAD%/xharness/TestEchoMiddleware
<_TestEchoMiddleware Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(OS)' != 'Windows_NT'">$HELIX_CORRELATION_PAYLOAD/xharness/TestEchoMiddleware
@@ -15,6 +18,20 @@
$(WasmXHarnessArgs) --web-server-middleware=$(_RemoteLoopMiddleware)/RemoteLoopServer.dll,RemoteLoopServer.GenericHandler
$(WasmXHarnessArgs) --web-server-middleware=$(_TestEchoMiddleware)/NetCoreServer.dll,NetCoreServer.GenericHandler
+
+
+
+
+
+
+
diff --git a/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj b/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj
index 83b3bb8da28082..416a0fae6a17fc 100644
--- a/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj
+++ b/src/libraries/System.Net.Http/tests/FunctionalTests/System.Net.Http.Functional.Tests.csproj
@@ -1,4 +1,6 @@
+
+
../../src/Resources/Strings.resx
$(DefineConstants);SYSNETHTTP_NO_OPENSSL;HTTP3
@@ -38,16 +40,6 @@
-
-
-
-
-
-
-
-
-
diff --git a/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj b/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj
index 7aff0244108eed..f0ba87aa3c6c51 100644
--- a/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj
+++ b/src/libraries/System.Net.WebSockets.Client/tests/System.Net.WebSockets.Client.Tests.csproj
@@ -1,4 +1,6 @@
+
+
../src/Resources/Strings.resx
$(NetCoreAppCurrent);$(NetCoreAppCurrent)-Browser
@@ -17,8 +19,6 @@
$(DefineConstants);TARGET_BROWSER
-
-
@@ -26,13 +26,6 @@
-
-
-
-
-
-
-
diff --git a/src/libraries/System.Net.WebSockets.Client/tests/wasm/System.Net.WebSockets.Client.Wasm.Tests.csproj b/src/libraries/System.Net.WebSockets.Client/tests/wasm/System.Net.WebSockets.Client.Wasm.Tests.csproj
index 32bdd962dfeb0c..0a27428b1d7fb5 100644
--- a/src/libraries/System.Net.WebSockets.Client/tests/wasm/System.Net.WebSockets.Client.Wasm.Tests.csproj
+++ b/src/libraries/System.Net.WebSockets.Client/tests/wasm/System.Net.WebSockets.Client.Wasm.Tests.csproj
@@ -1,4 +1,6 @@
+
+
../../src/Resources/Strings.resx
$(NetCoreAppCurrent)-Browser
@@ -13,16 +15,6 @@
$(DefineConstants);TARGET_BROWSER
-
-
-
-
-
-
-
-
-
diff --git a/src/libraries/sendtohelix-wasm.targets b/src/libraries/sendtohelix-wasm.targets
index fcdcdad18e301c..cbc5f789b475bb 100644
--- a/src/libraries/sendtohelix-wasm.targets
+++ b/src/libraries/sendtohelix-wasm.targets
@@ -22,8 +22,6 @@
<_workItemTimeout Condition="'$(NeedsToBuildWasmAppsOnHelix)' == 'true'">01:00:00
$([MSBuild]::NormalizeDirectory('$(RepoRoot)', 'src', 'mono', 'wasm', 'build'))
- $([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin', 'NetCoreServer', '$(Configuration)', '$(AspNetCoreAppCurrent)'))
- $([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'bin', 'RemoteLoopServer', '$(Configuration)', '$(AspNetCoreAppCurrent)'))
<_ShippingPackagesPath>$([MSBuild]::NormalizeDirectory($(ArtifactsDir), 'packages', $(Configuration), 'Shipping'))
$(Scenario)-
@@ -187,11 +185,6 @@
-
-
-
-
-
From 63fe2dc9163233370db6e6d6665f224cb5dac67f Mon Sep 17 00:00:00 2001
From: Ankit Jain
Date: Fri, 28 Oct 2022 04:10:01 +0000
Subject: [PATCH 16/21] Build the LocalEchoServers specifically without using
artifacts .
- The RemoteLoopServer, and NetCoreServer are projects used as aspnetcore
middleware, and loaded by xharness.
- These are built against the live artifacts, same as other projects.
- But this can be a problem when the libraries in `runtime` are on a
newer assembly version (say `8.0.0`), but xharness is still built with
`7.0.0` libraries.
- In that case, xharness fails to load the middleware:
```
Application startup exception: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types.
...
Could not load file or assembly 'System.Runtime, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at Microsoft.DotNet.XHarness.CLI.CommandArguments.TypeFromAssemblyArgument`1.GetLoadedTypes()+MoveNext() in /_/src/Microsoft.DotNet.XHarness.CLI/CommandArguments/Arguments/TypeFromAssemblyArgument.cs:line 29
at Microsoft.DotNet.XHarness.CLI.Commands.WebServer.<>c__DisplayClass0_0.b__9(TestWebServerOptions options) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WebServer.cs:line 60
at Microsoft.Extensions.Options.OptionsFactory`1.Create(String name)
at Microsoft.Extensions.Options.OptionsCache`1.<>c__3`1.b__3_0(String name, ValueTuple`2 arg)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd[TArg](TKey key, Func`3 valueFactory, TArg factoryArgument)
at Microsoft.Extensions.Options.OptionsCache`1.GetOrAdd[TArg](String name, Func`3 createOptions, TArg factoryArgument)
at Microsoft.DotNet.XHarness.CLI.Commands.WebServer.TestWebServerStartup.Configure(IApplicationBuilder app, IOptionsMonitor`1 optionsAccessor) in /_/src/Microsoft.DotNet.XHarness.CLI/Commands/WebServer.cs:line 126
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
at System.Reflection.MethodInvoker.Invoke(Object obj, IntPtr* args, BindingFlags invokeAttr)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder)
at Microsoft.AspNetCore.Hosting.ConventionBasedStartup.Configure(IApplicationBuilder app)
at Microsoft.AspNetCore.Hosting.WebHost.BuildApplication()
```
- Build the project in isolation from rest of the repo, so that it is
built with references only from the SDK. The built assembly can then be
deployed for use with xharness, just like before.
---
.../Net/Prerequisites/NetCoreServer/Directory.Build.props | 7 +++++++
.../Prerequisites/NetCoreServer/Directory.Build.targets | 7 +++++++
.../Net/Prerequisites/NetCoreServer/NetCoreServer.csproj | 4 +++-
.../Prerequisites/RemoteLoopServer/Directory.Build.props | 7 +++++++
.../Prerequisites/RemoteLoopServer/Directory.Build.targets | 7 +++++++
.../Prerequisites/RemoteLoopServer/RemoteLoopServer.csproj | 5 ++++-
6 files changed, 35 insertions(+), 2 deletions(-)
create mode 100644 src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/Directory.Build.props
create mode 100644 src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/Directory.Build.targets
create mode 100644 src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/Directory.Build.props
create mode 100644 src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/Directory.Build.targets
diff --git a/src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/Directory.Build.props b/src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/Directory.Build.props
new file mode 100644
index 00000000000000..65a9a7c3bf4783
--- /dev/null
+++ b/src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/Directory.Build.props
@@ -0,0 +1,7 @@
+
+
+ $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, global.json))/
+
+
+
+
diff --git a/src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/Directory.Build.targets b/src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/Directory.Build.targets
new file mode 100644
index 00000000000000..242d10ebfa0fac
--- /dev/null
+++ b/src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/Directory.Build.targets
@@ -0,0 +1,7 @@
+
+
+ $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, global.json))/
+
+
+
+
diff --git a/src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/NetCoreServer.csproj b/src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/NetCoreServer.csproj
index b32c7b1153cada..a654a21e298c06 100644
--- a/src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/NetCoreServer.csproj
+++ b/src/libraries/Common/tests/System/Net/Prerequisites/NetCoreServer/NetCoreServer.csproj
@@ -1,10 +1,12 @@
- $(AspNetCoreAppCurrent)
+ $(_TargetFrameworkForXHarness)
+ $(AspNetCoreAppCurrent)
InProcess
Exe
false
+ false
$(DefineConstants);GENEVA_TELEMETRY
diff --git a/src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/Directory.Build.props b/src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/Directory.Build.props
new file mode 100644
index 00000000000000..65a9a7c3bf4783
--- /dev/null
+++ b/src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/Directory.Build.props
@@ -0,0 +1,7 @@
+
+
+ $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, global.json))/
+
+
+
+
diff --git a/src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/Directory.Build.targets b/src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/Directory.Build.targets
new file mode 100644
index 00000000000000..242d10ebfa0fac
--- /dev/null
+++ b/src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/Directory.Build.targets
@@ -0,0 +1,7 @@
+
+
+ $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, global.json))/
+
+
+
+
diff --git a/src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/RemoteLoopServer.csproj b/src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/RemoteLoopServer.csproj
index ba8a85a059c54d..7475870be37a2a 100644
--- a/src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/RemoteLoopServer.csproj
+++ b/src/libraries/Common/tests/System/Net/Prerequisites/RemoteLoopServer/RemoteLoopServer.csproj
@@ -1,9 +1,12 @@
- $(AspNetCoreAppCurrent)
+ $(_TargetFrameworkForXHarness)
+ $(AspNetCoreAppCurrent)
InProcess
Exe
+ false
+ false
From 0ba793c5f7f3f3639a1ca631de3fc3d340e20db9 Mon Sep 17 00:00:00 2001
From: Ankit Jain
Date: Fri, 28 Oct 2022 06:30:46 +0000
Subject: [PATCH 17/21] add missing files
---
eng/testing/ForXHarness.Directory.Build.props | 10 ++++++++++
eng/testing/ForXHarness.Directory.Build.targets | 4 ++++
2 files changed, 14 insertions(+)
create mode 100644 eng/testing/ForXHarness.Directory.Build.props
create mode 100644 eng/testing/ForXHarness.Directory.Build.targets
diff --git a/eng/testing/ForXHarness.Directory.Build.props b/eng/testing/ForXHarness.Directory.Build.props
new file mode 100644
index 00000000000000..c8359257727262
--- /dev/null
+++ b/eng/testing/ForXHarness.Directory.Build.props
@@ -0,0 +1,10 @@
+
+
+
+ $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)../, global.json))/
+ $([MSBuild]::NormalizeDirectory($(RepositoryRoot), 'artifacts', 'obj', $(MSBuildProjectName)))
+ $([MSBuild]::NormalizeDirectory($(BaseIntermediateOutputPath), $(Configuration)))
+ $([MSBuild]::NormalizeDirectory($(RepositoryRoot), 'artifacts', 'bin', $(MSBuildProjectName), $(Configuration)))
+
+
diff --git a/eng/testing/ForXHarness.Directory.Build.targets b/eng/testing/ForXHarness.Directory.Build.targets
new file mode 100644
index 00000000000000..b0536128f94101
--- /dev/null
+++ b/eng/testing/ForXHarness.Directory.Build.targets
@@ -0,0 +1,4 @@
+
+
+
From 8199b4bcac223dd740d447252d31bffc0c956507 Mon Sep 17 00:00:00 2001
From: Ankit Jain
Date: Tue, 1 Nov 2022 05:57:53 +0000
Subject: [PATCH 18/21] [wasm] fixup extensions targets for LocalEchoServer
---
.../System/Net/Prerequisites/LocalEchoServer.helix.targets | 2 +-
.../Common/tests/System/Net/Prerequisites/LocalEchoServer.props | 2 +-
src/libraries/sendtohelix-wasm.targets | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.helix.targets b/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.helix.targets
index 17dd1e0334a89d..80f1eb750e10f1 100644
--- a/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.helix.targets
+++ b/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.helix.targets
@@ -9,7 +9,7 @@
-
+
diff --git a/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.props b/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.props
index 6563ceb74e7e1f..99c5f589f1461a 100644
--- a/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.props
+++ b/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.props
@@ -1,7 +1,7 @@
<_TargetFrameworkForXHarness>$(AspNetCoreAppCurrent)
- LocalEchoServer.helix.targets
+ $(MSBuildThisFileDirectory)LocalEchoServer.helix.targets
<_TestEchoMiddleware Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(OS)' == 'Windows_NT'">%HELIX_CORRELATION_PAYLOAD%/xharness/TestEchoMiddleware
diff --git a/src/libraries/sendtohelix-wasm.targets b/src/libraries/sendtohelix-wasm.targets
index cbc5f789b475bb..1420ac068e44f8 100644
--- a/src/libraries/sendtohelix-wasm.targets
+++ b/src/libraries/sendtohelix-wasm.targets
@@ -57,7 +57,7 @@
true
-
+
<_HelixLocalNodePath Condition="'$(NeedsEMSDKNode)' == 'true' and '$(WindowsShell)' != 'true'">$HELIX_CORRELATION_PAYLOAD/build/emsdk-node
From ad3c98a1bee4f99de63d4b25ccdc38bafeaab000 Mon Sep 17 00:00:00 2001
From: Ankit Jain
Date: Tue, 1 Nov 2022 05:59:05 +0000
Subject: [PATCH 19/21] [wasm] Use eng/targetingpacks.targets instead of wasm
specific targets
---
src/mono/wasm/build/WasmApp.InTree.props | 9 +++++++++
src/mono/wasm/build/WasmApp.InTree.targets | 15 +--------------
2 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/src/mono/wasm/build/WasmApp.InTree.props b/src/mono/wasm/build/WasmApp.InTree.props
index 4949caa40e6eda..4889116746b3a7 100644
--- a/src/mono/wasm/build/WasmApp.InTree.props
+++ b/src/mono/wasm/build/WasmApp.InTree.props
@@ -11,7 +11,16 @@
true
partial
false
+
+ false
+ true
+
+ false
+ false
+ false
+ true
+
<_MonoRuntimeComponentDontLink Include="libmono-component-debugger-stub-static.a" />
diff --git a/src/mono/wasm/build/WasmApp.InTree.targets b/src/mono/wasm/build/WasmApp.InTree.targets
index c4d37a5a061e72..0a2f332c2a7181 100644
--- a/src/mono/wasm/build/WasmApp.InTree.targets
+++ b/src/mono/wasm/build/WasmApp.InTree.targets
@@ -4,7 +4,7 @@
-
+
@@ -19,19 +19,6 @@
-
-
-
- <_LocalMicrosoftNetCoreAppRuntimePackDir>$([MSBuild]::NormalizeDirectory($(ArtifactsBinDir), 'microsoft.netcore.app.runtime.browser-wasm', $(Configuration)))
-
-
-
-
-
-
-
From 56510918ce87f38d00f6e93a89df91695d245fed Mon Sep 17 00:00:00 2001
From: Ankit Jain
Date: Tue, 1 Nov 2022 05:59:46 +0000
Subject: [PATCH 20/21] [wasm] Avoid duplicate imports, and don't use the
targetingpacks.targets
.. for runtime tests since the paths are set explicitly in the project
---
eng/testing/linker/SupportFiles/Directory.Build.targets | 2 +-
src/tests/Common/wasm-test-runner/WasmTestRunner.proj | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/eng/testing/linker/SupportFiles/Directory.Build.targets b/eng/testing/linker/SupportFiles/Directory.Build.targets
index e735d71fa0f723..255b943ad3f8e4 100644
--- a/eng/testing/linker/SupportFiles/Directory.Build.targets
+++ b/eng/testing/linker/SupportFiles/Directory.Build.targets
@@ -1,6 +1,6 @@
-
+
$([MSBuild]::NormalizeDirectory('$(MSBuildProjectDirectory)', '$(OutputPath)', 'AppBundle'))
diff --git a/src/tests/Common/wasm-test-runner/WasmTestRunner.proj b/src/tests/Common/wasm-test-runner/WasmTestRunner.proj
index c653f98c47bff3..4bf0bb896ef700 100644
--- a/src/tests/Common/wasm-test-runner/WasmTestRunner.proj
+++ b/src/tests/Common/wasm-test-runner/WasmTestRunner.proj
@@ -5,6 +5,7 @@
+ false
false
$(CORE_ROOT)\runtimepack-non-existent
$(CORE_ROOT)\runtimepack
From fcc492ee82d9527e40a786e36919638d96094823 Mon Sep 17 00:00:00 2001
From: Ankit Jain
Date: Tue, 1 Nov 2022 06:00:04 +0000
Subject: [PATCH 21/21] [wasm] Workaround for
https://github.com/dotnet/runtime/issues/77707
The middleware projects are now being built separately, so they can
target a different TFM. But when `RunAOTCompilation=true` is set, like
on CI/AOT builds, the build breaks with:
```
To build this project, the following workloads must be installed: macos [/__w/1/s/Build.proj]
To install these workloads, run the following command: dotnet workload restore [/__w/1/s/Build.proj]
```
This is described in https://github.com/dotnet/runtime/issues/77707 .
And the issue is present in `7.0 rc1` also, which is currently used for
building the repo. To workaround it, we unset some properties which
aren't needed anyway for the middleware projects builds.
---
.../tests/System/Net/Prerequisites/LocalEchoServer.props | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.props b/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.props
index 99c5f589f1461a..8d6f6da581d0d5 100644
--- a/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.props
+++ b/src/libraries/Common/tests/System/Net/Prerequisites/LocalEchoServer.props
@@ -20,12 +20,17 @@
+