Skip to content

Commit

Permalink
Merge in 'release/6.0' changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dotnet-bot committed Oct 5, 2022
2 parents 256033d + 7e42ef8 commit ea9949a
Show file tree
Hide file tree
Showing 37 changed files with 158 additions and 49 deletions.
4 changes: 0 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>2fbe602d12256bf82de53791ddcbb964c1541b4e</Sha>
</Dependency>
<Dependency Name="Microsoft.NET.Test.Sdk" Version="16.9.0-preview-20201201-01">
<Uri>https://github.com/microsoft/vstest</Uri>
<Sha>140434f7109d357d0158ade9e5164a4861513965</Sha>
</Dependency>
<Dependency Name="System.ComponentModel.TypeConverter.TestData" Version="6.0.0-beta.21518.1">
<Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>6c6b7f90677142ad7bd829eb28d3bcf8ad775dd7</Sha>
Expand Down
11 changes: 6 additions & 5 deletions eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
<MicrosoftNETCoreAppRuntimewinx64Version>6.0.0-alpha.1.20612.4</MicrosoftNETCoreAppRuntimewinx64Version>
<MicrosoftNETCoreDotNetHostVersion>6.0.0-rc.1.21415.6</MicrosoftNETCoreDotNetHostVersion>
<MicrosoftNETCoreDotNetHostPolicyVersion>6.0.0-rc.1.21415.6</MicrosoftNETCoreDotNetHostPolicyVersion>
<MicrosoftExtensionsDependencyModelVersion>3.1.0</MicrosoftExtensionsDependencyModelVersion>
<MicrosoftExtensionsDependencyModelVersion>6.0.0</MicrosoftExtensionsDependencyModelVersion>
<!-- CoreClr dependencies -->
<MicrosoftNETCoreILAsmVersion>6.0.0-rc.1.21415.6</MicrosoftNETCoreILAsmVersion>
<!-- Libraries dependencies -->
Expand Down Expand Up @@ -135,18 +135,19 @@
<MicrosoftDiagnosticsNETCoreClientVersion>0.2.61701</MicrosoftDiagnosticsNETCoreClientVersion>
<MicrosoftBuildVersion>16.10.0</MicrosoftBuildVersion>
<MicrosoftBuildTasksCoreVersion>$(MicrosoftBuildVersion)</MicrosoftBuildTasksCoreVersion>
<NugetProjectModelVersion>5.8.0</NugetProjectModelVersion>
<NugetPackagingVersion>5.8.0</NugetPackagingVersion>
<NugetProjectModelVersion>6.2.1</NugetProjectModelVersion>
<NugetPackagingVersion>6.2.1</NugetPackagingVersion>
<!-- Testing -->
<MicrosoftNETCoreCoreDisToolsVersion>1.0.1-prerelease-00006</MicrosoftNETCoreCoreDisToolsVersion>
<MicrosoftNETTestSdkVersion>16.9.0-preview-20201201-01</MicrosoftNETTestSdkVersion>
<MicrosoftNETTestSdkVersion>17.4.0-preview-20220707-01</MicrosoftNETTestSdkVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>1.0.0-prerelease.21404.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>1.0.0-prerelease.21404.1</MicrosoftDotNetXHarnessCLIVersion>
<MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>1.0.2-alpha.0.21413.1</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
<XUnitVersion>2.4.2-pre.9</XUnitVersion>
<XUnitRunnerVisualStudioVersion>2.4.2</XUnitRunnerVisualStudioVersion>
<CoverletCollectorVersion>1.3.0</CoverletCollectorVersion>
<NewtonsoftJsonVersion>12.0.3</NewtonsoftJsonVersion>
<NewtonsoftJsonVersion>13.0.1</NewtonsoftJsonVersion>
<NewtonsoftJsonBsonVersion>1.0.2</NewtonsoftJsonBsonVersion>
<SQLitePCLRawbundle_greenVersion>2.0.4</SQLitePCLRawbundle_greenVersion>
<MoqVersion>4.12.0</MoqVersion>
<FsCheckVersion>2.14.3</FsCheckVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
</ItemGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
<PackageReference Include="xunit.netcore.extensions" Version="1.0.0-prerelease-00206" />
<PackageReference Include="dotnet-test-xunit" Version="1.0.0-rc2-192208-24" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.0.0-preview-20170106-08" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
<PackageReference Include="xunit.netcore.extensions" Version="1.0.0-prerelease-00206" />
<PackageReference Include="dotnet-test-xunit" Version="1.0.0-rc2-192208-24" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions src/installer/tests/Assets/TestUtils/TestProjects.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,7 @@
win-x86 tests that assumed a win-x64 app host RID based on the runner SDK.
-->
<AppHostRuntimeIdentifier>$(TestTargetRid)</AppHostRuntimeIdentifier>

<NewtonsoftJsonVersion>13.0.1</NewtonsoftJsonVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -449,9 +449,9 @@ public TestApp CreateComponentWithDependencies(Action<NetCoreAppBuilder> customi
NetCoreAppBuilder builder = NetCoreAppBuilder.PortableForNETCoreApp(componentWithDependencies)
.WithProject(p => p.WithAssemblyGroup(null, g => g.WithMainAssembly()))
.WithProject("ComponentDependency", "1.0.0", p => p.WithAssemblyGroup(null, g => g.WithAsset("ComponentDependency.dll")))
.WithPackage("Newtonsoft.Json", "9.0.1", p => p.WithAssemblyGroup(null, g => g
.WithPackage("Newtonsoft.Json", "13.0.1", p => p.WithAssemblyGroup(null, g => g
.WithAsset("lib/netstandard1.0/Newtonsoft.Json.dll", f => f
.WithVersion("9.0.0.0", "9.0.1.19813")
.WithVersion("13.0.0.0", "13.0.1.25517")
.WithFileOnDiskPath("Newtonsoft.Json.dll"))))
.WithPackage("Libuv", "1.9.1", p => p
.WithNativeLibraryGroup("debian-x64", g => g.WithAsset("runtimes/debian-x64/native/libuv.so"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class ClsidMapTests : IClassFixture<ClsidMapTests.SharedTestState>

public ClsidMapTests(SharedTestState fixture)
{
sharedTestState = fixture;
sharedTestState = fixture;
}

[Fact]
Expand Down Expand Up @@ -122,7 +122,7 @@ private JObject CreateClsidMap(TestProjectFixture project)
}

using (var clsidMapFile = File.OpenText(clsidMapPath))
using (var clsidMapReader = new JsonTextReader(clsidMapFile))
using (var clsidMapReader = new JsonTextReader(clsidMapFile) { MaxDepth = null })
{
return JObject.Load(clsidMapReader);
}
Expand Down
2 changes: 1 addition & 1 deletion src/installer/tests/TestUtils/RuntimeConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public static RuntimeConfig FromFile(string path)
if (File.Exists(path))
{
using (TextReader textReader = File.OpenText(path))
using (JsonTextReader reader = new JsonTextReader(textReader))
using (var reader = new JsonTextReader(textReader) { MaxDepth = null })
{
JObject root = (JObject)JToken.ReadFrom(reader);
JObject runtimeOptions = (JObject)root["runtimeOptions"];
Expand Down
2 changes: 1 addition & 1 deletion src/installer/tests/TestUtils/TestUtils.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageReference Include="FluentAssertions" Version="4.19.4" />
<PackageReference Include="Microsoft.DotNet.XUnitExtensions" Version="$(MicrosoftDotNetXUnitExtensionsVersion)" />
<PackageReference Include="xunit.core" Version="$(XUnitVersion)" ExcludeAssets="build" />
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonVersion)" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="$(MicrosoftExtensionsDependencyModelVersion)" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public JObject Save(DependencyContext dependencyContext)
{
using (var textReader = new StreamReader(readStream))
{
using (var reader = new JsonTextReader(textReader))
using (var reader = new JsonTextReader(textReader) { MaxDepth = null })
{
return JObject.Load(reader);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ private static IDictionary<string, IEnumerable<string>> ReadCompatibilityMap(str
{
var serializer = new JsonSerializer();
using (var file = File.OpenText(mapFile))
using (var jsonTextReader = new JsonTextReader(file))
using (var jsonTextReader = new JsonTextReader(file) { MaxDepth = null })
{
return serializer.Deserialize<IDictionary<string, IEnumerable<string>>>(jsonTextReader);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="14.3.0">
<PackageReference Include="Microsoft.Build.Tasks.Core" Version="$(MicrosoftBuildTasksCoreVersion)">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,15 @@ public static bool AllowDefaultResolver
return GetCachedSwitchValue("Switch.System.Xml.AllowDefaultResolver", ref s_allowDefaultResolver);
}
}

private static int s_serializationUseDefaultXmlWriterSettings;
public static bool SerializationUseDefaultXmlWriterSettings
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
get
{
return GetCachedSwitchValue("Switch.System.Xml.Serialization.UseDefaultXmlWriterSettings", ref s_serializationUseDefaultXmlWriterSettings);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ private static bool ReflectionMethodEnabled

private static readonly TempAssemblyCache s_cache = new TempAssemblyCache();
private static volatile XmlSerializerNamespaces? s_defaultNamespaces;
private static readonly XmlWriterSettings s_writerSettings = new XmlWriterSettings() { Encoding = new UTF8Encoding(false), Indent = true };

private static XmlSerializerNamespaces DefaultNamespaces
{
get
Expand Down Expand Up @@ -334,7 +336,7 @@ public void Serialize(TextWriter textWriter, object? o)
[RequiresUnreferencedCode(TrimSerializationWarning)]
public void Serialize(TextWriter textWriter, object? o, XmlSerializerNamespaces? namespaces)
{
XmlWriter xmlWriter = XmlWriter.Create(textWriter);
XmlWriter xmlWriter = LocalAppContextSwitches.SerializationUseDefaultXmlWriterSettings ? XmlWriter.Create(textWriter) : XmlWriter.Create(textWriter, s_writerSettings);
Serialize(xmlWriter, o, namespaces);
}

Expand All @@ -347,7 +349,7 @@ public void Serialize(Stream stream, object? o)
[RequiresUnreferencedCode(TrimSerializationWarning)]
public void Serialize(Stream stream, object? o, XmlSerializerNamespaces? namespaces)
{
XmlWriter xmlWriter = XmlWriter.Create(stream);
XmlWriter xmlWriter = XmlWriter.Create(stream, s_writerSettings);
Serialize(xmlWriter, o, namespaces);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ public static void Xml_TypeWithTimeSpanProperty()
{
var obj = new TypeWithTimeSpanProperty { TimeSpanProperty = TimeSpan.FromMilliseconds(1) };
var deserializedObj = SerializeAndDeserialize(obj,
@"<?xml version=""1.0"" encoding=""utf-16""?>
@"<?xml version=""1.0"" encoding=""utf-8""?>
<TypeWithTimeSpanProperty xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<TimeSpanProperty>PT0.001S</TimeSpanProperty>
</TypeWithTimeSpanProperty>");
Expand Down Expand Up @@ -949,7 +949,7 @@ public static void Xml_SimpleType()
{
var obj = new SimpleType { P1 = "foo", P2 = 1 };
var deserializedObj = SerializeAndDeserialize(obj,
@"<?xml version=""1.0"" encoding=""utf-16""?>
@"<?xml version=""1.0"" encoding=""utf-8""?>
<SimpleType xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<P1>foo</P1>
<P2>1</P2>
Expand All @@ -959,6 +959,31 @@ public static void Xml_SimpleType()
Assert.StrictEqual(obj.P2, deserializedObj.P2);
}

[Fact]
public static void Xml_SerializedFormat()
{
var obj = new SimpleType { P1 = "foo", P2 = 1 };
XmlSerializer serializer = new XmlSerializer(typeof(SimpleType));
using (MemoryStream ms = new MemoryStream())
{
serializer.Serialize(ms, obj);

// No BOM?
byte[] expectedBytes = new byte[] { (byte)'<', (byte)'?', (byte)'x', (byte)'m', (byte)'l' };
byte[] firstBytes = new byte[5];
ms.Position = 0;
ms.Read(firstBytes, 0, firstBytes.Length);
Assert.Equal(expectedBytes, firstBytes);

// Human readable?
ms.Position = 0;
string nl = Environment.NewLine;
string actualFormatting = new StreamReader(ms).ReadToEnd();
string expectedFormatting = $"<?xml version=\"1.0\" encoding=\"utf-8\"?>{nl}<SimpleType xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">{nl} <P1>foo</P1>{nl} <P2>1</P2>{ nl}</SimpleType>";
Assert.Equal(expectedFormatting, actualFormatting);
}
}

[Fact]
public static void Xml_BaseClassAndDerivedClass2WithSameProperty()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ private static async Task ParseJsonAsync(

using (var stream = new MemoryStream(dataUtf8))
using (var streamReader = new StreamReader(stream, Encoding.UTF8, false, 1024, true))
using (JsonTextReader jsonReader = new JsonTextReader(streamReader))
using (var jsonReader = new JsonTextReader(streamReader) { MaxDepth = null })
{
JToken jToken = JToken.ReadFrom(jsonReader);

Expand Down Expand Up @@ -3631,7 +3631,7 @@ private static string GetCompactJson(TestCaseType testCaseType, string jsonStrin
return existing;
}

using (JsonTextReader jsonReader = new JsonTextReader(new StringReader(jsonString)))
using (var jsonReader = new JsonTextReader(new StringReader(jsonString)) { MaxDepth = null })
{
jsonReader.FloatParseHandling = FloatParseHandling.Decimal;
JToken jtoken = JToken.ReadFrom(jsonReader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ internal static partial class JsonTestHelper
public static string NewtonsoftReturnStringHelper(TextReader reader)
{
var sb = new StringBuilder();
var json = new JsonTextReader(reader);
var json = new JsonTextReader(reader) { MaxDepth = null };
while (json.Read())
{
if (json.Value != null)
Expand Down Expand Up @@ -344,7 +344,7 @@ public static string InsertCommentsEverywhere(string jsonString)
{
writer.Formatting = Formatting.Indented;

var newtonsoft = new JsonTextReader(new StringReader(jsonString));
var newtonsoft = new JsonTextReader(new StringReader(jsonString)) { MaxDepth = null };
writer.WriteComment("comment");
while (newtonsoft.Read())
{
Expand All @@ -358,7 +358,7 @@ public static string InsertCommentsEverywhere(string jsonString)

public static List<JsonTokenType> GetTokenTypes(string jsonString)
{
var newtonsoft = new JsonTextReader(new StringReader(jsonString));
var newtonsoft = new JsonTextReader(new StringReader(jsonString)) { MaxDepth = null };
int totalReads = 0;
while (newtonsoft.Read())
{
Expand All @@ -369,7 +369,7 @@ public static List<JsonTokenType> GetTokenTypes(string jsonString)

for (int i = 0; i < totalReads; i++)
{
newtonsoft = new JsonTextReader(new StringReader(jsonString));
newtonsoft = new JsonTextReader(new StringReader(jsonString)) { MaxDepth = null };
for (int j = 0; j < i; j++)
{
Assert.True(newtonsoft.Read());
Expand Down Expand Up @@ -689,7 +689,7 @@ public static decimal NextDecimal(Random random, double minValue, double maxValu

public static string GetCompactString(string jsonString)
{
using (JsonTextReader jsonReader = new JsonTextReader(new StringReader(jsonString)))
using (var jsonReader = new JsonTextReader(new StringReader(jsonString)) { MaxDepth = null })
{
jsonReader.FloatParseHandling = FloatParseHandling.Decimal;
JToken jtoken = JToken.ReadFrom(jsonReader);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1025,7 +1025,7 @@ public static void TestingGetString(string jsonString)
var expectedPropertyNames = new List<string>();
var expectedValues = new List<string>();

var jsonNewtonsoft = new JsonTextReader(new StringReader(jsonString));
var jsonNewtonsoft = new JsonTextReader(new StringReader(jsonString)) { MaxDepth = null };
while (jsonNewtonsoft.Read())
{
if (jsonNewtonsoft.TokenType == JsonToken.String)
Expand Down
3 changes: 3 additions & 0 deletions src/mono/cmake/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,9 @@
/* Define to 1 if `kp_proc' is a member of `struct kinfo_proc'. */
#cmakedefine HAVE_STRUCT_KINFO_PROC_KP_PROC 1

/* Define to 1 if `super_class' is a member of `struct objc_super'. */
#cmakedefine HAVE_OBJC_SUPER_SUPER_CLASS 1

/* Define to 1 if you have the <sys/time.h> header file. */
#cmakedefine HAVE_SYS_TIME_H 1

Expand Down
Loading

0 comments on commit ea9949a

Please sign in to comment.