1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-09 17:44:48 +09:00

Merge pull request #112382 from carlossanlop/release/9.0-staging

[manual] Merge release/9.0-staging into release/9.0
This commit is contained in:
Carlos Sánchez López 2025-02-11 08:21:40 -08:00 committed by GitHub
commit 689f4e9a5a
Signed by: github
GPG key ID: B5690EEEBB952194
61 changed files with 4849 additions and 2589 deletions

View file

@ -15,7 +15,7 @@
] ]
}, },
"microsoft.dotnet.xharness.cli": { "microsoft.dotnet.xharness.cli": {
"version": "9.0.0-prerelease.25057.1", "version": "9.0.0-prerelease.25103.3",
"commands": [ "commands": [
"xharness" "xharness"
] ]

View file

@ -0,0 +1,25 @@
name: check-no-merge-label
permissions:
pull-requests: read
on:
pull_request:
types: [opened, edited, reopened, labeled, unlabeled, synchronize]
branches:
- 'main'
- 'release/**'
jobs:
check-labels:
runs-on: ubuntu-latest
steps:
- name: Check 'NO-MERGE' label
run: |
echo "Merging permission is disabled when the 'NO-MERGE' label is applied."
if [ "${{ contains(github.event.pull_request.labels.*.name, 'NO-MERGE') }}" = "false" ]; then
exit 0
else
echo "::error:: The 'NO-MERGE' label was applied to the PR. Merging is disabled."
exit 1
fi

View file

@ -15,7 +15,7 @@ jobs:
steps: steps:
- name: Check 'Servicing-approved' label - name: Check 'Servicing-approved' label
run: | run: |
echo "Merging permission is enabled for servicing PRs when the `Servicing-approved` label is applied." echo "Merging permission is enabled for servicing PRs when the 'Servicing-approved' label is applied."
if [ "${{ contains(github.event.pull_request.labels.*.name, 'Servicing-approved') }}" = "true" ]; then if [ "${{ contains(github.event.pull_request.labels.*.name, 'Servicing-approved') }}" = "true" ]; then
exit 0 exit 0
else else

View file

@ -9,11 +9,28 @@
<clear /> <clear />
<!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.--> <!--Begin: Package sources managed by Dependency Flow automation. Do not edit the sources below.-->
<!-- Begin: Package sources from dotnet-emsdk --> <!-- Begin: Package sources from dotnet-emsdk -->
<add key="darc-pub-dotnet-emsdk-4c9d1b1" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-4c9d1b11/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-dad5528" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-dad5528e/nuget/v3/index.json" /> <add key="darc-pub-dotnet-emsdk-dad5528" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-dad5528e/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-79f708d" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-79f708d7/nuget/v3/index.json" /> <add key="darc-pub-dotnet-emsdk-79f708d" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-79f708d7/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-2c27e40-15" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2c27e405-15/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-2c27e40-14" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2c27e405-14/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-2c27e40-13" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2c27e405-13/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-2c27e40-12" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2c27e405-12/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-2c27e40-11" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2c27e405-11/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-2c27e40-10" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2c27e405-10/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-2c27e40-9" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2c27e405-9/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-2c27e40-8" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2c27e405-8/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-2c27e40-7" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2c27e405-7/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-2c27e40-6" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2c27e405-6/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-2c27e40-5" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2c27e405-5/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-2c27e40-4" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2c27e405-4/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-2c27e40-3" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2c27e405-3/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-2c27e40-2" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2c27e405-2/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-2c27e40-1" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2c27e405-1/nuget/v3/index.json" />
<add key="darc-pub-dotnet-emsdk-2c27e40" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-emsdk-2c27e405/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-emsdk --> <!-- End: Package sources from dotnet-emsdk -->
<!-- Begin: Package sources from dotnet-sdk --> <!-- Begin: Package sources from dotnet-sdk -->
<add key="darc-pub-dotnet-sdk-a345a00" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-sdk-a345a003/nuget/v3/index.json" /> <add key="darc-pub-dotnet-sdk-049799c" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/darc-pub-dotnet-sdk-049799c3/nuget/v3/index.json" />
<!-- End: Package sources from dotnet-sdk --> <!-- End: Package sources from dotnet-sdk -->
<!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.--> <!--End: Package sources managed by Dependency Flow automation. Do not edit the sources above.-->
<!-- <!--

View file

@ -1,8 +1,8 @@
<Dependencies> <Dependencies>
<ProductDependencies> <ProductDependencies>
<Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="9.0.0-rtm.25061.1"> <Dependency Name="Microsoft.NETCore.Runtime.ICU.Transport" Version="9.0.0-rtm.25105.1">
<Uri>https://github.com/dotnet/icu</Uri> <Uri>https://github.com/dotnet/icu</Uri>
<Sha>b182bb23c5e7c215495c987f23d2e2f0ed54a1ca</Sha> <Sha>b278d2c5e9fc54c15df9eb5319eb9152f21b5bb9</Sha>
</Dependency> </Dependency>
<Dependency Name="System.Net.MsQuic.Transport" Version="9.0.0-alpha.1.24167.3"> <Dependency Name="System.Net.MsQuic.Transport" Version="9.0.0-alpha.1.24167.3">
<Uri>https://github.com/dotnet/msquic</Uri> <Uri>https://github.com/dotnet/msquic</Uri>
@ -54,14 +54,14 @@
<Sha>803d8598f98fb4efd94604b32627ee9407f246db</Sha> <Sha>803d8598f98fb4efd94604b32627ee9407f246db</Sha>
<SourceBuild RepoName="command-line-api" ManagedOnly="true" /> <SourceBuild RepoName="command-line-api" ManagedOnly="true" />
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.Cecil" Version="0.11.5-alpha.25056.3"> <Dependency Name="Microsoft.DotNet.Cecil" Version="0.11.5-alpha.25102.5">
<Uri>https://github.com/dotnet/cecil</Uri> <Uri>https://github.com/dotnet/cecil</Uri>
<Sha>7ea2381200e5ca70cf67efc887d9cd693d82b77f</Sha> <Sha>aa3ae0d49da3cfb31a383f16303a3f2f0c3f1a19</Sha>
</Dependency> </Dependency>
<!-- Intermediate is necessary for source build. --> <!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.cecil" Version="0.11.5-alpha.25056.3"> <Dependency Name="Microsoft.SourceBuild.Intermediate.cecil" Version="0.11.5-alpha.25102.5">
<Uri>https://github.com/dotnet/cecil</Uri> <Uri>https://github.com/dotnet/cecil</Uri>
<Sha>7ea2381200e5ca70cf67efc887d9cd693d82b77f</Sha> <Sha>aa3ae0d49da3cfb31a383f16303a3f2f0c3f1a19</Sha>
<SourceBuild RepoName="cecil" ManagedOnly="true" /> <SourceBuild RepoName="cecil" ManagedOnly="true" />
</Dependency> </Dependency>
<Dependency Name="Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport" Version="9.0.3-servicing.25105.2"> <Dependency Name="Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport" Version="9.0.3-servicing.25105.2">
@ -79,9 +79,9 @@
<SourceBuild RepoName="emsdk" ManagedOnly="true" /> <SourceBuild RepoName="emsdk" ManagedOnly="true" />
</Dependency> </Dependency>
<!-- Intermediate is necessary for source build. --> <!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="9.0.0-alpha.1.25060.3"> <Dependency Name="Microsoft.SourceBuild.Intermediate.source-build-reference-packages" Version="9.0.0-alpha.1.25081.6">
<Uri>https://github.com/dotnet/source-build-reference-packages</Uri> <Uri>https://github.com/dotnet/source-build-reference-packages</Uri>
<Sha>f5fa796273e4e59926e3fab26e1ab9e7d577f5e5</Sha> <Sha>1cec3b4a8fb07138136a1ca1e04763bfcf7841db</Sha>
<SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" /> <SourceBuild RepoName="source-build-reference-packages" ManagedOnly="true" />
</Dependency> </Dependency>
<!-- Intermediate is necessary for source build. --> <!-- Intermediate is necessary for source build. -->
@ -92,139 +92,139 @@
</Dependency> </Dependency>
</ProductDependencies> </ProductDependencies>
<ToolsetDependencies> <ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<!-- Intermediate is necessary for source build. --> <!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" /> <SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.XliffTasks" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.XliffTasks" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.GenAPI" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.GenAPI" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.GenFacades" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.GenFacades" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.XUnitAssert" Version="2.9.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.XUnitAssert" Version="2.9.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.XUnitExtensions" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.XUnitConsoleRunner" Version="2.9.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.XUnitConsoleRunner" Version="2.9.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Archives" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.Build.Tasks.Archives" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.Build.Tasks.Packaging" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.Build.Tasks.Installers" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.Build.Tasks.Templating" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Workloads" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.Build.Tasks.Workloads" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.TargetFramework" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.Build.Tasks.TargetFramework" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.RemoteExecutor" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.Build.Tasks.Feed" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.VersionTools.Tasks" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.VersionTools.Tasks" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.SharedFramework.Sdk" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.SharedFramework.Sdk" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="System.ComponentModel.TypeConverter.TestData" Version="9.0.0-beta.24517.2"> <Dependency Name="System.ComponentModel.TypeConverter.TestData" Version="9.0.0-beta.25071.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri> <Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha> <Sha>ceeaaca3ae019d656421fdf49fc2dde5f29c9d09</Sha>
</Dependency> </Dependency>
<Dependency Name="System.Data.Common.TestData" Version="9.0.0-beta.24517.2"> <Dependency Name="System.Data.Common.TestData" Version="9.0.0-beta.25071.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri> <Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha> <Sha>ceeaaca3ae019d656421fdf49fc2dde5f29c9d09</Sha>
</Dependency> </Dependency>
<Dependency Name="System.Drawing.Common.TestData" Version="9.0.0-beta.24517.2"> <Dependency Name="System.Drawing.Common.TestData" Version="9.0.0-beta.25071.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri> <Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha> <Sha>ceeaaca3ae019d656421fdf49fc2dde5f29c9d09</Sha>
</Dependency> </Dependency>
<Dependency Name="System.Formats.Tar.TestData" Version="9.0.0-beta.24517.2"> <Dependency Name="System.Formats.Tar.TestData" Version="9.0.0-beta.25071.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri> <Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha> <Sha>ceeaaca3ae019d656421fdf49fc2dde5f29c9d09</Sha>
</Dependency> </Dependency>
<Dependency Name="System.IO.Compression.TestData" Version="9.0.0-beta.24517.2"> <Dependency Name="System.IO.Compression.TestData" Version="9.0.0-beta.25071.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri> <Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha> <Sha>ceeaaca3ae019d656421fdf49fc2dde5f29c9d09</Sha>
</Dependency> </Dependency>
<Dependency Name="System.IO.Packaging.TestData" Version="9.0.0-beta.24517.2"> <Dependency Name="System.IO.Packaging.TestData" Version="9.0.0-beta.25071.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri> <Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha> <Sha>ceeaaca3ae019d656421fdf49fc2dde5f29c9d09</Sha>
</Dependency> </Dependency>
<Dependency Name="System.Net.TestData" Version="9.0.0-beta.24517.2"> <Dependency Name="System.Net.TestData" Version="9.0.0-beta.25071.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri> <Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha> <Sha>ceeaaca3ae019d656421fdf49fc2dde5f29c9d09</Sha>
</Dependency> </Dependency>
<Dependency Name="System.Private.Runtime.UnicodeData" Version="9.0.0-beta.24517.2"> <Dependency Name="System.Private.Runtime.UnicodeData" Version="9.0.0-beta.25071.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri> <Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha> <Sha>ceeaaca3ae019d656421fdf49fc2dde5f29c9d09</Sha>
</Dependency> </Dependency>
<Dependency Name="System.Runtime.TimeZoneData" Version="9.0.0-beta.24517.2"> <Dependency Name="System.Runtime.TimeZoneData" Version="9.0.0-beta.25071.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri> <Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha> <Sha>ceeaaca3ae019d656421fdf49fc2dde5f29c9d09</Sha>
</Dependency> </Dependency>
<Dependency Name="System.Security.Cryptography.X509Certificates.TestData" Version="9.0.0-beta.24517.2"> <Dependency Name="System.Security.Cryptography.X509Certificates.TestData" Version="9.0.0-beta.25071.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri> <Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha> <Sha>ceeaaca3ae019d656421fdf49fc2dde5f29c9d09</Sha>
</Dependency> </Dependency>
<Dependency Name="System.Text.RegularExpressions.TestData" Version="9.0.0-beta.24517.2"> <Dependency Name="System.Text.RegularExpressions.TestData" Version="9.0.0-beta.25071.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri> <Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha> <Sha>ceeaaca3ae019d656421fdf49fc2dde5f29c9d09</Sha>
</Dependency> </Dependency>
<Dependency Name="System.Windows.Extensions.TestData" Version="9.0.0-beta.24517.2"> <Dependency Name="System.Windows.Extensions.TestData" Version="9.0.0-beta.25071.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri> <Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha> <Sha>ceeaaca3ae019d656421fdf49fc2dde5f29c9d09</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.CilStrip.Sources" Version="9.0.0-beta.24517.2"> <Dependency Name="Microsoft.DotNet.CilStrip.Sources" Version="9.0.0-beta.25071.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri> <Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha> <Sha>ceeaaca3ae019d656421fdf49fc2dde5f29c9d09</Sha>
</Dependency> </Dependency>
<Dependency Name="runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="19.1.0-alpha.1.24575.1" CoherentParentDependency="Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport"> <Dependency Name="runtime.linux-arm64.Microsoft.NETCore.Runtime.Mono.LLVM.Sdk" Version="19.1.0-alpha.1.24575.1" CoherentParentDependency="Microsoft.NET.Workload.Emscripten.Current.Manifest-9.0.100.Transport">
<Uri>https://github.com/dotnet/llvm-project</Uri> <Uri>https://github.com/dotnet/llvm-project</Uri>
@ -320,21 +320,21 @@
<Uri>https://github.com/dotnet/runtime</Uri> <Uri>https://github.com/dotnet/runtime</Uri>
<Sha>b030c4dfdfa1bf287f10f96006619a06bc2000ae</Sha> <Sha>b030c4dfdfa1bf287f10f96006619a06bc2000ae</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="9.0.0-prerelease.25057.1"> <Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Common" Version="9.0.0-prerelease.25103.3">
<Uri>https://github.com/dotnet/xharness</Uri> <Uri>https://github.com/dotnet/xharness</Uri>
<Sha>b19a0fbe866756907e546ed927b013687689b4ee</Sha> <Sha>22a44bd14f5d6308acdda4b6dd67e4d7aa0bca5b</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="9.0.0-prerelease.25057.1"> <Dependency Name="Microsoft.DotNet.XHarness.TestRunners.Xunit" Version="9.0.0-prerelease.25103.3">
<Uri>https://github.com/dotnet/xharness</Uri> <Uri>https://github.com/dotnet/xharness</Uri>
<Sha>b19a0fbe866756907e546ed927b013687689b4ee</Sha> <Sha>22a44bd14f5d6308acdda4b6dd67e4d7aa0bca5b</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="9.0.0-prerelease.25057.1"> <Dependency Name="Microsoft.DotNet.XHarness.CLI" Version="9.0.0-prerelease.25103.3">
<Uri>https://github.com/dotnet/xharness</Uri> <Uri>https://github.com/dotnet/xharness</Uri>
<Sha>b19a0fbe866756907e546ed927b013687689b4ee</Sha> <Sha>22a44bd14f5d6308acdda4b6dd67e4d7aa0bca5b</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.PackageTesting" Version="9.0.0-beta.25058.5"> <Dependency Name="Microsoft.DotNet.PackageTesting" Version="9.0.0-beta.25077.4">
<Uri>https://github.com/dotnet/arcade</Uri> <Uri>https://github.com/dotnet/arcade</Uri>
<Sha>8cc6ecd76c24ef6665579a5c5e386a211a1e7c54</Sha> <Sha>bac7e1caea791275b7c3ccb4cb75fd6a04a26618</Sha>
</Dependency> </Dependency>
<Dependency Name="optimization.windows_nt-x64.MIBC.Runtime" Version="1.0.0-prerelease.24462.2"> <Dependency Name="optimization.windows_nt-x64.MIBC.Runtime" Version="1.0.0-prerelease.24462.2">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri> <Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
@ -352,48 +352,48 @@
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri> <Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-optimization</Uri>
<Sha>9d7532585ce71e30ab55f0364d3cecccaf0775d1</Sha> <Sha>9d7532585ce71e30ab55f0364d3cecccaf0775d1</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.HotReload.Utils.Generator.BuildTool" Version="9.0.0-alpha.0.25057.3"> <Dependency Name="Microsoft.DotNet.HotReload.Utils.Generator.BuildTool" Version="9.0.0-alpha.0.25077.3">
<Uri>https://github.com/dotnet/hotreload-utils</Uri> <Uri>https://github.com/dotnet/hotreload-utils</Uri>
<Sha>0c557eb70fff0d39a63cb18d386e0c52bbfa9cab</Sha> <Sha>fe67b0da4c0a7e82f0f9a4da1cb966c730e6934f</Sha>
</Dependency> </Dependency>
<Dependency Name="System.Runtime.Numerics.TestData" Version="9.0.0-beta.24517.2"> <Dependency Name="System.Runtime.Numerics.TestData" Version="9.0.0-beta.25071.2">
<Uri>https://github.com/dotnet/runtime-assets</Uri> <Uri>https://github.com/dotnet/runtime-assets</Uri>
<Sha>be3ffb86e48ffd7f75babda38cba492aa058f04f</Sha> <Sha>ceeaaca3ae019d656421fdf49fc2dde5f29c9d09</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.12.0-3.24631.1"> <Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.12.0-3.25105.5">
<Uri>https://github.com/dotnet/roslyn</Uri> <Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>da7c6c4257b2f661024b9a506773372a09023eee</Sha> <Sha>25acc509a1cb1d1a4923b0091cbc5ce837b024d0</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.CodeAnalysis" Version="4.12.0-3.24631.1"> <Dependency Name="Microsoft.CodeAnalysis" Version="4.12.0-3.25105.5">
<Uri>https://github.com/dotnet/roslyn</Uri> <Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>da7c6c4257b2f661024b9a506773372a09023eee</Sha> <Sha>25acc509a1cb1d1a4923b0091cbc5ce837b024d0</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.12.0-3.24631.1"> <Dependency Name="Microsoft.CodeAnalysis.CSharp" Version="4.12.0-3.25105.5">
<Uri>https://github.com/dotnet/roslyn</Uri> <Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>da7c6c4257b2f661024b9a506773372a09023eee</Sha> <Sha>25acc509a1cb1d1a4923b0091cbc5ce837b024d0</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.24629.2"> <Dependency Name="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0-beta1.25076.3">
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri> <Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
<Sha>5bfaf6aea5cf9d1c924d9adc69916eac3be07880</Sha> <Sha>16865ea61910500f1022ad2b96c499e5df02c228</Sha>
</Dependency> </Dependency>
<Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0-preview.24629.2"> <Dependency Name="Microsoft.CodeAnalysis.NetAnalyzers" Version="9.0.0-preview.25076.3">
<Uri>https://github.com/dotnet/roslyn-analyzers</Uri> <Uri>https://github.com/dotnet/roslyn-analyzers</Uri>
<Sha>5bfaf6aea5cf9d1c924d9adc69916eac3be07880</Sha> <Sha>16865ea61910500f1022ad2b96c499e5df02c228</Sha>
</Dependency> </Dependency>
<!-- Intermediate is necessary for source build. --> <!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.12.0-3.24631.1"> <Dependency Name="Microsoft.SourceBuild.Intermediate.roslyn" Version="4.12.0-3.25105.5">
<Uri>https://github.com/dotnet/roslyn</Uri> <Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>da7c6c4257b2f661024b9a506773372a09023eee</Sha> <Sha>25acc509a1cb1d1a4923b0091cbc5ce837b024d0</Sha>
<SourceBuild RepoName="roslyn" ManagedOnly="true" /> <SourceBuild RepoName="roslyn" ManagedOnly="true" />
</Dependency> </Dependency>
<Dependency Name="Microsoft.DotNet.ApiCompat.Task" Version="9.0.102"> <Dependency Name="Microsoft.DotNet.ApiCompat.Task" Version="9.0.103">
<Uri>https://github.com/dotnet/sdk</Uri> <Uri>https://github.com/dotnet/sdk</Uri>
<Sha>a345a00343aa14a693aec75a3d56fc07e99e517f</Sha> <Sha>049799c39d766c58ef6388865d5f5ed273b6a75e</Sha>
</Dependency> </Dependency>
<!-- Intermediate is necessary for source build. --> <!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.sdk" Version="9.0.102-servicing.24610.2"> <Dependency Name="Microsoft.SourceBuild.Intermediate.sdk" Version="9.0.103-servicing.25065.25">
<Uri>https://github.com/dotnet/sdk</Uri> <Uri>https://github.com/dotnet/sdk</Uri>
<Sha>a345a00343aa14a693aec75a3d56fc07e99e517f</Sha> <Sha>049799c39d766c58ef6388865d5f5ed273b6a75e</Sha>
<SourceBuild RepoName="sdk" ManagedOnly="true" /> <SourceBuild RepoName="sdk" ManagedOnly="true" />
</Dependency> </Dependency>
<Dependency Name="optimization.windows_nt-arm64.MIBC.Runtime" Version="1.0.0-prerelease.24462.2"> <Dependency Name="optimization.windows_nt-arm64.MIBC.Runtime" Version="1.0.0-prerelease.24462.2">

View file

@ -36,17 +36,17 @@
</ItemGroup> </ItemGroup>
<PropertyGroup> <PropertyGroup>
<!-- dotnet/roslyn-analyzers dependencies --> <!-- dotnet/roslyn-analyzers dependencies -->
<MicrosoftCodeAnalysisAnalyzersVersion>3.11.0-beta1.24629.2</MicrosoftCodeAnalysisAnalyzersVersion> <MicrosoftCodeAnalysisAnalyzersVersion>3.11.0-beta1.25076.3</MicrosoftCodeAnalysisAnalyzersVersion>
<MicrosoftCodeAnalysisNetAnalyzersVersion>9.0.0-preview.24629.2</MicrosoftCodeAnalysisNetAnalyzersVersion> <MicrosoftCodeAnalysisNetAnalyzersVersion>9.0.0-preview.25076.3</MicrosoftCodeAnalysisNetAnalyzersVersion>
<!-- dotnet/roslyn dependencies --> <!-- dotnet/roslyn dependencies -->
<!-- <!--
These versions should not be used by any project that contributes to the design-time experience in VS, such as an analyzer, code-fix, or generator assembly. These versions should not be used by any project that contributes to the design-time experience in VS, such as an analyzer, code-fix, or generator assembly.
Any tools that contribute to the design-time experience should use the MicrosoftCodeAnalysisVersion_LatestVS property above to ensure Any tools that contribute to the design-time experience should use the MicrosoftCodeAnalysisVersion_LatestVS property above to ensure
they do not break the local dev experience. they do not break the local dev experience.
--> -->
<MicrosoftCodeAnalysisCSharpVersion>4.12.0-3.24631.1</MicrosoftCodeAnalysisCSharpVersion> <MicrosoftCodeAnalysisCSharpVersion>4.12.0-3.25105.5</MicrosoftCodeAnalysisCSharpVersion>
<MicrosoftCodeAnalysisVersion>4.12.0-3.24631.1</MicrosoftCodeAnalysisVersion> <MicrosoftCodeAnalysisVersion>4.12.0-3.25105.5</MicrosoftCodeAnalysisVersion>
<MicrosoftNetCompilersToolsetVersion>4.12.0-3.24631.1</MicrosoftNetCompilersToolsetVersion> <MicrosoftNetCompilersToolsetVersion>4.12.0-3.25105.5</MicrosoftNetCompilersToolsetVersion>
</PropertyGroup> </PropertyGroup>
<!-- <!--
For source generator support we need to target multiple versions of Roslyn in order to be able to run on older versions of Roslyn. For source generator support we need to target multiple versions of Roslyn in order to be able to run on older versions of Roslyn.
@ -83,24 +83,24 @@
<PropertyGroup> <PropertyGroup>
<StaticCsVersion>0.2.0</StaticCsVersion> <StaticCsVersion>0.2.0</StaticCsVersion>
<!-- SDK dependencies (also used in wasm build tests --> <!-- SDK dependencies (also used in wasm build tests -->
<MicrosoftDotNetApiCompatTaskVersion>9.0.102</MicrosoftDotNetApiCompatTaskVersion> <MicrosoftDotNetApiCompatTaskVersion>9.0.103</MicrosoftDotNetApiCompatTaskVersion>
<!-- Arcade dependencies --> <!-- Arcade dependencies -->
<MicrosoftDotNetBuildTasksFeedVersion>9.0.0-beta.25058.5</MicrosoftDotNetBuildTasksFeedVersion> <MicrosoftDotNetBuildTasksFeedVersion>9.0.0-beta.25077.4</MicrosoftDotNetBuildTasksFeedVersion>
<MicrosoftDotNetCodeAnalysisVersion>9.0.0-beta.25058.5</MicrosoftDotNetCodeAnalysisVersion> <MicrosoftDotNetCodeAnalysisVersion>9.0.0-beta.25077.4</MicrosoftDotNetCodeAnalysisVersion>
<MicrosoftDotNetGenAPIVersion>9.0.0-beta.25058.5</MicrosoftDotNetGenAPIVersion> <MicrosoftDotNetGenAPIVersion>9.0.0-beta.25077.4</MicrosoftDotNetGenAPIVersion>
<MicrosoftDotNetGenFacadesVersion>9.0.0-beta.25058.5</MicrosoftDotNetGenFacadesVersion> <MicrosoftDotNetGenFacadesVersion>9.0.0-beta.25077.4</MicrosoftDotNetGenFacadesVersion>
<MicrosoftDotNetXUnitAssertVersion>2.9.0-beta.25058.5</MicrosoftDotNetXUnitAssertVersion> <MicrosoftDotNetXUnitAssertVersion>2.9.0-beta.25077.4</MicrosoftDotNetXUnitAssertVersion>
<MicrosoftDotNetXUnitExtensionsVersion>9.0.0-beta.25058.5</MicrosoftDotNetXUnitExtensionsVersion> <MicrosoftDotNetXUnitExtensionsVersion>9.0.0-beta.25077.4</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftDotNetXUnitConsoleRunnerVersion>2.9.0-beta.25058.5</MicrosoftDotNetXUnitConsoleRunnerVersion> <MicrosoftDotNetXUnitConsoleRunnerVersion>2.9.0-beta.25077.4</MicrosoftDotNetXUnitConsoleRunnerVersion>
<MicrosoftDotNetBuildTasksArchivesVersion>9.0.0-beta.25058.5</MicrosoftDotNetBuildTasksArchivesVersion> <MicrosoftDotNetBuildTasksArchivesVersion>9.0.0-beta.25077.4</MicrosoftDotNetBuildTasksArchivesVersion>
<MicrosoftDotNetBuildTasksInstallersVersion>9.0.0-beta.25058.5</MicrosoftDotNetBuildTasksInstallersVersion> <MicrosoftDotNetBuildTasksInstallersVersion>9.0.0-beta.25077.4</MicrosoftDotNetBuildTasksInstallersVersion>
<MicrosoftDotNetBuildTasksPackagingVersion>9.0.0-beta.25058.5</MicrosoftDotNetBuildTasksPackagingVersion> <MicrosoftDotNetBuildTasksPackagingVersion>9.0.0-beta.25077.4</MicrosoftDotNetBuildTasksPackagingVersion>
<MicrosoftDotNetBuildTasksTargetFrameworkVersion>9.0.0-beta.25058.5</MicrosoftDotNetBuildTasksTargetFrameworkVersion> <MicrosoftDotNetBuildTasksTargetFrameworkVersion>9.0.0-beta.25077.4</MicrosoftDotNetBuildTasksTargetFrameworkVersion>
<MicrosoftDotNetBuildTasksTemplatingVersion>9.0.0-beta.25058.5</MicrosoftDotNetBuildTasksTemplatingVersion> <MicrosoftDotNetBuildTasksTemplatingVersion>9.0.0-beta.25077.4</MicrosoftDotNetBuildTasksTemplatingVersion>
<MicrosoftDotNetBuildTasksWorkloadsPackageVersion>9.0.0-beta.25058.5</MicrosoftDotNetBuildTasksWorkloadsPackageVersion> <MicrosoftDotNetBuildTasksWorkloadsPackageVersion>9.0.0-beta.25077.4</MicrosoftDotNetBuildTasksWorkloadsPackageVersion>
<MicrosoftDotNetRemoteExecutorVersion>9.0.0-beta.25058.5</MicrosoftDotNetRemoteExecutorVersion> <MicrosoftDotNetRemoteExecutorVersion>9.0.0-beta.25077.4</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetVersionToolsTasksVersion>9.0.0-beta.25058.5</MicrosoftDotNetVersionToolsTasksVersion> <MicrosoftDotNetVersionToolsTasksVersion>9.0.0-beta.25077.4</MicrosoftDotNetVersionToolsTasksVersion>
<MicrosoftDotNetPackageTestingVersion>9.0.0-beta.25058.5</MicrosoftDotNetPackageTestingVersion> <MicrosoftDotNetPackageTestingVersion>9.0.0-beta.25077.4</MicrosoftDotNetPackageTestingVersion>
<!-- TODO: Remove pinned xunit.analyzers version: https://github.com/dotnet/runtime/issues/97088 --> <!-- TODO: Remove pinned xunit.analyzers version: https://github.com/dotnet/runtime/issues/97088 -->
<XUnitAnalyzersVersion>1.4.0</XUnitAnalyzersVersion> <XUnitAnalyzersVersion>1.4.0</XUnitAnalyzersVersion>
<!-- NuGet dependencies --> <!-- NuGet dependencies -->
@ -141,20 +141,20 @@
<SystemReflectionMetadataToolsetVersion>8.0.0</SystemReflectionMetadataToolsetVersion> <SystemReflectionMetadataToolsetVersion>8.0.0</SystemReflectionMetadataToolsetVersion>
<SystemReflectionMetadataLoadContextToolsetVersion>8.0.0</SystemReflectionMetadataLoadContextToolsetVersion> <SystemReflectionMetadataLoadContextToolsetVersion>8.0.0</SystemReflectionMetadataLoadContextToolsetVersion>
<!-- Runtime-Assets dependencies --> <!-- Runtime-Assets dependencies -->
<SystemRuntimeNumericsTestDataVersion>9.0.0-beta.24517.2</SystemRuntimeNumericsTestDataVersion> <SystemRuntimeNumericsTestDataVersion>9.0.0-beta.25071.2</SystemRuntimeNumericsTestDataVersion>
<SystemComponentModelTypeConverterTestDataVersion>9.0.0-beta.24517.2</SystemComponentModelTypeConverterTestDataVersion> <SystemComponentModelTypeConverterTestDataVersion>9.0.0-beta.25071.2</SystemComponentModelTypeConverterTestDataVersion>
<SystemDataCommonTestDataVersion>9.0.0-beta.24517.2</SystemDataCommonTestDataVersion> <SystemDataCommonTestDataVersion>9.0.0-beta.25071.2</SystemDataCommonTestDataVersion>
<SystemDrawingCommonTestDataVersion>9.0.0-beta.24517.2</SystemDrawingCommonTestDataVersion> <SystemDrawingCommonTestDataVersion>9.0.0-beta.25071.2</SystemDrawingCommonTestDataVersion>
<SystemFormatsTarTestDataVersion>9.0.0-beta.24517.2</SystemFormatsTarTestDataVersion> <SystemFormatsTarTestDataVersion>9.0.0-beta.25071.2</SystemFormatsTarTestDataVersion>
<SystemIOCompressionTestDataVersion>9.0.0-beta.24517.2</SystemIOCompressionTestDataVersion> <SystemIOCompressionTestDataVersion>9.0.0-beta.25071.2</SystemIOCompressionTestDataVersion>
<SystemIOPackagingTestDataVersion>9.0.0-beta.24517.2</SystemIOPackagingTestDataVersion> <SystemIOPackagingTestDataVersion>9.0.0-beta.25071.2</SystemIOPackagingTestDataVersion>
<SystemNetTestDataVersion>9.0.0-beta.24517.2</SystemNetTestDataVersion> <SystemNetTestDataVersion>9.0.0-beta.25071.2</SystemNetTestDataVersion>
<SystemPrivateRuntimeUnicodeDataVersion>9.0.0-beta.24517.2</SystemPrivateRuntimeUnicodeDataVersion> <SystemPrivateRuntimeUnicodeDataVersion>9.0.0-beta.25071.2</SystemPrivateRuntimeUnicodeDataVersion>
<SystemRuntimeTimeZoneDataVersion>9.0.0-beta.24517.2</SystemRuntimeTimeZoneDataVersion> <SystemRuntimeTimeZoneDataVersion>9.0.0-beta.25071.2</SystemRuntimeTimeZoneDataVersion>
<SystemSecurityCryptographyX509CertificatesTestDataVersion>9.0.0-beta.24517.2</SystemSecurityCryptographyX509CertificatesTestDataVersion> <SystemSecurityCryptographyX509CertificatesTestDataVersion>9.0.0-beta.25071.2</SystemSecurityCryptographyX509CertificatesTestDataVersion>
<SystemTextRegularExpressionsTestDataVersion>9.0.0-beta.24517.2</SystemTextRegularExpressionsTestDataVersion> <SystemTextRegularExpressionsTestDataVersion>9.0.0-beta.25071.2</SystemTextRegularExpressionsTestDataVersion>
<SystemWindowsExtensionsTestDataVersion>9.0.0-beta.24517.2</SystemWindowsExtensionsTestDataVersion> <SystemWindowsExtensionsTestDataVersion>9.0.0-beta.25071.2</SystemWindowsExtensionsTestDataVersion>
<MicrosoftDotNetCilStripSourcesVersion>9.0.0-beta.24517.2</MicrosoftDotNetCilStripSourcesVersion> <MicrosoftDotNetCilStripSourcesVersion>9.0.0-beta.25071.2</MicrosoftDotNetCilStripSourcesVersion>
<!-- dotnet-optimization dependencies --> <!-- dotnet-optimization dependencies -->
<optimizationwindows_ntx64MIBCRuntimeVersion>1.0.0-prerelease.24462.2</optimizationwindows_ntx64MIBCRuntimeVersion> <optimizationwindows_ntx64MIBCRuntimeVersion>1.0.0-prerelease.24462.2</optimizationwindows_ntx64MIBCRuntimeVersion>
<optimizationwindows_ntx86MIBCRuntimeVersion>1.0.0-prerelease.24462.2</optimizationwindows_ntx86MIBCRuntimeVersion> <optimizationwindows_ntx86MIBCRuntimeVersion>1.0.0-prerelease.24462.2</optimizationwindows_ntx86MIBCRuntimeVersion>
@ -184,10 +184,10 @@
<!-- Testing --> <!-- Testing -->
<MicrosoftNETCoreCoreDisToolsVersion>1.4.0</MicrosoftNETCoreCoreDisToolsVersion> <MicrosoftNETCoreCoreDisToolsVersion>1.4.0</MicrosoftNETCoreCoreDisToolsVersion>
<MicrosoftNETTestSdkVersion>17.4.0-preview-20220707-01</MicrosoftNETTestSdkVersion> <MicrosoftNETTestSdkVersion>17.4.0-preview-20220707-01</MicrosoftNETTestSdkVersion>
<MicrosoftDotNetXHarnessTestRunnersCommonVersion>9.0.0-prerelease.25057.1</MicrosoftDotNetXHarnessTestRunnersCommonVersion> <MicrosoftDotNetXHarnessTestRunnersCommonVersion>9.0.0-prerelease.25103.3</MicrosoftDotNetXHarnessTestRunnersCommonVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>9.0.0-prerelease.25057.1</MicrosoftDotNetXHarnessTestRunnersXunitVersion> <MicrosoftDotNetXHarnessTestRunnersXunitVersion>9.0.0-prerelease.25103.3</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
<MicrosoftDotNetXHarnessCLIVersion>9.0.0-prerelease.25057.1</MicrosoftDotNetXHarnessCLIVersion> <MicrosoftDotNetXHarnessCLIVersion>9.0.0-prerelease.25103.3</MicrosoftDotNetXHarnessCLIVersion>
<MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>9.0.0-alpha.0.25057.3</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion> <MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>9.0.0-alpha.0.25077.3</MicrosoftDotNetHotReloadUtilsGeneratorBuildToolVersion>
<NUnitVersion>3.12.0</NUnitVersion> <NUnitVersion>3.12.0</NUnitVersion>
<NUnit3TestAdapterVersion>4.5.0</NUnit3TestAdapterVersion> <NUnit3TestAdapterVersion>4.5.0</NUnit3TestAdapterVersion>
<CoverletCollectorVersion>6.0.0</CoverletCollectorVersion> <CoverletCollectorVersion>6.0.0</CoverletCollectorVersion>
@ -215,11 +215,11 @@
<!-- Docs --> <!-- Docs -->
<MicrosoftPrivateIntellisenseVersion>9.0.0-preview-20241010.1</MicrosoftPrivateIntellisenseVersion> <MicrosoftPrivateIntellisenseVersion>9.0.0-preview-20241010.1</MicrosoftPrivateIntellisenseVersion>
<!-- Mono Cecil --> <!-- Mono Cecil -->
<MicrosoftDotNetCecilVersion>0.11.5-alpha.25056.3</MicrosoftDotNetCecilVersion> <MicrosoftDotNetCecilVersion>0.11.5-alpha.25102.5</MicrosoftDotNetCecilVersion>
<!-- ILCompiler --> <!-- ILCompiler -->
<MicrosoftDotNetILCompilerVersion>9.0.0-rtm.24511.16</MicrosoftDotNetILCompilerVersion> <MicrosoftDotNetILCompilerVersion>9.0.0-rtm.24511.16</MicrosoftDotNetILCompilerVersion>
<!-- ICU --> <!-- ICU -->
<MicrosoftNETCoreRuntimeICUTransportVersion>9.0.0-rtm.25061.1</MicrosoftNETCoreRuntimeICUTransportVersion> <MicrosoftNETCoreRuntimeICUTransportVersion>9.0.0-rtm.25105.1</MicrosoftNETCoreRuntimeICUTransportVersion>
<MicrosoftNETCoreRuntimeICUTransportVersion>9.0.0-rtm.24466.4</MicrosoftNETCoreRuntimeICUTransportVersion> <MicrosoftNETCoreRuntimeICUTransportVersion>9.0.0-rtm.24466.4</MicrosoftNETCoreRuntimeICUTransportVersion>
<!-- MsQuic --> <!-- MsQuic -->
<MicrosoftNativeQuicMsQuicSchannelVersion>2.4.3</MicrosoftNativeQuicMsQuicSchannelVersion> <MicrosoftNativeQuicMsQuicSchannelVersion>2.4.3</MicrosoftNativeQuicMsQuicSchannelVersion>
@ -263,7 +263,7 @@
<MicrosoftSymbolStoreVersion>1.0.406601</MicrosoftSymbolStoreVersion> <MicrosoftSymbolStoreVersion>1.0.406601</MicrosoftSymbolStoreVersion>
<!-- sdk version, for testing workloads --> <!-- sdk version, for testing workloads -->
<!--<SdkVersionForWorkloadTesting>$(MicrosoftDotNetApiCompatTaskVersion)</SdkVersionForWorkloadTesting>--> <!--<SdkVersionForWorkloadTesting>$(MicrosoftDotNetApiCompatTaskVersion)</SdkVersionForWorkloadTesting>-->
<SdkVersionForWorkloadTesting>9.0.101</SdkVersionForWorkloadTesting> <SdkVersionForWorkloadTesting>9.0.102</SdkVersionForWorkloadTesting>
<runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion>9.0.0-alpha.1.24175.1</runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion> <runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion>9.0.0-alpha.1.24175.1</runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion>
<EmsdkPackageVersion>$(MicrosoftNETRuntimeEmscriptenVersion)</EmsdkPackageVersion> <EmsdkPackageVersion>$(MicrosoftNETRuntimeEmscriptenVersion)</EmsdkPackageVersion>
<NodePackageVersion>$(runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion)</NodePackageVersion> <NodePackageVersion>$(runtimewinx64MicrosoftNETCoreRuntimeWasmNodeTransportPackageVersion)</NodePackageVersion>

View file

@ -15,16 +15,6 @@
<PackageReference Include="Microsoft.DotNet.IBCMerge" Version="$(MicrosoftDotNetIBCMergeVersion)" Condition="'$(UsingToolIbcOptimization)' == 'true'" /> <PackageReference Include="Microsoft.DotNet.IBCMerge" Version="$(MicrosoftDotNetIBCMergeVersion)" Condition="'$(UsingToolIbcOptimization)' == 'true'" />
<PackageReference Include="Drop.App" Version="$(DropAppVersion)" ExcludeAssets="all" Condition="'$(UsingToolVisualStudioIbcTraining)' == 'true'"/> <PackageReference Include="Drop.App" Version="$(DropAppVersion)" ExcludeAssets="all" Condition="'$(UsingToolVisualStudioIbcTraining)' == 'true'"/>
</ItemGroup> </ItemGroup>
<PropertyGroup>
<RestoreSources></RestoreSources>
<RestoreSources Condition="'$(UsingToolIbcOptimization)' == 'true'">
https://devdiv.pkgs.visualstudio.com/_packaging/dotnet-core-internal-tooling/nuget/v3/index.json;
</RestoreSources>
<RestoreSources Condition="'$(UsingToolVisualStudioIbcTraining)' == 'true'">
$(RestoreSources);
https://devdiv.pkgs.visualstudio.com/_packaging/VS/nuget/v3/index.json;
</RestoreSources>
</PropertyGroup>
<!-- Repository extensibility point --> <!-- Repository extensibility point -->
<Import Project="$(RepositoryEngineeringDir)InternalTools.props" Condition="Exists('$(RepositoryEngineeringDir)InternalTools.props')" /> <Import Project="$(RepositoryEngineeringDir)InternalTools.props" Condition="Exists('$(RepositoryEngineeringDir)InternalTools.props')" />

View file

@ -57,7 +57,7 @@ extends:
Note: Multiple outputs are ONLY applicable to 1ES PT publishing (only usable when referencing `templates-official`). Note: Multiple outputs are ONLY applicable to 1ES PT publishing (only usable when referencing `templates-official`).
# Development notes ## Development notes
**Folder / file structure** **Folder / file structure**

View file

@ -127,7 +127,6 @@ jobs:
- ${{ if ne(parameters.jobParameters.testScope, 'outerloop') }}: - ${{ if ne(parameters.jobParameters.testScope, 'outerloop') }}:
- (Windows.10.Amd64.ServerRS5.Open)windows.10.amd64.serverrs5.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2019-helix-amd64 - (Windows.10.Amd64.ServerRS5.Open)windows.10.amd64.serverrs5.open@mcr.microsoft.com/dotnet-buildtools/prereqs:windowsservercore-ltsc2019-helix-amd64
- ${{ if or(ne(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}: - ${{ if or(ne(parameters.jobParameters.isExtraPlatformsBuild, true), eq(parameters.jobParameters.includeAllPlatforms, true)) }}:
- Windows.81.Amd64.Open
- Windows.Amd64.Server2022.Open - Windows.Amd64.Server2022.Open
- Windows.11.Amd64.Client.Open - Windows.11.Amd64.Client.Open
- ${{ if eq(parameters.jobParameters.testScope, 'outerloop') }}: - ${{ if eq(parameters.jobParameters.testScope, 'outerloop') }}:

View file

@ -4,6 +4,24 @@
trigger: none trigger: none
# To reduce the load on the pipeline, enable it only for PRs that affect Mono LLVM related code.
pr:
branches:
include:
- main
- release/*.*
paths:
include:
- src/mono/mono/mini/aot-*.*
- src/mono/mono/mini/llvm-*.*
- src/mono/mono/mini/mini-llvm-*.*
- src/mono/mono/mini/intrinsics.c
- src/mono/mono/mini/simd-*.*
- src/mono/mono/mini/decompose.c
- src/mono/mono/mini/method-to-ir.c
- src/mono/mono/mini/mini.c
variables: variables:
- template: /eng/pipelines/common/variables.yml - template: /eng/pipelines/common/variables.yml

View file

@ -28,6 +28,24 @@ schedules:
- main - main
always: false # run only if there were changes since the last successful scheduled run. always: false # run only if there were changes since the last successful scheduled run.
# To reduce the load on the pipeline, enable it only for PRs that affect Mono LLVM related code.
pr:
branches:
include:
- main
- release/*.*
paths:
include:
- src/mono/mono/mini/aot-*.*
- src/mono/mono/mini/llvm-*.*
- src/mono/mono/mini/mini-llvm-*.*
- src/mono/mono/mini/intrinsics.c
- src/mono/mono/mini/simd-*.*
- src/mono/mono/mini/decompose.c
- src/mono/mono/mini/method-to-ir.c
- src/mono/mono/mini/mini.c
variables: variables:
- template: /eng/pipelines/common/variables.yml - template: /eng/pipelines/common/variables.yml

View file

@ -926,25 +926,25 @@ extends:
# WASI/WASM # WASI/WASM
- template: /eng/pipelines/common/templates/wasm-library-tests.yml # - template: /eng/pipelines/common/templates/wasm-library-tests.yml
parameters: # parameters:
platforms: # platforms:
- wasi_wasm # - wasi_wasm
- wasi_wasm_win # - wasi_wasm_win
nameSuffix: '_Smoke' # nameSuffix: '_Smoke'
extraBuildArgs: /p:EnableAggressiveTrimming=true /p:RunWasmSamples=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) # extraBuildArgs: /p:EnableAggressiveTrimming=true /p:RunWasmSamples=true /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS)
shouldRunSmokeOnly: true # shouldRunSmokeOnly: true
alwaysRun: ${{ variables.isRollingBuild }} # alwaysRun: ${{ variables.isRollingBuild }}
scenarios: # scenarios:
- WasmTestOnWasmtime # - WasmTestOnWasmtime
- template: /eng/pipelines/common/templates/simple-wasm-build-tests.yml # - template: /eng/pipelines/common/templates/simple-wasm-build-tests.yml
parameters: # parameters:
platforms: # platforms:
- wasi_wasm # - wasi_wasm
- wasi_wasm_win # - wasi_wasm_win
extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS) # extraBuildArgs: /p:AotHostArchitecture=x64 /p:AotHostOS=$(_hostedOS)
alwaysRun: ${{ variables.isRollingBuild }} # alwaysRun: ${{ variables.isRollingBuild }}
# #
# Android devices # Android devices

View file

@ -1,7 +0,0 @@
Wasi.Build.Tests.InvariantTests
Wasi.Build.Tests.ILStripTests
Wasi.Build.Tests.SdkMissingTests
Wasi.Build.Tests.RuntimeConfigTests
Wasi.Build.Tests.WasiTemplateTests
Wasi.Build.Tests.PInvokeTableGeneratorTests
Wasi.Build.Tests.WasiLibraryModeTests

View file

@ -1,16 +1,16 @@
{ {
"sdk": { "sdk": {
"version": "9.0.100", "version": "9.0.102",
"allowPrerelease": true, "allowPrerelease": true,
"rollForward": "major" "rollForward": "major"
}, },
"tools": { "tools": {
"dotnet": "9.0.100" "dotnet": "9.0.102"
}, },
"msbuild-sdks": { "msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25058.5", "Microsoft.DotNet.Arcade.Sdk": "9.0.0-beta.25077.4",
"Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.25058.5", "Microsoft.DotNet.Helix.Sdk": "9.0.0-beta.25077.4",
"Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.25058.5", "Microsoft.DotNet.SharedFramework.Sdk": "9.0.0-beta.25077.4",
"Microsoft.Build.NoTargets": "3.7.0", "Microsoft.Build.NoTargets": "3.7.0",
"Microsoft.Build.Traversal": "3.4.0", "Microsoft.Build.Traversal": "3.4.0",
"Microsoft.NET.Sdk.IL": "9.0.0-rtm.24511.16" "Microsoft.NET.Sdk.IL": "9.0.0-rtm.24511.16"

View file

@ -1914,7 +1914,7 @@ BYTE* PrettyPrintCABlobValue(PCCOR_SIGNATURE &typePtr,
for(n=0; n < numElements; n++) for(n=0; n < numElements; n++)
{ {
if(n) appendStr(out," "); if(n) appendStr(out," ");
sprintf_s(str, 64, "%.*g", 8, (double)(*((float*)dataPtr))); sprintf_s(str, 64, "%#.8g", (double)(*((float*)dataPtr)));
float df = (float)atof(str); float df = (float)atof(str);
// Must compare as underlying bytes, not floating point otherwise optimizer will // Must compare as underlying bytes, not floating point otherwise optimizer will
// try to enregister and compare 80-bit precision number with 32-bit precision number!!!! // try to enregister and compare 80-bit precision number with 32-bit precision number!!!!
@ -1933,7 +1933,7 @@ BYTE* PrettyPrintCABlobValue(PCCOR_SIGNATURE &typePtr,
{ {
if(n) appendStr(out," "); if(n) appendStr(out," ");
char *pch; char *pch;
sprintf_s(str, 64, "%.*g", 17, *((double*)dataPtr)); sprintf_s(str, 64, "%#.17g", *((double*)dataPtr));
double df = strtod(str, &pch); double df = strtod(str, &pch);
// Must compare as underlying bytes, not floating point otherwise optimizer will // Must compare as underlying bytes, not floating point otherwise optimizer will
// try to enregister and compare 80-bit precision number with 64-bit precision number!!!! // try to enregister and compare 80-bit precision number with 64-bit precision number!!!!
@ -2605,7 +2605,7 @@ void DumpDefaultValue(mdToken tok, __inout __nullterminated char* szString, void
case ELEMENT_TYPE_R4: case ELEMENT_TYPE_R4:
{ {
char szf[32]; char szf[32];
sprintf_s(szf, 32, "%.*g", 8, (double)MDDV.m_fltValue); sprintf_s(szf, 32, "%#.8g", (double)MDDV.m_fltValue);
float df = (float)atof(szf); float df = (float)atof(szf);
// Must compare as underlying bytes, not floating point otherwise optimizer will // Must compare as underlying bytes, not floating point otherwise optimizer will
// try to enregister and compare 80-bit precision number with 32-bit precision number!!!! // try to enregister and compare 80-bit precision number with 32-bit precision number!!!!
@ -2619,7 +2619,7 @@ void DumpDefaultValue(mdToken tok, __inout __nullterminated char* szString, void
case ELEMENT_TYPE_R8: case ELEMENT_TYPE_R8:
{ {
char szf[32], *pch; char szf[32], *pch;
sprintf_s(szf, 32, "%.*g", 17, MDDV.m_dblValue); sprintf_s(szf, 32, "%#.17g", MDDV.m_dblValue);
double df = strtod(szf, &pch); //atof(szf); double df = strtod(szf, &pch); //atof(szf);
szf[31]=0; szf[31]=0;
// Must compare as underlying bytes, not floating point otherwise optimizer will // Must compare as underlying bytes, not floating point otherwise optimizer will

View file

@ -16,15 +16,6 @@
.macro NESTED_END Name, Section .macro NESTED_END Name, Section
LEAF_END \Name, \Section LEAF_END \Name, \Section
#if defined(__APPLE__)
.set LOCAL_LABEL(\Name\()_Size), . - C_FUNC(\Name)
.section __LD,__compact_unwind,regular,debug
.quad C_FUNC(\Name)
.long LOCAL_LABEL(\Name\()_Size)
.long 0x04000000 # DWARF
.quad 0
.quad 0
#endif
.endm .endm
.macro PATCH_LABEL Name .macro PATCH_LABEL Name

View file

@ -16,15 +16,6 @@
.macro NESTED_END Name, Section .macro NESTED_END Name, Section
LEAF_END \Name, \Section LEAF_END \Name, \Section
#if defined(__APPLE__)
.set LOCAL_LABEL(\Name\()_Size), . - C_FUNC(\Name)
.section __LD,__compact_unwind,regular,debug
.quad C_FUNC(\Name)
.long LOCAL_LABEL(\Name\()_Size)
.long 0x04000000 # DWARF
.quad 0
.quad 0
#endif
.endm .endm
.macro PATCH_LABEL Name .macro PATCH_LABEL Name

View file

@ -1445,11 +1445,18 @@ namespace
DWORD declArgCount; DWORD declArgCount;
IfFailThrow(CorSigUncompressData_EndPtr(pSig1, pEndSig1, &declArgCount)); IfFailThrow(CorSigUncompressData_EndPtr(pSig1, pEndSig1, &declArgCount));
// UnsafeAccessors for fields require return types be byref.
// This was explicitly checked in TryGenerateUnsafeAccessor().
if (pSig1 >= pEndSig1) if (pSig1 >= pEndSig1)
ThrowHR(META_E_BAD_SIGNATURE); ThrowHR(META_E_BAD_SIGNATURE);
// UnsafeAccessors for fields require return types be byref. However, we first need to
// consume any custom modifiers which are prior to the expected ELEMENT_TYPE_BYREF in
// the RetType signature (II.23.2.11).
_ASSERTE(state.IgnoreCustomModifiers); // We should always ignore custom modifiers for field look-up.
MetaSig::ConsumeCustomModifiers(pSig1, pEndSig1);
if (pSig1 >= pEndSig1)
ThrowHR(META_E_BAD_SIGNATURE);
// The ELEMENT_TYPE_BYREF was explicitly checked in TryGenerateUnsafeAccessor().
CorElementType byRefType = CorSigUncompressElementType(pSig1); CorElementType byRefType = CorSigUncompressElementType(pSig1);
_ASSERTE(byRefType == ELEMENT_TYPE_BYREF); _ASSERTE(byRefType == ELEMENT_TYPE_BYREF);

View file

@ -3604,7 +3604,7 @@ ErrExit:
#endif //!DACCESS_COMPILE #endif //!DACCESS_COMPILE
} // CompareTypeTokens } // CompareTypeTokens
static void ConsumeCustomModifiers(PCCOR_SIGNATURE& pSig, PCCOR_SIGNATURE pEndSig) void MetaSig::ConsumeCustomModifiers(PCCOR_SIGNATURE& pSig, PCCOR_SIGNATURE pEndSig)
{ {
mdToken tk; mdToken tk;
CorElementType type; CorElementType type;

View file

@ -945,6 +945,14 @@ class MetaSig
//------------------------------------------------------------------ //------------------------------------------------------------------
CorElementType GetByRefType(TypeHandle* pTy) const; CorElementType GetByRefType(TypeHandle* pTy) const;
//------------------------------------------------------------------
// Consume the custom modifiers, if any, in the current signature
// and update it.
// This is a non destructive operation if the current signature is not
// pointing at a sequence of ELEMENT_TYPE_CMOD_REQD or ELEMENT_TYPE_CMOD_OPT.
//------------------------------------------------------------------
static void ConsumeCustomModifiers(PCCOR_SIGNATURE& pSig, PCCOR_SIGNATURE pEndSig);
// Struct used to capture in/out state during the comparison // Struct used to capture in/out state during the comparison
// of element types. // of element types.
struct CompareState struct CompareState

View file

@ -377,7 +377,7 @@ void FreeLoaderAllocatorHandlesForTLSData(Thread *pThread)
#endif #endif
for (const auto& entry : g_pThreadStaticCollectibleTypeIndices->CollectibleEntries()) for (const auto& entry : g_pThreadStaticCollectibleTypeIndices->CollectibleEntries())
{ {
_ASSERTE((entry.TlsIndex.GetIndexOffset() <= pThread->cLoaderHandles) || allRemainingIndicesAreNotValid); _ASSERTE((entry.TlsIndex.GetIndexOffset() >= pThread->cLoaderHandles) || !allRemainingIndicesAreNotValid);
if (entry.TlsIndex.GetIndexOffset() >= pThread->cLoaderHandles) if (entry.TlsIndex.GetIndexOffset() >= pThread->cLoaderHandles)
{ {
#ifndef _DEBUG #ifndef _DEBUG
@ -390,7 +390,9 @@ void FreeLoaderAllocatorHandlesForTLSData(Thread *pThread)
{ {
if (pThread->pLoaderHandles[entry.TlsIndex.GetIndexOffset()] != (LOADERHANDLE)NULL) if (pThread->pLoaderHandles[entry.TlsIndex.GetIndexOffset()] != (LOADERHANDLE)NULL)
{ {
entry.pMT->GetLoaderAllocator()->FreeHandle(pThread->pLoaderHandles[entry.TlsIndex.GetIndexOffset()]); LoaderAllocator *pLoaderAllocator = entry.pMT->GetLoaderAllocator();
if (pLoaderAllocator->IsExposedObjectLive())
pLoaderAllocator->FreeHandle(pThread->pLoaderHandles[entry.TlsIndex.GetIndexOffset()]);
pThread->pLoaderHandles[entry.TlsIndex.GetIndexOffset()] = (LOADERHANDLE)NULL; pThread->pLoaderHandles[entry.TlsIndex.GetIndexOffset()] = (LOADERHANDLE)NULL;
} }
} }

View file

@ -64,9 +64,16 @@ namespace System.Net.Test.Common
if (PlatformDetection.IsFirefox) if (PlatformDetection.IsFirefox)
{ {
// https://github.com/dotnet/runtime/issues/101115 // https://github.com/dotnet/runtime/issues/101115
return [RemoteEchoServer]; // [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
// return [RemoteEchoServer];
return [];
} }
return [RemoteEchoServer, SecureRemoteEchoServer, Http2RemoteEchoServer]; return [
// [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
// RemoteEchoServer,
SecureRemoteEchoServer,
Http2RemoteEchoServer
];
} }
public static readonly Uri RemoteVerifyUploadServer = new Uri("http://" + Host + "/" + VerifyUploadHandler); public static readonly Uri RemoteVerifyUploadServer = new Uri("http://" + Host + "/" + VerifyUploadHandler);
@ -82,8 +89,20 @@ namespace System.Net.Test.Common
public static Uri RemoteLoopServer => new Uri("ws://" + RemoteLoopHost + "/" + RemoteLoopHandler); public static Uri RemoteLoopServer => new Uri("ws://" + RemoteLoopHost + "/" + RemoteLoopHandler);
public static readonly object[][] EchoServers = GetEchoServerList().Select(x => new object[] { x }).ToArray(); public static readonly object[][] EchoServers = GetEchoServerList().Select(x => new object[] { x }).ToArray();
public static readonly object[][] VerifyUploadServers = { new object[] { RemoteVerifyUploadServer }, new object[] { SecureRemoteVerifyUploadServer }, new object[] { Http2RemoteVerifyUploadServer } }; public static readonly object[][] VerifyUploadServers = {
public static readonly object[][] CompressedServers = { new object[] { RemoteDeflateServer }, new object[] { RemoteGZipServer }, new object[] { Http2RemoteDeflateServer }, new object[] { Http2RemoteGZipServer } }; // [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
// new object[] { RemoteVerifyUploadServer },
new object[] { SecureRemoteVerifyUploadServer },
new object[] { Http2RemoteVerifyUploadServer }
};
public static readonly object[][] CompressedServers = {
// [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
// new object[] { RemoteDeflateServer },
new object[] { RemoteGZipServer },
new object[] { Http2RemoteDeflateServer },
new object[] { Http2RemoteGZipServer }
};
public static readonly object[][] Http2Servers = { new object[] { new Uri("https://" + Http2Host) } }; public static readonly object[][] Http2Servers = { new object[] { new Uri("https://" + Http2Host) } };
public static readonly object[][] Http2NoPushServers = { new object[] { new Uri("https://" + Http2NoPushHost) } }; public static readonly object[][] Http2NoPushServers = { new object[] { new Uri("https://" + Http2NoPushHost) } };
@ -97,9 +116,17 @@ namespace System.Net.Test.Common
if (PlatformDetection.IsFirefox) if (PlatformDetection.IsFirefox)
{ {
// https://github.com/dotnet/runtime/issues/101115 // https://github.com/dotnet/runtime/issues/101115
return new RemoteServer[] { RemoteHttp11Server }; // [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
// return new RemoteServer[] { RemoteHttp11Server };
return [];
} }
return new RemoteServer[] { RemoteHttp11Server, RemoteSecureHttp11Server, RemoteHttp2Server }; return new RemoteServer[]
{
// [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
// RemoteHttp11Server,
RemoteSecureHttp11Server,
RemoteHttp2Server
};
} }
public static readonly IEnumerable<object[]> RemoteServersMemberData = GetRemoteServers().Select(s => new object[] { s }); public static readonly IEnumerable<object[]> RemoteServersMemberData = GetRemoteServers().Select(s => new object[] { s });

View file

@ -28,11 +28,14 @@ namespace System.Net.Test.Common
{ {
// https://github.com/dotnet/runtime/issues/101115 // https://github.com/dotnet/runtime/issues/101115
return new object[][] { return new object[][] {
new object[] { RemoteEchoServer }, // [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
// new object[] { RemoteEchoServer },
}; };
} }
return new object[][] { return new object[][] {
new object[] { RemoteEchoServer }, // [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
// new object[] { RemoteEchoServer },
new object[] { SecureRemoteEchoServer }, new object[] { SecureRemoteEchoServer },
}; };
} }
@ -43,11 +46,13 @@ namespace System.Net.Test.Common
{ {
// https://github.com/dotnet/runtime/issues/101115 // https://github.com/dotnet/runtime/issues/101115
return new object[][] { return new object[][] {
new object[] { RemoteEchoHeadersServer }, // [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
// new object[] { RemoteEchoHeadersServer },
}; };
} }
return new object[][] { return new object[][] {
new object[] { RemoteEchoHeadersServer }, // [ActiveIssue("https://github.com/dotnet/runtime/issues/110578)]
// new object[] { RemoteEchoHeadersServer },
new object[] { SecureRemoteEchoHeadersServer }, new object[] { SecureRemoteEchoHeadersServer },
}; };
} }

View file

@ -70,7 +70,7 @@ namespace System.Net.Http.Functional.Tests
handler.UseDefaultCredentials = false; handler.UseDefaultCredentials = false;
using (HttpClient client = CreateHttpClient(handler)) using (HttpClient client = CreateHttpClient(handler))
{ {
Uri uri = Configuration.Http.RemoteHttp11Server.NegotiateAuthUriForDefaultCreds; Uri uri = Configuration.Http.RemoteSecureHttp11Server.NegotiateAuthUriForDefaultCreds;
_output.WriteLine("Uri: {0}", uri); _output.WriteLine("Uri: {0}", uri);
using (HttpResponseMessage response = await client.GetAsync(uri)) using (HttpResponseMessage response = await client.GetAsync(uri))
{ {
@ -601,9 +601,9 @@ namespace System.Net.Http.Functional.Tests
public static IEnumerable<object[]> ExpectContinueVersion() public static IEnumerable<object[]> ExpectContinueVersion()
{ {
return return
from expect in new bool?[] {true, false, null} from expect in new bool?[] { true, false, null }
from version in new Version[] {new Version(1, 0), new Version(1, 1), new Version(2, 0)} from version in new Version[] { new Version(1, 0), new Version(1, 1), new Version(2, 0) }
select new object[] {expect, version}; select new object[] { expect, version };
} }
[OuterLoop("Uses external servers", typeof(PlatformDetection), nameof(PlatformDetection.LocalEchoServerIsNotAvailable))] [OuterLoop("Uses external servers", typeof(PlatformDetection), nameof(PlatformDetection.LocalEchoServerIsNotAvailable))]
@ -775,7 +775,8 @@ namespace System.Net.Http.Functional.Tests
{ {
var request = new HttpRequestMessage( var request = new HttpRequestMessage(
new HttpMethod(method), new HttpMethod(method),
serverUri) { Version = UseVersion }; serverUri)
{ Version = UseVersion };
using (HttpResponseMessage response = await client.SendAsync(TestAsync, request)) using (HttpResponseMessage response = await client.SendAsync(TestAsync, request))
{ {
@ -801,7 +802,8 @@ namespace System.Net.Http.Functional.Tests
{ {
var request = new HttpRequestMessage( var request = new HttpRequestMessage(
new HttpMethod(method), new HttpMethod(method),
serverUri) { Version = UseVersion }; serverUri)
{ Version = UseVersion };
request.Content = new StringContent(ExpectedContent); request.Content = new StringContent(ExpectedContent);
using (HttpResponseMessage response = await client.SendAsync(TestAsync, request)) using (HttpResponseMessage response = await client.SendAsync(TestAsync, request))
{ {
@ -980,6 +982,7 @@ namespace System.Net.Http.Functional.Tests
[OuterLoop("Uses external servers")] [OuterLoop("Uses external servers")]
[Fact] [Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/55083", TestPlatforms.Browser)] [ActiveIssue("https://github.com/dotnet/runtime/issues/55083", TestPlatforms.Browser)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/110578")]
public async Task GetAsync_AllowAutoRedirectTrue_RedirectFromHttpToHttps_StatusCodeOK() public async Task GetAsync_AllowAutoRedirectTrue_RedirectFromHttpToHttps_StatusCodeOK()
{ {
HttpClientHandler handler = CreateHttpClientHandler(); HttpClientHandler handler = CreateHttpClientHandler();
@ -1064,9 +1067,9 @@ namespace System.Net.Http.Functional.Tests
handler.MaxAutomaticRedirections = maxHops; handler.MaxAutomaticRedirections = maxHops;
using (HttpClient client = CreateHttpClient(handler)) using (HttpClient client = CreateHttpClient(handler))
{ {
Task<HttpResponseMessage> t = client.GetAsync(Configuration.Http.RemoteHttp11Server.RedirectUriForDestinationUri( Task<HttpResponseMessage> t = client.GetAsync(Configuration.Http.RemoteSecureHttp11Server.RedirectUriForDestinationUri(
statusCode: 302, statusCode: 302,
destinationUri: Configuration.Http.RemoteHttp11Server.EchoUri, destinationUri: Configuration.Http.RemoteSecureHttp11Server.EchoUri,
hops: hops)); hops: hops));
if (hops <= maxHops) if (hops <= maxHops)
@ -1074,7 +1077,7 @@ namespace System.Net.Http.Functional.Tests
using (HttpResponseMessage response = await t) using (HttpResponseMessage response = await t)
{ {
Assert.Equal(HttpStatusCode.OK, response.StatusCode); Assert.Equal(HttpStatusCode.OK, response.StatusCode);
Assert.Equal(Configuration.Http.RemoteEchoServer, response.RequestMessage.RequestUri); Assert.Equal(Configuration.Http.SecureRemoteEchoServer, response.RequestMessage.RequestUri);
} }
} }
else else

View file

@ -97,6 +97,7 @@ namespace System.Net.Http.Functional.Tests
[OuterLoop("Uses external servers")] [OuterLoop("Uses external servers")]
[Fact] [Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/110578")]
public async Task UseCallback_NotSecureConnection_CallbackNotCalled() public async Task UseCallback_NotSecureConnection_CallbackNotCalled()
{ {
HttpClientHandler handler = CreateHttpClientHandler(); HttpClientHandler handler = CreateHttpClientHandler();

View file

@ -168,8 +168,8 @@ namespace System
return !(bool)typeof(LambdaExpression).GetMethod("get_CanCompileToIL").Invoke(null, Array.Empty<object>()); return !(bool)typeof(LambdaExpression).GetMethod("get_CanCompileToIL").Invoke(null, Array.Empty<object>());
} }
// Drawing is not supported on non windows platforms in .NET 7.0+. // Drawing is not supported on non windows platforms in .NET 7.0+ and on Mono.
public static bool IsDrawingSupported => IsWindows && IsNotWindowsNanoServer && IsNotWindowsServerCore; public static bool IsDrawingSupported => IsWindows && IsNotWindowsNanoServer && IsNotWindowsServerCore && IsNotMonoRuntime;
public static bool IsAsyncFileIOSupported => !IsBrowser && !IsWasi; public static bool IsAsyncFileIOSupported => !IsBrowser && !IsWasi;

View file

@ -100,25 +100,14 @@ namespace System.Security.Cryptography
Span<byte> destination, Span<byte> destination,
out int bytesWritten) out int bytesWritten)
{ {
int hashSize = hash.AlgorithmName.Name switch byte[] actual = hash.GetHashAndReset();
{
nameof(HashAlgorithmName.MD5) => 128 >> 3,
nameof(HashAlgorithmName.SHA1) => 160 >> 3,
nameof(HashAlgorithmName.SHA256) => 256 >> 3,
nameof(HashAlgorithmName.SHA384) => 384 >> 3,
nameof(HashAlgorithmName.SHA512) => 512 >> 3,
_ => throw new CryptographicException(),
};
if (destination.Length < hashSize) if (destination.Length < actual.Length)
{ {
bytesWritten = 0; bytesWritten = 0;
return false; return false;
} }
byte[] actual = hash.GetHashAndReset();
Debug.Assert(actual.Length == hashSize);
actual.AsSpan().CopyTo(destination); actual.AsSpan().CopyTo(destination);
bytesWritten = actual.Length; bytesWritten = actual.Length;
return true; return true;

View file

@ -20,7 +20,7 @@ public class ArraySinglePrimitiveRecordTests : ReadTests
public static IEnumerable<object[]> GetCanReadArrayOfAnySizeArgs() public static IEnumerable<object[]> GetCanReadArrayOfAnySizeArgs()
{ {
foreach (int size in new[] { 1, 127, 128, 512_001, 512_001 }) foreach (int size in new[] { 1, 127, 128, 20_001 })
{ {
yield return new object[] { size, true }; yield return new object[] { size, true };
yield return new object[] { size, false }; yield return new object[] { size, false };

View file

@ -32,6 +32,7 @@ namespace System.Net.Http.WinHttpHandlerFunctional.Tests
[OuterLoop] [OuterLoop]
[Fact] [Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/110578")]
public async Task UseCallback_NotSecureConnection_CallbackNotCalled() public async Task UseCallback_NotSecureConnection_CallbackNotCalled()
{ {
var handler = new WinHttpHandler(); var handler = new WinHttpHandler();

View file

@ -55,7 +55,7 @@ namespace System.Net.Http.WinHttpHandlerFunctional.Tests
string cookieName, string cookieName,
string cookieValue) string cookieValue)
{ {
Uri uri = System.Net.Test.Common.Configuration.Http.RemoteHttp11Server.RedirectUriForDestinationUri(302, System.Net.Test.Common.Configuration.Http.RemoteEchoServer, 1); Uri uri = System.Net.Test.Common.Configuration.Http.RemoteSecureHttp11Server.RedirectUriForDestinationUri(302, System.Net.Test.Common.Configuration.Http.SecureRemoteEchoServer, 1);
var handler = new WinHttpHandler(); var handler = new WinHttpHandler();
handler.WindowsProxyUsePolicy = WindowsProxyUsePolicy.UseWinInetProxy; handler.WindowsProxyUsePolicy = WindowsProxyUsePolicy.UseWinInetProxy;
handler.CookieUsePolicy = cookieUsePolicy; handler.CookieUsePolicy = cookieUsePolicy;

View file

@ -381,7 +381,7 @@ namespace System.Net.Http.Functional.Tests
using InstrumentRecorder<long> openConnectionsRecorder = SetupInstrumentRecorder<long>(InstrumentNames.OpenConnections); using InstrumentRecorder<long> openConnectionsRecorder = SetupInstrumentRecorder<long>(InstrumentNames.OpenConnections);
Uri uri = UseVersion == HttpVersion.Version11 Uri uri = UseVersion == HttpVersion.Version11
? Test.Common.Configuration.Http.RemoteHttp11Server.EchoUri ? Test.Common.Configuration.Http.RemoteSecureHttp11Server.EchoUri
: Test.Common.Configuration.Http.RemoteHttp2Server.EchoUri; : Test.Common.Configuration.Http.RemoteHttp2Server.EchoUri;
IPAddress[] addresses = await Dns.GetHostAddressesAsync(uri.Host); IPAddress[] addresses = await Dns.GetHostAddressesAsync(uri.Host);
addresses = addresses.Union(addresses.Select(a => a.MapToIPv6())).ToArray(); addresses = addresses.Union(addresses.Select(a => a.MapToIPv6())).ToArray();
@ -1259,7 +1259,7 @@ namespace System.Net.Http.Functional.Tests
}); });
}, options: new GenericLoopbackOptions() { UseSsl = true }); }, options: new GenericLoopbackOptions() { UseSsl = true });
}, options: new GenericLoopbackOptions() { UseSsl = false}); }, options: new GenericLoopbackOptions() { UseSsl = false });
} }
[Fact] [Fact]

View file

@ -3456,7 +3456,7 @@ namespace System.Numerics.Tensors
Tensor<T>[] outputs = new Tensor<T>[tensors.Length]; Tensor<T>[] outputs = new Tensor<T>[tensors.Length];
for (int i = 0; i < tensors.Length; i++) for (int i = 0; i < tensors.Length; i++)
{ {
outputs[i] = Tensor.Unsqueeze(tensors[0], dimension); outputs[i] = Tensor.Unsqueeze(tensors[i], dimension);
} }
return Tensor.ConcatenateOnDimension<T>(dimension, outputs); return Tensor.ConcatenateOnDimension<T>(dimension, outputs);
} }
@ -3494,9 +3494,9 @@ namespace System.Numerics.Tensors
Tensor<T>[] outputs = new Tensor<T>[tensors.Length]; Tensor<T>[] outputs = new Tensor<T>[tensors.Length];
for (int i = 0; i < tensors.Length; i++) for (int i = 0; i < tensors.Length; i++)
{ {
outputs[i] = Tensor.Unsqueeze(tensors[0], dimension); outputs[i] = Tensor.Unsqueeze(tensors[i], dimension);
} }
return ref Tensor.ConcatenateOnDimension<T>(dimension, tensors, destination); return ref Tensor.ConcatenateOnDimension<T>(dimension, outputs, destination);
} }
#endregion #endregion

View file

@ -988,6 +988,7 @@ namespace System.Numerics.Tensors.Tests
Assert.Equal(13, t0[1, 3]); Assert.Equal(13, t0[1, 3]);
Assert.Equal(14, t0[1, 4]); Assert.Equal(14, t0[1, 4]);
} }
[Fact] [Fact]
public static void TensorStackTests() public static void TensorStackTests()
{ {
@ -1074,6 +1075,47 @@ namespace System.Numerics.Tensors.Tests
Assert.Equal(8, resultTensor[1, 3, 1]); Assert.Equal(8, resultTensor[1, 3, 1]);
Assert.Equal(9, resultTensor[1, 4, 0]); Assert.Equal(9, resultTensor[1, 4, 0]);
Assert.Equal(9, resultTensor[1, 4, 1]); Assert.Equal(9, resultTensor[1, 4, 1]);
// stacking 2x2 tensors along dimension 1
Tensor<int> v1 = Tensor.Create([1, 2, 3, 4], [2, 2]);
Tensor<int> v2 = Tensor.Create([10, 20, 30, 40], [2, 2]);
resultTensor = Tensor.StackAlongDimension(1, [v1, v2]);
Assert.Equal(3, resultTensor.Rank);
Assert.Equal(2, resultTensor.Lengths[0]);
Assert.Equal(2, resultTensor.Lengths[1]);
Assert.Equal(2, resultTensor.Lengths[2]);
Assert.Equal(1, resultTensor[0, 0, 0]);
Assert.Equal(2, resultTensor[0, 0, 1]);
Assert.Equal(10, resultTensor[0, 1, 0]);
Assert.Equal(20, resultTensor[0, 1, 1]);
Assert.Equal(3, resultTensor[1, 0, 0]);
Assert.Equal(4, resultTensor[1, 0, 1]);
Assert.Equal(30, resultTensor[1, 1, 0]);
Assert.Equal(40, resultTensor[1, 1, 1]);
resultTensor = Tensor.StackAlongDimension(0, [v1, v2]);
Tensor<int> resultTensor2 = Tensor.Create<int>([2, 2, 2]);
Tensor.StackAlongDimension([v1, v2], resultTensor2, 1);
Assert.Equal(3, resultTensor2.Rank);
Assert.Equal(2, resultTensor2.Lengths[0]);
Assert.Equal(2, resultTensor2.Lengths[1]);
Assert.Equal(2, resultTensor2.Lengths[2]);
Assert.Equal(1, resultTensor2[0, 0, 0]);
Assert.Equal(2, resultTensor2[0, 0, 1]);
Assert.Equal(10, resultTensor2[0, 1, 0]);
Assert.Equal(20, resultTensor2[0, 1, 1]);
Assert.Equal(3, resultTensor2[1, 0, 0]);
Assert.Equal(4, resultTensor2[1, 0, 1]);
Assert.Equal(30, resultTensor2[1, 1, 0]);
Assert.Equal(40, resultTensor2[1, 1, 1]);
} }
[Fact] [Fact]

View file

@ -1682,6 +1682,11 @@ namespace System.Xml.Serialization
{ {
if (member.Source == null && mapping.TypeDesc.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping)) if (member.Source == null && mapping.TypeDesc.IsArrayLike && !(mapping.Elements!.Length == 1 && mapping.Elements[0].Mapping is ArrayMapping))
{ {
// Always create a collection for (non-array) collection-like types, even if the XML data says the collection should be null.
if (!mapping.TypeDesc.IsArray)
{
member.Collection ??= new CollectionMember();
}
member.Source = (item) => member.Source = (item) =>
{ {
member.Collection ??= new CollectionMember(); member.Collection ??= new CollectionMember();
@ -1694,26 +1699,51 @@ namespace System.Xml.Serialization
if (member.Source == null) if (member.Source == null)
{ {
var isList = mapping.TypeDesc.IsArrayLike && !mapping.TypeDesc.IsArray;
var pi = member.Mapping.MemberInfo as PropertyInfo; var pi = member.Mapping.MemberInfo as PropertyInfo;
if (pi != null && typeof(IList).IsAssignableFrom(pi.PropertyType)
&& (pi.SetMethod == null || !pi.SetMethod.IsPublic)) // Here we have to deal with some special cases for property members. The old serializers would trip over
// private property setters generally - except in the case of list-like properties. Because lists get special
// treatment, a private setter for a list property would only be a problem if the default constructor didn't
// already create a list instance for the property. If it does create a list, then the serializer can still
// populate it. Try to emulate the old serializer behavior here.
// First, for non-list properties, private setters are always a problem.
if (!isList && pi != null && pi.SetMethod != null && !pi.SetMethod.IsPublic)
{ {
member.Source = (value) => member.Source = (value) => throw new InvalidOperationException(SR.Format(SR.XmlReadOnlyPropertyError, pi.Name, pi.DeclaringType!.FullName));
{
var getOnlyList = (IList)pi.GetValue(o)!;
if (value is IList valueList)
{
foreach (var v in valueList)
{
getOnlyList.Add(v);
}
}
else
{
getOnlyList.Add(value);
}
};
} }
// Next, for list properties, we need to handle not only the private setter case, but also the case where
// there is no setter at all. Because we need to give the default constructor a chance to create the list
// first before we make noise about not being able to set a list property.
else if (isList && pi != null && (pi.SetMethod == null || !pi.SetMethod.IsPublic))
{
var addMethod = mapping.TypeDesc.Type!.GetMethod("Add");
if (addMethod != null)
{
member.Source = (value) =>
{
var getOnlyList = pi.GetValue(o)!;
if (getOnlyList == null)
{
// No-setter lists should just be ignored if they weren't created by constructor. Private-setter lists are the noisy exception.
if (pi.SetMethod != null && !pi.SetMethod.IsPublic)
throw new InvalidOperationException(SR.Format(SR.XmlReadOnlyPropertyError, pi.Name, pi.DeclaringType!.FullName));
}
else if (value is IEnumerable valueList)
{
foreach (var v in valueList)
{
addMethod.Invoke(getOnlyList, new object[] { v });
}
}
};
}
}
// For all other members (fields, public setter properties, etc), just carry on as normal
else else
{ {
if (member.Mapping.Xmlns != null) if (member.Mapping.Xmlns != null)
@ -1729,6 +1759,21 @@ namespace System.Xml.Serialization
member.Source = (value) => setterDelegate(o, value); member.Source = (value) => setterDelegate(o, value);
} }
} }
// Finally, special list handling again. ANY list that we can assign/populate should be initialized with
// an empty list if it hasn't been initialized already. Even if the XML data says the list should be null.
// This is an odd legacy behavior, but it's what the old serializers did.
if (isList && member.Source != null)
{
member.EnsureCollection = (obj) =>
{
if (GetMemberValue(obj, mapping.MemberInfo!) == null)
{
var empty = ReflectionCreateObject(mapping.TypeDesc.Type!);
member.Source(empty);
}
};
}
} }
if (member.Mapping.CheckSpecified == SpecifiedAccessor.ReadWrite) if (member.Mapping.CheckSpecified == SpecifiedAccessor.ReadWrite)
@ -1782,23 +1827,29 @@ namespace System.Xml.Serialization
WriteAttributes(allMembers, anyAttribute, unknownNodeAction, ref o); WriteAttributes(allMembers, anyAttribute, unknownNodeAction, ref o);
Reader.MoveToElement(); Reader.MoveToElement();
if (Reader.IsEmptyElement) if (Reader.IsEmptyElement)
{ {
Reader.Skip(); Reader.Skip();
return o;
} }
else
Reader.ReadStartElement();
bool IsSequenceAllMembers = IsSequence();
if (IsSequenceAllMembers)
{ {
// https://github.com/dotnet/runtime/issues/1402: Reader.ReadStartElement();
// Currently the reflection based method treat this kind of type as normal types. bool IsSequenceAllMembers = IsSequence();
// But potentially we can do some optimization for types that have ordered properties. if (IsSequenceAllMembers)
{
// https://github.com/dotnet/runtime/issues/1402:
// Currently the reflection based method treat this kind of type as normal types.
// But potentially we can do some optimization for types that have ordered properties.
}
WriteMembers(allMembers, unknownNodeAction, unknownNodeAction, anyElementMember, anyTextMember);
ReadEndElement();
} }
WriteMembers(allMembers, unknownNodeAction, unknownNodeAction, anyElementMember, anyTextMember); // Empty element or not, we need to ensure all our array-like members have been initialized in the same
// way as the IL / CodeGen - based serializers.
foreach (Member member in allMembers) foreach (Member member in allMembers)
{ {
if (member.Collection != null) if (member.Collection != null)
@ -1810,9 +1861,10 @@ namespace System.Xml.Serialization
var setMemberValue = GetSetMemberValueDelegate(o, memberInfo.Name); var setMemberValue = GetSetMemberValueDelegate(o, memberInfo.Name);
setMemberValue(o, collection); setMemberValue(o, collection);
} }
member.EnsureCollection?.Invoke(o!);
} }
ReadEndElement();
return o; return o;
} }
} }
@ -2090,6 +2142,7 @@ namespace System.Xml.Serialization
public Action<object?>? CheckSpecifiedSource; public Action<object?>? CheckSpecifiedSource;
public Action<object>? ChoiceSource; public Action<object>? ChoiceSource;
public Action<string, string>? XmlnsSource; public Action<string, string>? XmlnsSource;
public Action<object>? EnsureCollection;
public Member(MemberMapping mapping) public Member(MemberMapping mapping)
{ {

View file

@ -5,6 +5,7 @@ using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Reflection; using System.Reflection;
using System.Text; using System.Text;
using System.Xml.Schema; using System.Xml.Schema;
@ -125,7 +126,7 @@ namespace System.Xml.Serialization
} }
else else
{ {
WriteElements(o, elements, text, choice, writeAccessors, memberTypeDesc.IsNullable); WriteElements(o, choiceSource, elements, text, choice, writeAccessors, memberTypeDesc.IsNullable);
} }
} }
@ -150,11 +151,11 @@ namespace System.Xml.Serialization
} }
} }
WriteArrayItems(elements, text, choice, o); WriteArrayItems(elements, text, choice, o, choiceSource);
} }
[RequiresUnreferencedCode("calls WriteElements")] [RequiresUnreferencedCode("calls WriteElements")]
private void WriteArrayItems(ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, object o) private void WriteArrayItems(ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, object o, object? choiceSources)
{ {
var arr = o as IList; var arr = o as IList;
@ -163,7 +164,8 @@ namespace System.Xml.Serialization
for (int i = 0; i < arr.Count; i++) for (int i = 0; i < arr.Count; i++)
{ {
object? ai = arr[i]; object? ai = arr[i];
WriteElements(ai, elements, text, choice, true, true); var choiceSource = ((Array?)choiceSources)?.GetValue(i);
WriteElements(ai, choiceSource, elements, text, choice, true, true);
} }
} }
else else
@ -174,17 +176,18 @@ namespace System.Xml.Serialization
IEnumerator e = a.GetEnumerator(); IEnumerator e = a.GetEnumerator();
if (e != null) if (e != null)
{ {
int c = 0;
while (e.MoveNext()) while (e.MoveNext())
{ {
object ai = e.Current; object ai = e.Current;
WriteElements(ai, elements, text, choice, true, true); var choiceSource = ((Array?)choiceSources)?.GetValue(c++);
WriteElements(ai, choiceSource, elements, text, choice, true, true);
} }
} }
} }
} }
[RequiresUnreferencedCode("calls CreateUnknownTypeException")] [RequiresUnreferencedCode("calls CreateUnknownTypeException")]
private void WriteElements(object? o, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, bool writeAccessors, bool isNullable) private void WriteElements(object? o, object? choiceSource, ElementAccessor[] elements, TextAccessor? text, ChoiceIdentifierAccessor? choice, bool writeAccessors, bool isNullable)
{ {
if (elements.Length == 0 && text == null) if (elements.Length == 0 && text == null)
return; return;
@ -222,16 +225,35 @@ namespace System.Xml.Serialization
} }
else if (choice != null) else if (choice != null)
{ {
if (o != null && o.GetType() == element.Mapping!.TypeDesc!.Type) // This looks heavy - getting names of enums in string form for comparison rather than just comparing values.
// But this faithfully mimics NetFx, and is necessary to prevent confusion between different enum types.
// ie EnumType.ValueX could == 1, but TotallyDifferentEnumType.ValueY could also == 1.
TypeDesc td = element.Mapping!.TypeDesc!;
bool enumUseReflection = choice.Mapping!.TypeDesc!.UseReflection;
string enumTypeName = choice.Mapping!.TypeDesc!.FullName;
string enumFullName = (enumUseReflection ? "" : enumTypeName + ".@") + FindChoiceEnumValue(element, (EnumMapping)choice.Mapping, enumUseReflection);
string choiceFullName = (enumUseReflection ? "" : choiceSource!.GetType().FullName + ".@") + choiceSource!.ToString();
if (choiceFullName == enumFullName)
{ {
WriteElement(o, element, writeAccessors); // Object is either non-null, or it is allowed to be null
return; if (o != null || (!isNullable || element.IsNullable))
{
// But if Object is non-null, it's got to match types
if (o != null && !td.Type!.IsAssignableFrom(o!.GetType()))
{
throw CreateMismatchChoiceException(td.FullName, choice.MemberName!, enumFullName);
}
WriteElement(o, element, writeAccessors);
return;
}
} }
} }
else else
{ {
TypeDesc td = element.IsUnbounded ? element.Mapping!.TypeDesc!.CreateArrayTypeDesc() : element.Mapping!.TypeDesc!; TypeDesc td = element.IsUnbounded ? element.Mapping!.TypeDesc!.CreateArrayTypeDesc() : element.Mapping!.TypeDesc!;
if (o!.GetType() == td.Type) if (td.Type!.IsAssignableFrom(o!.GetType()))
{ {
WriteElement(o, element, writeAccessors); WriteElement(o, element, writeAccessors);
return; return;
@ -280,6 +302,58 @@ namespace System.Xml.Serialization
} }
} }
private static string FindChoiceEnumValue(ElementAccessor element, EnumMapping choiceMapping, bool useReflection)
{
string? enumValue = null;
for (int i = 0; i < choiceMapping.Constants!.Length; i++)
{
string xmlName = choiceMapping.Constants[i].XmlName;
if (element.Any && element.Name.Length == 0)
{
if (xmlName == "##any:")
{
if (useReflection)
enumValue = choiceMapping.Constants[i].Value.ToString(CultureInfo.InvariantCulture);
else
enumValue = choiceMapping.Constants[i].Name;
break;
}
continue;
}
int colon = xmlName.LastIndexOf(':');
string? choiceNs = colon < 0 ? choiceMapping.Namespace : xmlName.Substring(0, colon);
string choiceName = colon < 0 ? xmlName : xmlName.Substring(colon + 1);
if (element.Name == choiceName)
{
if ((element.Form == XmlSchemaForm.Unqualified && string.IsNullOrEmpty(choiceNs)) || element.Namespace == choiceNs)
{
if (useReflection)
enumValue = choiceMapping.Constants[i].Value.ToString(CultureInfo.InvariantCulture);
else
enumValue = choiceMapping.Constants[i].Name;
break;
}
}
}
if (string.IsNullOrEmpty(enumValue))
{
if (element.Any && element.Name.Length == 0)
{
// Type {0} is missing enumeration value '##any' for XmlAnyElementAttribute.
throw new InvalidOperationException(SR.Format(SR.XmlChoiceMissingAnyValue, choiceMapping.TypeDesc!.FullName));
}
// Type {0} is missing value for '{1}'.
throw new InvalidOperationException(SR.Format(SR.XmlChoiceMissingValue, choiceMapping.TypeDesc!.FullName, element.Namespace + ":" + element.Name, element.Name, element.Namespace));
}
if (!useReflection)
CodeIdentifier.CheckValidIdentifier(enumValue);
return enumValue;
}
private void WriteText(object o, TextAccessor text) private void WriteText(object o, TextAccessor text)
{ {
if (text.Mapping is PrimitiveMapping primitiveMapping) if (text.Mapping is PrimitiveMapping primitiveMapping)
@ -376,7 +450,7 @@ namespace System.Xml.Serialization
if (o != null) if (o != null)
{ {
WriteStartElement(name, ns, false); WriteStartElement(name, ns, false);
WriteArrayItems(mapping.ElementsSortedByDerivation!, null, null, o); WriteArrayItems(mapping.ElementsSortedByDerivation!, null, null, o, null);
WriteEndElement(); WriteEndElement();
} }
} }

View file

@ -379,7 +379,6 @@ namespace System.Xml.Serialization
} }
else if (_tempAssembly == null || _typedSerializer) else if (_tempAssembly == null || _typedSerializer)
{ {
// The contion for the block is never true, thus the block is never hit.
XmlSerializationWriter writer = CreateWriter(); XmlSerializationWriter writer = CreateWriter();
writer.Init(xmlWriter, namespaces == null || namespaces.Count == 0 ? DefaultNamespaces : namespaces, encodingStyle, id); writer.Init(xmlWriter, namespaces == null || namespaces.Count == 0 ? DefaultNamespaces : namespaces, encodingStyle, id);
Serialize(o, writer); Serialize(o, writer);

View file

@ -884,6 +884,39 @@ public static partial class XmlSerializerTests
Assert.Equal(expected.OuterXml, actual.OuterXml); Assert.Equal(expected.OuterXml, actual.OuterXml);
} }
[Fact]
public static void Xml_TestTypeWithPrivateOrNoSetters()
{
// Private setters are a problem. Traditional XmlSerializer doesn't know what to do with them.
// This should fail when constructing the serializer.
#if ReflectionOnly
// For the moment, the reflection-based serializer doesn't throw until it does deserialization, because
// it doesn't do xml/type mapping in the constructor. This should change in the future with improvements to
// the reflection-based serializer that frontloads more work to make the actual serialization faster.
var ex = Record.Exception(() => SerializeAndDeserialize<TypeWithPrivateSetters>(new TypeWithPrivateSetters(39), "", null, true));
ex = AssertTypeAndUnwrap<InvalidOperationException>(ex);
#else
var ex = Record.Exception(() => new XmlSerializer(typeof(TypeWithPrivateSetters)));
#endif
Assert.IsType<InvalidOperationException>(ex);
Assert.Equal("Cannot deserialize type 'SerializationTypes.TypeWithPrivateSetters' because it contains property 'PrivateSetter' which has no public setter.", ex.Message);
// If there is no setter at all though, traditional XmlSerializer just doesn't include the property in the serialization.
// Therefore, the following should work. Although the serialized output isn't really worth much.
var noSetter = new TypeWithNoSetters(25);
var actualNoSetter = SerializeAndDeserialize<TypeWithNoSetters>(noSetter, "<?xml version=\"1.0\"?>\r\n<TypeWithNoSetters xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" />");
Assert.NotNull(actualNoSetter);
Assert.StrictEqual(25, noSetter.NoSetter);
Assert.StrictEqual(200, actualNoSetter.NoSetter); // 200 is what the default constructor sets it to.
// But private setters aren't a problem if the class is ISerializable.
var value = new TypeWithPrivateOrNoSettersButIsIXmlSerializable(32, 52);
var actual = SerializeAndDeserialize<TypeWithPrivateOrNoSettersButIsIXmlSerializable>(value, "<?xml version=\"1.0\"?>\r\n<TypeWithPrivateOrNoSettersButIsIXmlSerializable>\r\n <PrivateSetter>32</PrivateSetter>\r\n <NoSetter>52</NoSetter>\r\n</TypeWithPrivateOrNoSettersButIsIXmlSerializable>");
Assert.NotNull(actual);
Assert.StrictEqual(value.PrivateSetter, actual.PrivateSetter);
Assert.StrictEqual(value.NoSetter, actual.NoSetter);
}
[Fact] [Fact]
public static void Xml_TestTypeWithListPropertiesWithoutPublicSetters() public static void Xml_TestTypeWithListPropertiesWithoutPublicSetters()
{ {
@ -915,6 +948,7 @@ public static partial class XmlSerializerTests
<AnotherStringList> <AnotherStringList>
<string>AnotherFoo</string> <string>AnotherFoo</string>
</AnotherStringList> </AnotherStringList>
<AlwaysNullNullableList xsi:nil=""true"" />
</TypeWithListPropertiesWithoutPublicSetters>"); </TypeWithListPropertiesWithoutPublicSetters>");
Assert.StrictEqual(value.PropertyWithXmlElementAttribute.Count, actual.PropertyWithXmlElementAttribute.Count); Assert.StrictEqual(value.PropertyWithXmlElementAttribute.Count, actual.PropertyWithXmlElementAttribute.Count);
Assert.Equal(value.PropertyWithXmlElementAttribute[0], actual.PropertyWithXmlElementAttribute[0]); Assert.Equal(value.PropertyWithXmlElementAttribute[0], actual.PropertyWithXmlElementAttribute[0]);
@ -928,6 +962,143 @@ public static partial class XmlSerializerTests
Assert.Equal(value.AnotherStringList[0], actual.AnotherStringList[0]); Assert.Equal(value.AnotherStringList[0], actual.AnotherStringList[0]);
Assert.StrictEqual(value.PublicIntListField[0], actual.PublicIntListField[0]); Assert.StrictEqual(value.PublicIntListField[0], actual.PublicIntListField[0]);
Assert.StrictEqual(value.PublicIntListFieldWithXmlElementAttribute[0], actual.PublicIntListFieldWithXmlElementAttribute[0]); Assert.StrictEqual(value.PublicIntListFieldWithXmlElementAttribute[0], actual.PublicIntListFieldWithXmlElementAttribute[0]);
// In an annoyingly inconsistent behavior, if a list property does not have a setter at all, the serializer is smart enough to
// not try to set an empty list. So the property will be either empty or null depending on how the default constructor leaves it.
Assert.Null(actual.AlwaysNullList);
Assert.Null(actual.AlwaysNullNullableList);
// Fields are always settable though, so the serializer always takes that liberty. *smh*
Assert.Empty(actual.AlwaysNullStringListField);
Assert.Empty(actual.AlwaysNullIntListFieldWithXmlElementAttribute);
// Try with an empty list
value = new TypeWithListPropertiesWithoutPublicSetters();
actual = SerializeAndDeserialize<TypeWithListPropertiesWithoutPublicSetters>(value,
@"<?xml version=""1.0""?>
<TypeWithListPropertiesWithoutPublicSetters xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<PublicIntListField />
<IntList />
<StringList />
<AnotherStringList />
<AlwaysNullNullableList xsi:nil=""true"" />
</TypeWithListPropertiesWithoutPublicSetters>");
Assert.NotNull(actual);
Assert.Empty(actual.PublicIntListField);
Assert.Empty(actual.IntList);
Assert.Empty(actual.StringList);
Assert.Empty(actual.AnotherStringList);
Assert.Empty(actual.PropertyWithXmlElementAttribute);
// In an annoyingly inconsistent behavior, if a list property does not have a setter at all, the serializer is smart enough to
// not try to set an empty list. So the property will be either empty or null depending on how the default constructor leaves it.
Assert.Empty(actual.PublicIntListFieldWithXmlElementAttribute);
Assert.Null(actual.AlwaysNullList);
Assert.Null(actual.AlwaysNullNullableList);
// Fields are always settable though, so the serializer always takes that liberty. *smh*
Assert.Empty(actual.AlwaysNullStringListField);
Assert.Empty(actual.AlwaysNullIntListFieldWithXmlElementAttribute);
// And also try with a null list
value = new TypeWithListPropertiesWithoutPublicSetters(createLists: false);
actual = SerializeAndDeserialize<TypeWithListPropertiesWithoutPublicSetters>(value,
@"<?xml version=""1.0""?>
<TypeWithListPropertiesWithoutPublicSetters xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<StringList xsi:nil=""true"" />
<AnotherStringList />
<AlwaysNullNullableList xsi:nil=""true"" />
</TypeWithListPropertiesWithoutPublicSetters>");
Assert.NotNull(actual);
Assert.Empty(actual.PublicIntListField);
Assert.Empty(actual.IntList);
Assert.Empty(actual.StringList);
Assert.Empty(actual.AnotherStringList);
Assert.Empty(actual.PropertyWithXmlElementAttribute);
// In an annoyingly inconsistent behavior, if a list property does not have a setter at all, the serializer is smart enough to
// not try to set an empty list. So the property will be either empty or null depending on how the default constructor leaves it.
Assert.Empty(actual.PublicIntListFieldWithXmlElementAttribute);
Assert.Null(actual.AlwaysNullList);
Assert.Null(actual.AlwaysNullNullableList);
// Fields are always settable though, so the serializer always takes that liberty. *smh*
Assert.Empty(actual.AlwaysNullStringListField);
Assert.Empty(actual.AlwaysNullIntListFieldWithXmlElementAttribute);
// And finally, a corner case where "private-setter" property is left null by the default constructor, but the serializer sees it as null
// and thinks it can call the private setter, so it tries to make it empty and fails. But again, note that the fields and
// no-setter-at-all properties that come first do not cause the failure.
var cannotDeserialize = new TypeWithGetOnlyListsThatDoNotInitialize();
var ex = Record.Exception(() =>
{
SerializeAndDeserialize<TypeWithGetOnlyListsThatDoNotInitialize>(cannotDeserialize,
@"<?xml version=""1.0"" encoding=""UTF-8""?>
<TypeWithGetOnlyListsThatDoNotInitialize xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""/>");
});
ex = AssertTypeAndUnwrap<InvalidOperationException>(ex);
// Attempt by method 'Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReaderTypeWithGetOnlyListsThatDoNotInitialize.Read2_Item(Boolean, Boolean)' to access method 'SerializationTypes.TypeWithGetOnlyListsThatDoNotInitialize.set_AlwaysNullPropertyPrivateSetter(System.Collections.Generic.List`1<Int32>)' failed.
Assert.Contains("AlwaysNullPropertyPrivateSetter", ex.Message);
}
[Fact]
public static void Xml_HiddenMembersChangeMappings()
{
var baseValue = new BaseWithElementsAttributesPropertiesAndLists() { StringField = "BString", TextField = "BText", ListField = new () { "one", "two" }, ListProp = new () { "three" } };
var baseActual = SerializeAndDeserialize<BaseWithElementsAttributesPropertiesAndLists>(baseValue, "<?xml version=\"1.0\"?>\r\n<BaseWithElementsAttributesPropertiesAndLists xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" TextField=\"BText\">\r\n <StringField>BString</StringField>\r\n <ListField>\r\n <string>one</string>\r\n <string>two</string>\r\n </ListField>\r\n <ListProp>\r\n <string>three</string>\r\n </ListProp>\r\n</BaseWithElementsAttributesPropertiesAndLists>");
Assert.IsType<BaseWithElementsAttributesPropertiesAndLists>(baseActual);
Assert.Equal(baseValue.StringField, baseActual.StringField);
Assert.Equal(baseValue.TextField, baseActual.TextField);
Assert.Equal(baseValue.ListProp.ToArray(), baseActual.ListProp.ToArray());
Assert.Equal(baseValue.ListField.ToArray(), baseActual.ListField.ToArray());
var value1 = new HideElementWithAttribute() { StringField = "DString" };
((BaseWithElementsAttributesPropertiesAndLists)value1).Copy(baseValue);
var ex = Record.Exception(() => { SerializeAndDeserialize<HideElementWithAttribute>(value1, null); });
AssertXmlMappingException(ex, "SerializationTypes.HideElementWithAttribute", "StringField", "Member 'HideElementWithAttribute.StringField' hides inherited member 'BaseWithElementsAttributesPropertiesAndLists.StringField', but has different custom attributes.");
var value2 = new HideAttributeWithElement() { TextField = "DText" };
((BaseWithElementsAttributesPropertiesAndLists)value2).Copy(baseValue);
ex = Record.Exception(() => { SerializeAndDeserialize<HideAttributeWithElement>(value2, null); });
AssertXmlMappingException(ex, "SerializationTypes.HideAttributeWithElement", "TextField", "Member 'HideAttributeWithElement.TextField' hides inherited member 'BaseWithElementsAttributesPropertiesAndLists.TextField', but has different custom attributes.");
var value3 = new HideWithNewType() { TextField = 3 };
((BaseWithElementsAttributesPropertiesAndLists)value3).Copy(baseValue);
ex = Record.Exception(() => { SerializeAndDeserialize<HideWithNewType>(value3, null); });
AssertXmlMappingException(ex, "SerializationTypes.HideWithNewType", "TextField", "Member HideWithNewType.TextField of type System.Int32 hides base class member BaseWithElementsAttributesPropertiesAndLists.TextField of type System.String. Use XmlElementAttribute or XmlAttributeAttribute to specify a new name.");
var value4 = new HideWithNewName() { StringField = "DString" };
((BaseWithElementsAttributesPropertiesAndLists)value4).Copy(baseValue);
ex = Record.Exception(() => { SerializeAndDeserialize<HideWithNewName>(value4, null); });
AssertXmlMappingException(ex, "SerializationTypes.HideWithNewName", "StringField", "Member 'HideWithNewName.StringField' hides inherited member 'BaseWithElementsAttributesPropertiesAndLists.StringField', but has different custom attributes.");
/* This scenario fails before .Net 10 because the process for xml mapping types incorrectly
* fails to account for hidden members. In this case, 'ListField' actually gets serialized as
* an 'XmlArray' instead of a series of 'XmlElement', because the hidden base-member is an 'XmlArray'.
* Let's just skip this scenario. It's live in .Net 10.
// Funny tricks can be played with XmlArray/Element when it comes to Lists though.
// Stuff kind of doesn't blow up, but hidden members still get left out.
var value5 = new HideArrayWithElement() { ListField = new() { "ONE", "TWO", "THREE" } };
((BaseWithElementsAttributesPropertiesAndLists)value5).Copy(baseValue);
var actual5 = SerializeAndDeserialize<HideArrayWithElement>(value5,
@"<?xml version=""1.0""?>
<HideArrayWithElement xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" TextField=""BText"">
<StringField>BString</StringField>
<ListField>ONE</ListField>
<ListField>TWO</ListField>
<ListField>THREE</ListField>
<ListProp>
<string>three</string>
</ListProp>
</HideArrayWithElement>");
Assert.IsType<HideArrayWithElement>(actual5);
Assert.Equal(value5.StringField, actual5.StringField);
Assert.Equal(value5.TextField, actual5.TextField);
Assert.Equal(value5.ListProp.ToArray(), actual5.ListProp.ToArray());
Assert.Equal(value5.ListField.ToArray(), actual5.ListField.ToArray());
// Not only are the hidden values not serialized, but the serialzier doesn't even try to do it's empty list thing
Assert.Null(((BaseWithElementsAttributesPropertiesAndLists)actual5).ListField);
*/
// But at the end of the day, you still can't get away with changing the name of the element
var value6 = new HideArrayWithRenamedElement() { ListField = new() { "FOUR", "FIVE" } };
((BaseWithElementsAttributesPropertiesAndLists)value6).Copy(baseValue);
ex = Record.Exception(() => { SerializeAndDeserialize<HideArrayWithRenamedElement>(value6, null); });
AssertXmlMappingException(ex, "SerializationTypes.HideArrayWithRenamedElement", "ListField", "Member 'HideArrayWithRenamedElement.ListField' hides inherited member 'BaseWithElementsAttributesPropertiesAndLists.ListField', but has different custom attributes.");
} }
[Fact] [Fact]
@ -1273,6 +1444,7 @@ public static partial class XmlSerializerTests
Assert.NotNull(actual.Things); Assert.NotNull(actual.Things);
Assert.Equal(value.Things.Length, actual.Things.Length); Assert.Equal(value.Things.Length, actual.Things.Length);
// Try with an unexpected namespace
var expectedElem = (XmlElement)value.Things[1]; var expectedElem = (XmlElement)value.Things[1];
var actualElem = (XmlElement)actual.Things[1]; var actualElem = (XmlElement)actual.Things[1];
Assert.Equal(expectedElem.Name, actualElem.Name); Assert.Equal(expectedElem.Name, actualElem.Name);
@ -1287,6 +1459,26 @@ public static partial class XmlSerializerTests
}; };
Assert.Throws<InvalidOperationException>(() => actual = SerializeAndDeserialize(value, string.Empty, skipStringCompare: true)); Assert.Throws<InvalidOperationException>(() => actual = SerializeAndDeserialize(value, string.Empty, skipStringCompare: true));
// Try with no elements
value = new TypeWithMultiNamedXmlAnyElement()
{
Things = new object[] { }
};
actual = SerializeAndDeserialize(value,
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<MyXmlType xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" />");
Assert.NotNull(actual);
Assert.Null(actual.Things);
// Try with a null list
value = new TypeWithMultiNamedXmlAnyElement()
{
Things = null
};
actual = SerializeAndDeserialize(value,
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<MyXmlType xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" />");
Assert.NotNull(actual);
Assert.Null(actual.Things);
} }
@ -2531,7 +2723,7 @@ public static partial class XmlSerializerTests
string ns = s_defaultNs; string ns = s_defaultNs;
string memberName1 = "items"; string memberName1 = "items";
XmlReflectionMember member1 = GetReflectionMemberNoXmlElement<object[]>(memberName1, ns); XmlReflectionMember member1 = GetReflectionMemberNoXmlElement<object[]>(memberName1, ns);
PropertyInfo itemProperty = typeof(TypeWithPropertyHavingChoice).GetProperty("ManyChoices"); FieldInfo itemProperty = typeof(TypeWithArrayPropertyHavingChoice).GetField("ManyChoices");
member1.XmlAttributes = new XmlAttributes(itemProperty); member1.XmlAttributes = new XmlAttributes(itemProperty);
string memberName2 = "ChoiceArray"; string memberName2 = "ChoiceArray";
@ -2556,6 +2748,202 @@ public static partial class XmlSerializerTests
Assert.True(items.SequenceEqual(actualItems)); Assert.True(items.SequenceEqual(actualItems));
} }
[Fact]
public static void XmlMembersMapping_With_ComplexChoiceIdentifier()
{
string ns = s_defaultNs;
string memberName1 = "items";
XmlReflectionMember member1 = GetReflectionMemberNoXmlElement<object[]>(memberName1, ns);
FieldInfo itemProperty = typeof(TypeWithPropertyHavingComplexChoice).GetField("ManyChoices");
member1.XmlAttributes = new XmlAttributes(itemProperty);
string memberName2 = "ChoiceArray";
XmlReflectionMember member2 = GetReflectionMemberNoXmlElement<MoreChoices[]>(memberName2, ns);
member2.XmlAttributes.XmlIgnore = true;
var members = new XmlReflectionMember[] { member1, member2 };
object[] items = { new ComplexChoiceB { Name = "Beef" }, 5 };
var itemChoices = new MoreChoices[] { MoreChoices.Item, MoreChoices.Amount };
object[] value = { items, itemChoices };
object[] actual = RoundTripWithXmlMembersMapping(value,
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<wrapper xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://tempuri.org/\">\r\n <Item xsi:type=\"ComplexChoiceB\">\r\n <Name>Beef</Name>\r\n </Item>\r\n <Amount>5</Amount>\r\n</wrapper>",
false,
members,
wrapperName: "wrapper");
Assert.NotNull(actual);
var actualItems = actual[0] as object[];
Assert.NotNull(actualItems);
Assert.True(items.SequenceEqual(actualItems));
object[] itemsWithNull = { null, 5 };
object[] valueWithNull = { itemsWithNull, itemChoices };
actual = RoundTripWithXmlMembersMapping(valueWithNull,
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<wrapper xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns=\"http://tempuri.org/\">\r\n <Amount>5</Amount>\r\n</wrapper>",
false,
members,
wrapperName: "wrapper");
Assert.NotNull(actual);
actualItems = actual[0] as object[];
// TODO: Ugh. Is losing a 'null' element of the choice array data loss?
// Probably. But that's what NetFx and ILGen do. :(
Assert.Single(actualItems);
Assert.Equal(5, actualItems[0]);
Assert.NotNull(actualItems);
}
[Fact]
public static void XmlMembersMapping_With_ChoiceErrors()
{
string ns = s_defaultNs;
string memberName1 = "items";
XmlReflectionMember member1 = GetReflectionMemberNoXmlElement<object[]>(memberName1, ns);
FieldInfo itemProperty = typeof(TypeWithPropertyHavingComplexChoice).GetField("ManyChoices");
member1.XmlAttributes = new XmlAttributes(itemProperty);
string memberName2 = "ChoiceArray";
XmlReflectionMember member2 = GetReflectionMemberNoXmlElement<MoreChoices[]>(memberName2, ns);
member2.XmlAttributes.XmlIgnore = true;
var members = new XmlReflectionMember[] { member1, member2 };
// XmlChoiceMismatchChoiceException
object[] items = { new ComplexChoiceB { Name = "Beef" }, "not integer 5" };
var itemChoices = new MoreChoices[] { MoreChoices.Item, MoreChoices.Amount };
object[] value = { items, itemChoices };
var ex = Record.Exception(() => {
RoundTripWithXmlMembersMapping(value, null, true, members, wrapperName: "wrapper");
});
ex = AssertTypeAndUnwrap<InvalidOperationException>(ex);
Assert.IsType<InvalidOperationException>(ex);
Assert.Contains("mismatches the type of ", ex.Message);
// XmlChoiceMissingValue
object[] newItems = { "random string", new ComplexChoiceB { Name = "Beef" }, 5 };
object[] newValue = { newItems, itemChoices };
ex = Record.Exception(() => {
RoundTripWithXmlMembersMapping(newValue, null, true, members, wrapperName: "wrapper");
});
ex = AssertTypeAndUnwrap<InvalidOperationException>(ex);
Assert.IsType<InvalidOperationException>(ex);
Assert.Contains("Invalid or missing value of the choice identifier", ex.Message);
// XmlChoiceMissingValue
FieldInfo missingItemProperty = typeof(TypeWithPropertyHavingChoiceError).GetField("ManyChoices");
member1.XmlAttributes = new XmlAttributes(missingItemProperty);
object[] missingItems = { new ComplexChoiceB { Name = "Beef" }, 5, "not_a_choice" };
var missingItemChoices = new MoreChoices[] { MoreChoices.Item, MoreChoices.Amount, MoreChoices.None };
object[] missingValue = { missingItems, missingItemChoices };
ex = Record.Exception(() => {
RoundTripWithXmlMembersMapping(missingValue, null, true, members, wrapperName: "wrapper");
});
ex = AssertTypeAndUnwrap<InvalidOperationException>(ex);
Assert.IsType<InvalidOperationException>(ex);
Assert.Contains("is missing enumeration value", ex.Message);
}
[Fact]
public static void Xml_TypeWithArrayPropertyHavingChoiceErrors()
{
MoreChoices[] itemChoices = new MoreChoices[] { MoreChoices.Item, MoreChoices.Amount };
// XmlChoiceMismatchChoiceException
object[] mismatchedChoices = new object[] { new ComplexChoiceB { Name = "Beef" }, "not integer 5" };
var mismatchedValue = new TypeWithPropertyHavingComplexChoice() { ManyChoices = mismatchedChoices, ChoiceArray = itemChoices };
var ex = Record.Exception(() => {
Serialize(mismatchedValue, null);
});
ex = AssertTypeAndUnwrap<InvalidOperationException>(ex);
Assert.IsType<InvalidOperationException>(ex);
Assert.Contains("mismatches the type of ", ex.Message);
// XmlChoiceMissingValue
object[] missingChoice = { "random string", new ComplexChoiceB { Name = "Beef" }, 5 };
var missingValue = new TypeWithPropertyHavingComplexChoice() { ManyChoices = missingChoice, ChoiceArray = itemChoices };
ex = Record.Exception(() => {
Serialize(missingValue, null);
});
ex = AssertTypeAndUnwrap<InvalidOperationException>(ex);
Assert.IsType<InvalidOperationException>(ex);
Assert.Contains("Invalid or missing value of the choice identifier", ex.Message);
// XmlChoiceMissingValue
object[] invalidChoiceValues = { new ComplexChoiceB { Name = "Beef" }, 5, "not_a_choice" };
MoreChoices[] invalidChoices = new MoreChoices[] { MoreChoices.Item, MoreChoices.Amount, MoreChoices.None };
var invalidChoiceValue = new TypeWithPropertyHavingChoiceError() { ManyChoices = invalidChoiceValues, ChoiceArray = invalidChoices };
ex = Record.Exception(() => {
Serialize(invalidChoiceValue, null);
});
#if ReflectionOnly
// The ILGen Serializer does XmlMapping during serializer ctor and lets the exception out cleanly.
// The Reflection Serializer does XmlMapping in the Serialize() call and wraps the resulting exception
// inside a catch-all IOE in Serialize().
ex = AssertTypeAndUnwrap<InvalidOperationException>(ex, "There was an error generating the XML document");
#endif
ex = AssertTypeAndUnwrap<InvalidOperationException>(ex, "TypeWithPropertyHavingChoiceError"); // There was an error reflecting type...
ex = AssertTypeAndUnwrap<InvalidOperationException>(ex, "ManyChoices"); // There was an error reflecting field...
Assert.IsType<InvalidOperationException>(ex);
Assert.Contains("is missing enumeration value", ex.Message);
}
[Fact]
public static void Xml_XmlIncludedTypesInTypedCollection()
{
var value = new List<BaseClass>() {
new BaseClass() { Value = "base class" },
new DerivedClass() { Value = "derived class" }
};
var actual = SerializeAndDeserialize<List<BaseClass>>(value,
@"<?xml version=""1.0"" encoding=""utf-8""?>
<ArrayOfBaseClass xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<BaseClass>
<Value>base class</Value>
</BaseClass>
<BaseClass xsi:type=""DerivedClass"">
<Value>derived class</Value>
</BaseClass>
</ArrayOfBaseClass>");
Assert.NotNull(actual);
Assert.Equal(2, actual.Count);
Assert.Equal("base class", actual[0].Value);
Assert.IsType<BaseClass>(actual[0]);
Assert.IsType<DerivedClass>(actual[1]);
// BaseClass.Value is hidden - not overridden - by DerivedClass.Value, so it shows when accessed as a BaseClass.
Assert.Null(actual[1].Value);
Assert.Equal("derived class", ((DerivedClass)actual[1]).Value);
}
[Fact]
public static void Xml_XmlIncludedTypesInTypedCollectionSingle()
{
var value = new List<BaseClass>() {
new DerivedClass() { Value = "derived class" }
};
var actual = SerializeAndDeserialize<List<BaseClass>>(value,
@"<?xml version=""1.0"" encoding=""utf-8""?>
<ArrayOfBaseClass xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<BaseClass xsi:type=""DerivedClass"">
<Value>derived class</Value>
</BaseClass>
</ArrayOfBaseClass>");
Assert.NotNull(actual);
Assert.Single(actual);
Assert.IsType<DerivedClass>(actual[0]);
// BaseClass.Value is hidden - not overridden - by DerivedClass.Value, so it shows when accessed as a BaseClass.
Assert.Null(actual[0].Value);
Assert.Equal("derived class", ((DerivedClass)actual[0]).Value);
}
[Fact] [Fact]
public static void XmlMembersMapping_MultipleMembers() public static void XmlMembersMapping_MultipleMembers()
{ {

View file

@ -161,6 +161,27 @@ string.Format(@"<?xml version=""1.0"" encoding=""utf-8""?>
Assert.Equal(x.F2, y.F2); Assert.Equal(x.F2, y.F2);
Utils.Equal<SimpleType>(x.P1, y.P1, (a, b) => { return SimpleType.AreEqual(a, b); }); Utils.Equal<SimpleType>(x.P1, y.P1, (a, b) => { return SimpleType.AreEqual(a, b); });
Assert.Equal(x.P2, y.P2); Assert.Equal(x.P2, y.P2);
// Do it again with null and empty arrays
x = new TypeWithGetSetArrayMembers
{
F1 = null,
F2 = new int[] { },
P1 = new SimpleType[] { },
P2 = null
};
y = SerializeAndDeserialize<TypeWithGetSetArrayMembers>(x,
@"<?xml version=""1.0""?>
<TypeWithGetSetArrayMembers xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<F2 />
<P1 />
</TypeWithGetSetArrayMembers>");
Assert.NotNull(y);
Assert.Null(y.F1); // Arrays stay null
Assert.Empty(y.F2);
Assert.Empty(y.P1);
Assert.Null(y.P2); // Arrays stay null
} }
[Fact] [Fact]
@ -172,15 +193,57 @@ string.Format(@"<?xml version=""1.0"" encoding=""utf-8""?>
x.P2[0] = -1; x.P2[0] = -1;
x.P2[1] = 3; x.P2[1] = 3;
TypeWithGetOnlyArrayProperties y = SerializeAndDeserialize<TypeWithGetOnlyArrayProperties>(x, TypeWithGetOnlyArrayProperties y = SerializeAndDeserialize<TypeWithGetOnlyArrayProperties>(x, @"<?xml version=""1.0""?><TypeWithGetOnlyArrayProperties xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" />");
@"<?xml version=""1.0""?>
<TypeWithGetOnlyArrayProperties xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" />");
Assert.NotNull(y); Assert.NotNull(y);
// XmlSerializer seems not complain about missing public setter of Array property // XmlSerializer seems not complain about missing public setter of Array property
// However, it does not serialize the property. So for this test case, I'll use it to verify there are no complaints about missing public setter // However, it does not serialize the property. So for this test case, I'll use it to verify there are no complaints about missing public setter
} }
[Fact]
public static void Xml_ArraylikeMembers()
{
var assertEqual = (TypeWithArraylikeMembers a, TypeWithArraylikeMembers b) => {
Assert.Equal(a.IntAField, b.IntAField);
Assert.Equal(a.NIntAField, b.NIntAField);
Assert.Equal(a.IntLField, b.IntLField);
Assert.Equal(a.NIntLField, b.NIntLField);
Assert.Equal(a.IntAProp, b.IntAProp);
Assert.Equal(a.NIntAProp, b.NIntAProp);
Assert.Equal(a.IntLProp, b.IntLProp);
Assert.Equal(a.NIntLProp, b.NIntLProp);
};
// Populated array-like members
var x = TypeWithArraylikeMembers.CreateWithPopulatedMembers();
var y = SerializeAndDeserialize<TypeWithArraylikeMembers>(x, null /* Just checking the input and output objects is good enough here */, null, true);
Assert.NotNull(y);
assertEqual(x, y);
// Empty array-like members
x = TypeWithArraylikeMembers.CreateWithEmptyMembers();
y = SerializeAndDeserialize<TypeWithArraylikeMembers>(x, "<?xml version=\"1.0\"?><TypeWithArraylikeMembers xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n <IntAField />\r\n <NIntAField />\r\n <IntLField />\r\n <NIntLField />\r\n <IntAProp />\r\n <NIntAProp />\r\n <IntLProp />\r\n <NIntLProp />\r\n</TypeWithArraylikeMembers>");
Assert.NotNull(y);
assertEqual(x, y);
Assert.Empty(y.IntAField); // Check on a couple fields to be sure they are empty and not null.
Assert.Empty(y.NIntLProp);
// Null array-like members
// Null arrays and collections are omitted from xml output (or set to 'nil'). But they differ in deserialization.
// Null arrays are deserialized as null as expected. Null collections are unintuitively deserialized as empty collections. This behavior is preserved for compatibility with NetFx.
x = TypeWithArraylikeMembers.CreateWithNullMembers();
y = SerializeAndDeserialize<TypeWithArraylikeMembers>(x, "<?xml version=\"1.0\"?><TypeWithArraylikeMembers xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n <NIntLField xsi:nil=\"true\" />\r\n <NIntAProp xsi:nil=\"true\" />\r\n</TypeWithArraylikeMembers>");
Assert.NotNull(y);
Assert.Null(y.IntAField);
Assert.Null(y.NIntAField);
Assert.Empty(y.IntLField);
Assert.Empty(y.NIntLField);
Assert.Null(y.IntAProp);
Assert.Null(y.NIntAProp);
Assert.Empty(y.IntLProp);
Assert.Empty(y.NIntLProp);
}
[Fact] [Fact]
public static void Xml_ListRoot() public static void Xml_ListRoot()
{ {
@ -198,10 +261,10 @@ string.Format(@"<?xml version=""1.0"" encoding=""utf-8""?>
Assert.Equal((string)x[1], (string)y[1]); Assert.Equal((string)x[1], (string)y[1]);
} }
// ROC and Immutable types are not types from 'SerializableAssembly.dll', so they were not included in the // ROC and Immutable types are not types from 'SerializableAssembly.dll', so they were not included in the
// pregenerated serializers for the sgen tests. We could wrap them in a type that does exist there... // pregenerated serializers for the sgen tests. We could wrap them in a type that does exist there...
// but I think the RO/Immutable story is wonky enough and RefEmit vs Reflection is near enough on the // but I think the RO/Immutable story is wonky enough and RefEmit vs Reflection is near enough on the
// horizon that it's not worth the trouble. // horizon that it's not worth the trouble.
#if !XMLSERIALIZERGENERATORTESTS #if !XMLSERIALIZERGENERATORTESTS
[Fact] [Fact]
[ActiveIssue("https://github.com/dotnet/runtime/issues/74247", TestPlatforms.tvOS)] [ActiveIssue("https://github.com/dotnet/runtime/issues/74247", TestPlatforms.tvOS)]
@ -455,7 +518,42 @@ string.Format(@"<?xml version=""1.0"" encoding=""utf-8""?>
Assert.StrictEqual(value.DateTimeProperty, actual.DateTimeProperty); Assert.StrictEqual(value.DateTimeProperty, actual.DateTimeProperty);
Assert.StrictEqual(value.IntProperty, actual.IntProperty); Assert.StrictEqual(value.IntProperty, actual.IntProperty);
Assert.Equal(value.StringProperty, actual.StringProperty); Assert.Equal(value.StringProperty, actual.StringProperty);
// Before .Net 10, the process for xml mapping types incorrectly maps members closest to the base class,
// rather than the most derived class. This isn't a problem for ILGen or source-gen serialziers, since
// they emit code that essentially says "o.problemMember = value;" and since 'o' is the derived type, it
// just works. But when setting that member via reflection with a MemberInfo, the serializer needs
// the MemberInfo from the correct level, and this isn't fixed until .Net 10. So the ILGen and
// the reflection-based serializers will produce different results here.
#if ReflectionOnly
Assert.Empty(actual.ListProperty);
#else
Assert.Equal(value.ListProperty.ToArray(), actual.ListProperty.ToArray()); Assert.Equal(value.ListProperty.ToArray(), actual.ListProperty.ToArray());
#endif
BaseClassWithSamePropertyName castAsBase = (BaseClassWithSamePropertyName)actual;
Assert.Equal(default(int), castAsBase.IntProperty);
Assert.Null(castAsBase.StringProperty);
Assert.Null(castAsBase.ListProperty);
// Try again with a null list to ensure the correct property is deserialized to an empty list
value = new DerivedClassWithSameProperty() { DateTimeProperty = new DateTime(100), IntProperty = 5, StringProperty = "TestString", ListProperty = null };
actual = SerializeAndDeserialize<DerivedClassWithSameProperty>(value,
@"<?xml version=""1.0""?>
<DerivedClassWithSameProperty xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<StringProperty>TestString</StringProperty>
<IntProperty>5</IntProperty>
<DateTimeProperty>0001-01-01T00:00:00.00001</DateTimeProperty>
</DerivedClassWithSameProperty>");
Assert.StrictEqual(value.DateTimeProperty, actual.DateTimeProperty);
Assert.StrictEqual(value.IntProperty, actual.IntProperty);
Assert.Equal(value.StringProperty, actual.StringProperty);
Assert.Empty(actual.ListProperty.ToArray());
castAsBase = (BaseClassWithSamePropertyName)actual;
Assert.Equal(default(int), castAsBase.IntProperty);
Assert.Null(castAsBase.StringProperty);
Assert.Null(castAsBase.ListProperty);
} }
[Fact] [Fact]
@ -1088,7 +1186,7 @@ string.Format(@"<?xml version=""1.0"" encoding=""utf-8""?>
ms.Position = 0; ms.Position = 0;
string nl = Environment.NewLine; string nl = Environment.NewLine;
string actualFormatting = new StreamReader(ms).ReadToEnd(); 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>"; 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); Assert.Equal(expectedFormatting, actualFormatting);
} }
} }
@ -1115,7 +1213,64 @@ string.Format(@"<?xml version=""1.0"" encoding=""utf-8""?>
Assert.StrictEqual(value.DateTimeProperty, actual.DateTimeProperty); Assert.StrictEqual(value.DateTimeProperty, actual.DateTimeProperty);
Assert.StrictEqual(value.IntProperty, actual.IntProperty); Assert.StrictEqual(value.IntProperty, actual.IntProperty);
Assert.Equal(value.StringProperty, actual.StringProperty); Assert.Equal(value.StringProperty, actual.StringProperty);
// Before .Net 10, the process for xml mapping types incorrectly maps members closest to the base class,
// rather than the most derived class. This isn't a problem for ILGen or source-gen serialziers, since
// they emit code that essentially says "o.problemMember = value;" and since 'o' is the derived type, it
// just works. But when setting that member via reflection with a MemberInfo, the serializer needs
// the MemberInfo from the correct level, and this isn't fixed until .Net 10. So the ILGen and
// the reflection-based serializers will produce different results here.
#if ReflectionOnly
Assert.Empty(actual.ListProperty);
#else
Assert.Equal(value.ListProperty.ToArray(), actual.ListProperty.ToArray()); Assert.Equal(value.ListProperty.ToArray(), actual.ListProperty.ToArray());
#endif
// All base properties have been hidden, so they should be default here in the base class
BaseClassWithSamePropertyName castAsBase = (BaseClassWithSamePropertyName)actual;
Assert.StrictEqual(default(DateTime), castAsBase.DateTimeProperty);
Assert.StrictEqual(default(int), castAsBase.IntProperty);
Assert.Null(castAsBase.StringProperty);
Assert.Null(castAsBase.ListProperty);
// IntProperty and StringProperty are not hidden in Derived2, so they should be set here in the middle
DerivedClassWithSameProperty castAsMiddle = (DerivedClassWithSameProperty)actual;
Assert.StrictEqual(value.IntProperty, castAsMiddle.IntProperty);
Assert.Equal(value.StringProperty, castAsMiddle.StringProperty);
// The other properties should be default
Assert.StrictEqual(default(DateTime), castAsMiddle.DateTimeProperty);
Assert.Null(castAsMiddle.ListProperty);
// Try again with a null list to ensure the correct property is deserialized to an empty list
value = new DerivedClassWithSameProperty2() { DateTimeProperty = new DateTime(100, DateTimeKind.Utc), IntProperty = 5, StringProperty = "TestString", ListProperty = null };
actual = SerializeAndDeserialize(value,
@"<?xml version=""1.0""?>
<DerivedClassWithSameProperty2 xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<StringProperty>TestString</StringProperty>
<IntProperty>5</IntProperty>
<DateTimeProperty>0001-01-01T00:00:00.00001Z</DateTimeProperty>
</DerivedClassWithSameProperty2>");
Assert.StrictEqual(value.DateTimeProperty, actual.DateTimeProperty);
Assert.StrictEqual(value.IntProperty, actual.IntProperty);
Assert.Equal(value.StringProperty, actual.StringProperty);
Assert.Empty(actual.ListProperty.ToArray());
// All base properties have been hidden, so they should be default here in the base class
castAsBase = (BaseClassWithSamePropertyName)actual;
Assert.StrictEqual(default(DateTime), castAsBase.DateTimeProperty);
Assert.StrictEqual(default(int), castAsBase.IntProperty);
Assert.Null(castAsBase.StringProperty);
Assert.Null(castAsBase.ListProperty);
// IntProperty and StringProperty are not hidden in Derived2, so they should be set here in the middle
castAsMiddle = (DerivedClassWithSameProperty)actual;
Assert.StrictEqual(value.IntProperty, castAsMiddle.IntProperty);
Assert.Equal(value.StringProperty, castAsMiddle.StringProperty);
// The other properties should be default
Assert.StrictEqual(default(DateTime), castAsMiddle.DateTimeProperty);
Assert.Null(castAsMiddle.ListProperty);
} }
[Fact] [Fact]
@ -1382,6 +1537,30 @@ string.Format(@"<?xml version=""1.0"" encoding=""utf-8""?>
Assert.NotNull(actual.ManyChoices); Assert.NotNull(actual.ManyChoices);
Assert.Equal(value.ManyChoices.Length, actual.ManyChoices.Length); Assert.Equal(value.ManyChoices.Length, actual.ManyChoices.Length);
Assert.True(Enumerable.SequenceEqual(value.ManyChoices, actual.ManyChoices)); Assert.True(Enumerable.SequenceEqual(value.ManyChoices, actual.ManyChoices));
// Try again with a null array
value = new TypeWithArrayPropertyHavingChoice() { ManyChoices = null, ChoiceArray = itemChoices };
actual = SerializeAndDeserialize(value, "<?xml version=\"1.0\"?><TypeWithArrayPropertyHavingChoice xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" />");
Assert.NotNull(actual);
Assert.Null(actual.ManyChoices); // Arrays keep null-ness
}
[Fact]
public static void Xml_TypeWithArrayPropertyHavingComplexChoice()
{
object[] choices = new object[] { new ComplexChoiceB { Name = "Beef" }, 5 };
// For each item in the choices array, add an enumeration value.
MoreChoices[] itemChoices = new MoreChoices[] { MoreChoices.Item, MoreChoices.Amount };
var value = new TypeWithPropertyHavingComplexChoice() { ManyChoices = choices, ChoiceArray = itemChoices };
var actual = SerializeAndDeserialize(value, "<?xml version=\"1.0\"?>\r\n<TypeWithPropertyHavingComplexChoice xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\">\r\n <Item xsi:type=\"ComplexChoiceB\">\r\n <Name>Beef</Name>\r\n </Item>\r\n <Amount>5</Amount>\r\n</TypeWithPropertyHavingComplexChoice>");
Assert.NotNull(actual);
Assert.NotNull(actual.ManyChoices);
Assert.Equal(value.ManyChoices.Length, actual.ManyChoices.Length);
Assert.True(Enumerable.SequenceEqual(value.ManyChoices, actual.ManyChoices));
} }
[Fact] [Fact]
@ -1588,6 +1767,54 @@ string.Format(@"<?xml version=""1.0"" encoding=""utf-8""?>
Assert.Equal(value.value, ((DerivedClass)actual).value); Assert.Equal(value.value, ((DerivedClass)actual).value);
} }
[Fact]
public static void Xml_XmlIncludedTypesInCollection()
{
var value = new MyList() {
new BaseClass() { Value = "base class" },
new DerivedClass() { Value = "derived class" }
};
var actual = SerializeAndDeserialize<MyList>(value,
@"<?xml version=""1.0"" encoding=""utf-8""?>
<ArrayOfAnyType xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<anyType xsi:type=""BaseClass"">
<Value>base class</Value>
</anyType>
<anyType xsi:type=""DerivedClass"">
<Value>derived class</Value>
</anyType>
</ArrayOfAnyType>",
() => { return new XmlSerializer(typeof(MyList), new Type[] { typeof(BaseClass) }); });
Assert.NotNull(actual);
Assert.Equal(2, actual.Count);
Assert.IsType<BaseClass>(actual[0]);
Assert.Equal("base class", ((BaseClass)actual[0]).Value);
Assert.IsType<DerivedClass>(actual[1]);
Assert.Equal("derived class", ((DerivedClass)actual[1]).Value);
}
[Fact]
public static void Xml_XmlIncludedTypesInCollectionSingle()
{
var value = new MyList() {
new DerivedClass() { Value = "derived class" }
};
var actual = SerializeAndDeserialize<MyList>(value,
@"<?xml version=""1.0"" encoding=""utf-8""?>
<ArrayOfAnyType xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
<anyType xsi:type=""DerivedClass"">
<Value>derived class</Value>
</anyType>
</ArrayOfAnyType>",
() => { return new XmlSerializer(typeof(MyList), new Type[] { typeof(BaseClass) }); });
Assert.NotNull(actual);
Assert.Single(actual);
Assert.IsType<DerivedClass>(actual[0]);
Assert.Equal("derived class", ((DerivedClass)actual[0]).Value);
}
[Fact] [Fact]
public static void Xml_NullRefInXmlSerializerCtorTest() public static void Xml_NullRefInXmlSerializerCtorTest()
{ {
@ -2379,6 +2606,32 @@ string.Format(@"<?xml version=""1.0"" encoding=""utf-8""?>
} }
} }
private static Exception AssertTypeAndUnwrap<T>(object exception, string? message = null) where T : Exception
{
Assert.IsType<T>(exception);
var ex = exception as Exception;
if (message != null)
Assert.Contains(message, ex.Message);
Assert.NotNull(ex.InnerException);
return ex.InnerException;
}
private static void AssertXmlMappingException(Exception exception, string typeName, string fieldName, string msg = null)
{
var ex = exception;
#if ReflectionOnly
// The ILGen Serializer does XmlMapping during serializer ctor and lets the exception out cleanly.
// The Reflection Serializer does XmlMapping in the Serialize() call and wraps the resulting exception
// inside a catch-all IOE in Serialize().
ex = AssertTypeAndUnwrap<InvalidOperationException>(ex, "There was an error generating the XML document");
#endif
ex = AssertTypeAndUnwrap<InvalidOperationException>(ex, $"There was an error reflecting type '{typeName}'");
ex = AssertTypeAndUnwrap<InvalidOperationException>(ex, $"There was an error reflecting field '{fieldName}'");
Assert.IsType<InvalidOperationException>(ex);
if (msg != null)
Assert.Contains(msg, ex.Message);
}
private static string Serialize<T>(T value, string baseline, Func<XmlSerializer> serializerFactory = null, private static string Serialize<T>(T value, string baseline, Func<XmlSerializer> serializerFactory = null,
bool skipStringCompare = false, XmlSerializerNamespaces xns = null) bool skipStringCompare = false, XmlSerializerNamespaces xns = null)
{ {

View file

@ -1463,6 +1463,92 @@ namespace SerializationTypes
} }
} }
public class TypeWithPrivateSetters
{
public TypeWithPrivateSetters() : this(100) { }
public TypeWithPrivateSetters(int privateSetter)
{
PrivateSetter = privateSetter;
}
public int PrivateSetter { get; private set; }
}
public class TypeWithNoSetters
{
public TypeWithNoSetters() : this(200) { }
public TypeWithNoSetters(int noSetter)
{
NoSetter = noSetter;
}
[XmlElement]
public int NoSetter { get; }
}
public class TypeWithPrivateOrNoSettersButIsIXmlSerializable : IXmlSerializable
{
private int _noSetter;
public int PrivateSetter { get; private set; }
public int NoSetter { get => _noSetter; }
// Default constructor
public TypeWithPrivateOrNoSettersButIsIXmlSerializable() : this(150, 250) { }
public TypeWithPrivateOrNoSettersButIsIXmlSerializable(int privateSetter, int noSetter)
{
PrivateSetter = privateSetter;
_noSetter = noSetter;
}
// Implement the IXmlSerializable methods
public System.Xml.Schema.XmlSchema GetSchema() => null;
public void ReadXml(System.Xml.XmlReader reader)
{
reader.MoveToContent();
if (reader.IsEmptyElement)
{
reader.ReadStartElement();
return;
}
reader.ReadStartElement();
while (reader.NodeType != System.Xml.XmlNodeType.EndElement)
{
if (reader.NodeType == System.Xml.XmlNodeType.Element)
{
switch (reader.Name)
{
case nameof(PrivateSetter):
PrivateSetter = reader.ReadElementContentAsInt();
break;
case nameof(NoSetter):
_noSetter = reader.ReadElementContentAsInt();
break;
default:
reader.Skip();
break;
}
}
else
{
reader.Skip();
}
}
reader.ReadEndElement();
}
public void WriteXml(System.Xml.XmlWriter writer)
{
writer.WriteStartElement(nameof(PrivateSetter));
writer.WriteValue(PrivateSetter);
writer.WriteEndElement();
writer.WriteStartElement(nameof(NoSetter));
writer.WriteValue(NoSetter);
writer.WriteEndElement();
}
}
public class TypeWithListPropertiesWithoutPublicSetters public class TypeWithListPropertiesWithoutPublicSetters
{ {
private List<string> _anotherStringList = new List<string>(); private List<string> _anotherStringList = new List<string>();
@ -1472,31 +1558,114 @@ namespace SerializationTypes
StaticProperty = "Static property should not be checked for public setter"; StaticProperty = "Static property should not be checked for public setter";
} }
public TypeWithListPropertiesWithoutPublicSetters() public TypeWithListPropertiesWithoutPublicSetters() : this(true) { }
public TypeWithListPropertiesWithoutPublicSetters(bool createLists)
{ {
PropertyWithXmlElementAttribute = new List<string>(); if (createLists)
IntList = new MyGenericList<int>(); {
StringList = new List<string>(); PropertyWithXmlElementAttribute = new List<string>();
PrivateIntListField = new List<int>(); IntList = new MyGenericList<int>();
PublicIntListField = new List<int>(); StringList = new List<string>();
PublicIntListFieldWithXmlElementAttribute = new List<int>(); PrivateIntListField = new List<int>();
PublicIntListField = new List<int>();
PublicIntListFieldWithXmlElementAttribute = new List<int>();
}
} }
public static string StaticProperty { get; private set; } public static string StaticProperty { get; private set; }
// Try some things with list properties
[XmlElement("PropWithXmlElementAttr")] [XmlElement("PropWithXmlElementAttr")]
public List<string> PropertyWithXmlElementAttribute { get; private set; } public List<string> PropertyWithXmlElementAttribute { get; private set; }
public MyGenericList<int> IntList { get; private set; } public MyGenericList<int> IntList { get; private set; }
[XmlArray(IsNullable = true)]
public List<string> StringList { get; private set; } public List<string> StringList { get; private set; }
public List<string> AnotherStringList { get { return _anotherStringList; } } public List<string> AnotherStringList { get { return _anotherStringList; } }
// Try some things with null lists
public List<int> AlwaysNullList { get; }
[XmlArray(IsNullable = true)]
public List<int> AlwaysNullNullableList { get; }
[XmlElement("FieldWithXmlElementAttrAlwaysNull")]
public List<int> AlwaysNullIntListFieldWithXmlElementAttribute;
public List<string> AlwaysNullStringListField;
// Try some things with list fields
private List<int> PrivateIntListField; private List<int> PrivateIntListField;
public List<int> PublicIntListField; public List<int> PublicIntListField;
[XmlElement("FieldWithXmlElementAttr")] [XmlElement("FieldWithXmlElementAttr")]
public List<int> PublicIntListFieldWithXmlElementAttribute; public List<int> PublicIntListFieldWithXmlElementAttribute;
} }
public class TypeWithGetOnlyListsThatDoNotInitialize
{
// XmlSerializer always tries to make lists empty when deserializing. Some of these are ok, some will cause failures.
// Order matters.
// A field won't cause deserialization to fail since fields are always settable.
public List<string> AlwaysNullField;
// And the serializer is smart enough to leave a setter-less property alone.
public List<int> AlwaysNullPropertyNoSetter { get; }
// But a property with a private setter will cause deserialization to fail.
public List<int> AlwaysNullPropertyPrivateSetter { get; private set; }
}
public class BaseWithElementsAttributesPropertiesAndLists
{
public void Copy(BaseWithElementsAttributesPropertiesAndLists b)
{
StringField = b.StringField;
TextField = b.TextField;
ListProp = b.ListProp;
ListField = b.ListField;
}
[XmlElement]
public string StringField;
[XmlAttribute]
public string TextField;
[XmlArray]
public virtual List<string> ListProp { get; set; }
[XmlArray]
public List<string> ListField;
}
public class HideElementWithAttribute : BaseWithElementsAttributesPropertiesAndLists
{
[XmlAttribute]
public new string StringField;
}
public class HideAttributeWithElement : BaseWithElementsAttributesPropertiesAndLists
{
[XmlElement]
public new string TextField;
}
public class HideWithNewType : BaseWithElementsAttributesPropertiesAndLists
{
[XmlElement]
public new int TextField;
}
public class HideWithNewName : BaseWithElementsAttributesPropertiesAndLists
{
[XmlAttribute("NewStringField")]
public new string StringField;
}
public class HideArrayWithElement : BaseWithElementsAttributesPropertiesAndLists
{
[XmlElement]
public new List<string> ListField;
}
public class HideArrayWithRenamedElement : BaseWithElementsAttributesPropertiesAndLists
{
[XmlElement("NewListField")]
public new List<string> ListField;
}
public abstract class HighScoreManager<T> where T : HighScoreManager<T>.HighScoreBase public abstract class HighScoreManager<T> where T : HighScoreManager<T>.HighScoreBase
{ {
public abstract class HighScoreBase public abstract class HighScoreBase
@ -2049,15 +2218,16 @@ namespace SerializationTypes
public int IntField; public int IntField;
} }
public class TypeWithPropertyHavingChoice public class TypeWithPropertyHavingChoiceError
{ {
// The ManyChoices field can contain an array // The ManyChoices field can contain an array
// of choices. Each choice must be matched to // of choices. Each choice must be matched to
// an array item in the ChoiceArray field. // an array item in the ChoiceArray field.
[XmlChoiceIdentifier("ChoiceArray")] [XmlChoiceIdentifier("ChoiceArray")]
[XmlElement("Item", typeof(string))] [XmlElement("Item", typeof(ComplexChoiceA))]
[XmlElement("Amount", typeof(int))] [XmlElement("Amount", typeof(int))]
public object[] ManyChoices { get; set; } [XmlElement("NotAChoice", typeof(string))]
public object[] ManyChoices;
// TheChoiceArray field contains the enumeration // TheChoiceArray field contains the enumeration
// values, one for each item in the ManyChoices array. // values, one for each item in the ManyChoices array.

View file

@ -89,6 +89,58 @@ namespace SerializationTypes
} }
} }
public class TypeWithArraylikeMembers
{
public int[] IntAField;
public int[]? NIntAField;
public List<int> IntLField;
[XmlArray(IsNullable = true)]
public List<int>? NIntLField;
public int[] IntAProp { get; set; }
[XmlArray(IsNullable = true)]
public int[]? NIntAProp { get; set; }
public List<int> IntLProp { get; set; }
public List<int>? NIntLProp { get; set; }
private static Random r = new Random();
public static TypeWithArraylikeMembers CreateWithPopulatedMembers() => new TypeWithArraylikeMembers
{
IntAField = new int[] { r.Next(), r.Next(), r.Next() },
NIntAField = new int[] { r.Next(), r.Next() },
IntLField = new List<int> { r.Next() },
NIntLField = new List<int> { r.Next(), r.Next() },
IntAProp = new int[] { r.Next(), r.Next() },
NIntAProp = new int[] { r.Next(), r.Next(), r.Next() },
IntLProp = new List<int> { r.Next(), r.Next(), r.Next() },
NIntLProp = new List<int> { r.Next() },
};
public static TypeWithArraylikeMembers CreateWithEmptyMembers() => new TypeWithArraylikeMembers
{
IntAField = new int[] { },
NIntAField = new int[] { },
IntLField = new List<int> { },
NIntLField = new List<int> { },
IntAProp = new int[] { },
NIntAProp = new int[] { },
IntLProp = new List<int> { },
NIntLProp = new List<int> { },
};
public static TypeWithArraylikeMembers CreateWithNullMembers() => new TypeWithArraylikeMembers
{
IntAField = null,
NIntAField = null,
IntLField = null,
NIntLField = null,
IntAProp = null,
NIntAProp = null,
IntLProp = null,
NIntLProp = null,
};
}
public struct StructNotSerializable public struct StructNotSerializable
{ {
public int value; public int value;
@ -829,13 +881,51 @@ namespace SerializationTypes
public MoreChoices[] ChoiceArray; public MoreChoices[] ChoiceArray;
} }
public class TypeWithPropertyHavingComplexChoice
{
// The ManyChoices field can contain an array
// of choices. Each choice must be matched to
// an array item in the ChoiceArray field.
[XmlChoiceIdentifier("ChoiceArray")]
[XmlElement("Item", typeof(ComplexChoiceA))]
[XmlElement("Amount", typeof(int))]
public object[] ManyChoices;
// TheChoiceArray field contains the enumeration
// values, one for each item in the ManyChoices array.
[XmlIgnore]
public MoreChoices[] ChoiceArray;
}
public enum MoreChoices public enum MoreChoices
{ {
None, None,
Item, Item = 12,
Amount Amount = 27
} }
[XmlInclude(typeof(ComplexChoiceB))]
public class ComplexChoiceA
{
public string Name { get; set; }
public override bool Equals(object? obj)
{
if (obj is ComplexChoiceA a)
{
return a.Name == Name;
}
return base.Equals(obj);
}
public override int GetHashCode()
{
//return HashCode.Combine(Name);
return Name.GetHashCode();
}
}
public class ComplexChoiceB : ComplexChoiceA { }
public class TypeWithFieldsOrdered public class TypeWithFieldsOrdered
{ {
[XmlElement(Order = 0)] [XmlElement(Order = 0)]

View file

@ -44,6 +44,15 @@ namespace System.Globalization.Tests
Assert.NotEqual(CultureInfo.CurrentUICulture, CultureInfo.InvariantCulture); Assert.NotEqual(CultureInfo.CurrentUICulture, CultureInfo.InvariantCulture);
} }
[Fact]
[PlatformSpecific(TestPlatforms.OSX | TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS)]
[SkipOnPlatform(TestPlatforms.iOS | TestPlatforms.MacCatalyst | TestPlatforms.tvOS, "https://github.com/dotnet/runtime/issues/111501")]
public void CurrentCulture_Default_Is_Specific()
{
// On OSX-like platforms, the current culture taken from default system culture should be specific.
Assert.False(CultureInfo.CurrentCulture.IsNeutralCulture);
}
[Fact] [Fact]
public void CurrentCulture_Set_Null_ThrowsArgumentNullException() public void CurrentCulture_Set_Null_ThrowsArgumentNullException()
{ {

View file

@ -818,8 +818,8 @@ JS_ENGINES = [NODE_JS]
<!-- Linux specific options --> <!-- Linux specific options -->
<ItemGroup Condition="'$(AotHostOS)' == 'linux'"> <ItemGroup Condition="'$(AotHostOS)' == 'linux'">
<_LibClang Include="$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/lib/libclang.so" Condition=" Exists('$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/lib/libclang.so') "/> <_LibClang Include="$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/lib/libclang.so" Condition=" Exists('$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/lib/libclang.so') "/>
<_LibClang Include="$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/lib64/libclang.so.*" Condition=" '$(_LibClang)' == '' "/> <_LibClang Include="$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/$(MonoToolchainPrebuiltOS)/lib64/libclang.so.*" Condition=" '@(_LibClang)' == '' "/>
<_LibClang Include="/usr/local/lib/libclang.so" Condition="'$(_LibClang)' == ''" /> <_LibClang Include="/usr/local/lib/libclang.so" Condition="'@(_LibClang)' == ''" />
</ItemGroup> </ItemGroup>
<PropertyGroup Condition="'$(TargetsLinux)' == 'true' and '$(Platform)' == 'arm64'"> <PropertyGroup Condition="'$(TargetsLinux)' == 'true' and '$(Platform)' == 'arm64'">
<MonoUseCrossTool>true</MonoUseCrossTool> <MonoUseCrossTool>true</MonoUseCrossTool>

View file

@ -8433,7 +8433,21 @@ MONO_RESTORE_WARNING
LLVMValueRef dest; LLVMValueRef dest;
dest = convert (ctx, LLVMBuildAdd (builder, convert (ctx, values [ins->inst_destbasereg], IntPtrType ()), LLVMConstInt (IntPtrType (), ins->inst_offset, FALSE), ""), pointer_type (t)); dest = convert (ctx, LLVMBuildAdd (builder, convert (ctx, values [ins->inst_destbasereg], IntPtrType ()), LLVMConstInt (IntPtrType (), ins->inst_offset, FALSE), ""), pointer_type (t));
mono_llvm_build_aligned_store (builder, lhs, dest, FALSE, 1); if (mono_class_value_size (ins->klass, NULL) == 12) {
const int mask_values [] = { 0, 1, 2 };
LLVMValueRef truncatedVec3 = LLVMBuildShuffleVector (
builder,
lhs,
LLVMGetUndef (t),
create_const_vector_i32 (mask_values, 3),
"truncated_vec3"
);
mono_llvm_build_aligned_store (builder, truncatedVec3, dest, FALSE, 1);
} else {
mono_llvm_build_aligned_store (builder, lhs, dest, FALSE, 1);
}
break; break;
} }
case OP_XBINOP: case OP_XBINOP:

View file

@ -9,4 +9,8 @@
<PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'"> <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
<UsingWasiRuntimeWorkload Condition="'$(UsingWasiRuntimeWorkload)' == ''">$(WasiNativeWorkloadAvailable)</UsingWasiRuntimeWorkload> <UsingWasiRuntimeWorkload Condition="'$(UsingWasiRuntimeWorkload)' == ''">$(WasiNativeWorkloadAvailable)</UsingWasiRuntimeWorkload>
</PropertyGroup> </PropertyGroup>
<Target Name="FailBuild" BeforeTargets="ProcessFrameworkReferences;Restore;Build;Publish" Condition="'$(RuntimeIdentifier)' == 'wasi-wasm'">
<Error Text="The 'wasi-experimental' workload is not supported in .NET 9." />
</Target>
</Project> </Project>

View file

@ -277,7 +277,7 @@
"kind": "framework", "kind": "framework",
"version": "${PackageVersionNet8}", "version": "${PackageVersionNet8}",
"alias-to": { "alias-to": {
"any": "Microsoft.NETCore.App.Runtime.Mono.osx-arm64" "any": "Microsoft.NETCore.App.Runtime.osx-arm64"
} }
}, },
"Microsoft.NETCore.App.Runtime.net8.osx-x64": { "Microsoft.NETCore.App.Runtime.net8.osx-x64": {
@ -312,8 +312,8 @@
"kind": "Sdk", "kind": "Sdk",
"version": "${PackageVersionNet8}", "version": "${PackageVersionNet8}",
"alias-to": { "alias-to": {
"osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-arm64.Cross.tvos-arm64", "osx-x64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.tvos-arm64",
"osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-x64.Cross.tvos-arm64" "osx-arm64": "Microsoft.NETCore.App.Runtime.AOT.osx-arm64.Cross.tvos-arm64"
} }
}, },
"Microsoft.NETCore.App.Runtime.Mono.net8.tvos-arm64" : { "Microsoft.NETCore.App.Runtime.Mono.net8.tvos-arm64" : {

View file

@ -22,7 +22,6 @@ public class MiscTests : BlazorWasmTestBase
[InlineData("Debug", false)] [InlineData("Debug", false)]
[InlineData("Release", true)] [InlineData("Release", true)]
[InlineData("Release", false)] [InlineData("Release", false)]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103566")]
public void NativeBuild_WithDeployOnBuild_UsedByVS(string config, bool nativeRelink) public void NativeBuild_WithDeployOnBuild_UsedByVS(string config, bool nativeRelink)
{ {
string id = $"blz_deploy_on_build_{config}_{nativeRelink}_{GetRandomId()}"; string id = $"blz_deploy_on_build_{config}_{nativeRelink}_{GetRandomId()}";

View file

@ -605,8 +605,8 @@ namespace Wasm.Build.Tests
} }
protected static string GetSkiaSharpReferenceItems() protected static string GetSkiaSharpReferenceItems()
=> @"<PackageReference Include=""SkiaSharp"" Version=""2.88.6"" /> => @"<PackageReference Include=""SkiaSharp"" Version=""2.88.9-preview.2.2"" />
<PackageReference Include=""SkiaSharp.NativeAssets.WebAssembly"" Version=""2.88.6"" /> <PackageReference Include=""SkiaSharp.NativeAssets.WebAssembly"" Version=""2.88.9-preview.2.2"" />
<NativeFileReference Include=""$(SkiaSharpStaticLibraryPath)\3.1.56\st\*.a"" />"; <NativeFileReference Include=""$(SkiaSharpStaticLibraryPath)\3.1.56\st\*.a"" />";
protected static string s_mainReturns42 = @" protected static string s_mainReturns42 = @"

View file

@ -16,7 +16,7 @@ public class ConfigSrcTests : TestMainJsTestBase
// NOTE: port number determinizes dynamically, so could not generate absolute URI // NOTE: port number determinizes dynamically, so could not generate absolute URI
[Theory] [Theory]
[BuildAndRun(host: RunHost.V8 | RunHost.NodeJS)] [BuildAndRun(host: RunHost.V8)]
public void ConfigSrcAbsolutePath(BuildArgs buildArgs, RunHost host, string id) public void ConfigSrcAbsolutePath(BuildArgs buildArgs, RunHost host, string id)
{ {
buildArgs = buildArgs with { ProjectName = $"configsrcabsolute_{buildArgs.Config}_{buildArgs.AOT}" }; buildArgs = buildArgs with { ProjectName = $"configsrcabsolute_{buildArgs.Config}_{buildArgs.AOT}" };

View file

@ -8,8 +8,8 @@ namespace Wasm.Build.Tests;
public class NodeJSHostRunner : IHostRunner public class NodeJSHostRunner : IHostRunner
{ {
public string GetTestCommand() => "wasm test"; public string GetTestCommand() => "wasm test";
public string GetXharnessArgsWindowsOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace --engine-arg=--experimental-wasm-simd --engine-arg=--experimental-wasm-eh"; public string GetXharnessArgsWindowsOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace";
public string GetXharnessArgsOtherOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace --locale={options.environmentLocale} --engine-arg=--experimental-wasm-simd --engine-arg=--experimental-wasm-eh"; public string GetXharnessArgsOtherOS(XHarnessArgsOptions options) => $"--js-file={options.jsRelativePath} --engine=NodeJS -v trace --locale={options.environmentLocale}";
public bool UseWasmConsoleOutput() => true; public bool UseWasmConsoleOutput() => true;
public bool CanRunWBT() => true; public bool CanRunWBT() => true;
} }

View file

@ -50,8 +50,7 @@ namespace Wasm.Build.Tests
[Theory] [Theory]
[BuildAndRun(aot: false)] [BuildAndRun(aot: false)]
[BuildAndRun(aot: true)] [BuildAndRun(aot: true, config: "Release")]
[ActiveIssue("https://github.com/dotnet/runtime/issues/103566")]
public void ProjectUsingSkiaSharp(BuildArgs buildArgs, RunHost host, string id) public void ProjectUsingSkiaSharp(BuildArgs buildArgs, RunHost host, string id)
{ {
string projectName = $"AppUsingSkiaSharp"; string projectName = $"AppUsingSkiaSharp";

View file

@ -66,7 +66,6 @@ namespace Wasm.Build.Tests
DotnetWasmFromRuntimePack: false)); DotnetWasmFromRuntimePack: false));
RunAndTestWasmApp(buildArgs, RunAndTestWasmApp(buildArgs,
extraXHarnessArgs: host == RunHost.NodeJS ? "--engine-arg=--experimental-wasm-simd --engine-arg=--experimental-wasm-eh" : "",
expectedExitCode: 42, expectedExitCode: 42,
test: output => test: output =>
{ {

View file

@ -57,38 +57,11 @@ public abstract class WasmTemplateTestBase : BuildTestBase
if (runAnalyzers) if (runAnalyzers)
extraProperties += "<RunAnalyzers>true</RunAnalyzers>"; extraProperties += "<RunAnalyzers>true</RunAnalyzers>";
if (template == "wasmconsole")
{
UpdateRuntimeconfigTemplateForNode(_projectDir);
}
AddItemsPropertiesToProject(projectfile, extraProperties); AddItemsPropertiesToProject(projectfile, extraProperties);
return projectfile; return projectfile;
} }
private static void UpdateRuntimeconfigTemplateForNode(string projectDir)
{
// TODO: Can be removed once Node >= 20
string runtimeconfigTemplatePath = Path.Combine(projectDir, "runtimeconfig.template.json");
string runtimeconfigTemplateContent = File.ReadAllText(runtimeconfigTemplatePath);
var runtimeconfigTemplate = JsonObject.Parse(runtimeconfigTemplateContent);
if (runtimeconfigTemplate == null)
throw new Exception($"Unable to parse runtimeconfigtemplate at '{runtimeconfigTemplatePath}'");
var perHostConfigs = runtimeconfigTemplate?["wasmHostProperties"]?["perHostConfig"]?.AsArray();
if (perHostConfigs == null || perHostConfigs.Count == 0 || perHostConfigs[0] == null)
throw new Exception($"Unable to find perHostConfig in runtimeconfigtemplate at '{runtimeconfigTemplatePath}'");
perHostConfigs[0]!["host-args"] = new JsonArray(
"--experimental-wasm-simd",
"--experimental-wasm-eh"
);
File.WriteAllText(runtimeconfigTemplatePath, runtimeconfigTemplate!.ToString());
}
public (string projectDir, string buildOutput) BuildTemplateProject(BuildArgs buildArgs, public (string projectDir, string buildOutput) BuildTemplateProject(BuildArgs buildArgs,
string id, string id,
BuildProjectOptions buildProjectOptions) BuildProjectOptions buildProjectOptions)

View file

@ -884,8 +884,12 @@ bool pal::realpath(pal::string_t* path, bool skip_error_logging)
} }
} }
// Remove the \\?\ prefix, unless it is necessary or was already there // Remove the UNC extended prefix (\\?\UNC\) or extended prefix (\\?\) unless it is necessary or was already there
if (LongFile::IsExtended(str) && !LongFile::IsExtended(*path) && if (LongFile::IsUNCExtended(str) && !LongFile::IsUNCExtended(*path) && str.length() < MAX_PATH)
{
str.replace(0, LongFile::UNCExtendedPathPrefix.size(), LongFile::UNCPathPrefix);
}
else if (LongFile::IsExtended(str) && !LongFile::IsExtended(*path) &&
!LongFile::ShouldNormalize(str.substr(LongFile::ExtendedPrefix.size()))) !LongFile::ShouldNormalize(str.substr(LongFile::ExtendedPrefix.size())))
{ {
str.erase(0, LongFile::ExtendedPrefix.size()); str.erase(0, LongFile::ExtendedPrefix.size());

View file

@ -786,13 +786,6 @@ const char* GlobalizationNative_GetICUDataPathFallback(void)
} }
} }
static NSString* GetBaseName(NSString *localeIdentifier)
{
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:localeIdentifier];
NSString *languageCode = [locale objectForKey:NSLocaleLanguageCode];
return languageCode;
}
const char* GlobalizationNative_GetDefaultLocaleNameNative(void) const char* GlobalizationNative_GetDefaultLocaleNameNative(void)
{ {
@autoreleasepool @autoreleasepool
@ -800,7 +793,7 @@ const char* GlobalizationNative_GetDefaultLocaleNameNative(void)
if (NSLocale.preferredLanguages.count > 0) if (NSLocale.preferredLanguages.count > 0)
{ {
NSString *preferredLanguage = [NSLocale.preferredLanguages objectAtIndex:0]; NSString *preferredLanguage = [NSLocale.preferredLanguages objectAtIndex:0];
return strdup([GetBaseName(preferredLanguage) UTF8String]); return strdup([preferredLanguage UTF8String]);
} }
else else
{ {
@ -821,7 +814,7 @@ const char* GlobalizationNative_GetDefaultLocaleNameNative(void)
localeName = currentLocale.localeIdentifier; localeName = currentLocale.localeIdentifier;
} }
return strdup([GetBaseName(localeName) UTF8String]); return strdup([localeName UTF8String]);
} }
} }
} }

View file

@ -0,0 +1,24 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using Xunit;
using System.Numerics;
public class Foo
{
public Vector3 v1;
public Vector3 v2;
}
public class Runtime_110820
{
[Fact]
public static void TestEntryPoint()
{
var foo = new Foo();
foo.v2 = new Vector3(4, 5, 6);
foo.v1 = new Vector3(1, 2, 3);
Assert.Equal(new Vector3(1, 2, 3), foo.v1);
Assert.Equal(new Vector3(4, 5, 6), foo.v2);
}
}

View file

@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Optimize>True</Optimize>
</PropertyGroup>
<ItemGroup>
<Compile Include="$(MSBuildProjectName).cs" />
</ItemGroup>
</Project>

View file

@ -0,0 +1,103 @@
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
using Xunit;
namespace CollectibleThreadStaticShutdownRace
{
public class CollectibleThreadStaticShutdownRace
{
Action? UseTLSStaticFromLoaderAllocator = null;
GCHandle IsLoaderAllocatorLive;
static ulong s_collectibleIndex;
[MethodImpl(MethodImplOptions.NoInlining)]
void CallUseTLSStaticFromLoaderAllocator()
{
UseTLSStaticFromLoaderAllocator!();
UseTLSStaticFromLoaderAllocator = null;
}
[MethodImpl(MethodImplOptions.NoInlining)]
bool CheckLALive()
{
return IsLoaderAllocatorLive.Target != null;
}
void ThreadThatWaitsForLoaderAllocatorToDisappear()
{
CallUseTLSStaticFromLoaderAllocator();
while (CheckLALive())
{
GC.Collect(2);
}
}
void CreateLoaderAllocatorWithTLS()
{
ulong collectibleIndex = s_collectibleIndex++;
var ab =
AssemblyBuilder.DefineDynamicAssembly(
new AssemblyName($"CollectibleDerivedAssembly{collectibleIndex}"),
AssemblyBuilderAccess.RunAndCollect);
var mob = ab.DefineDynamicModule($"CollectibleDerivedModule{collectibleIndex}");
var tb =
mob.DefineType(
$"CollectibleDerived{collectibleIndex}",
TypeAttributes.Class | TypeAttributes.Public,
typeof(object));
{
var fb =
tb.DefineField(
"Field", typeof(int), FieldAttributes.Static);
fb.SetCustomAttribute(typeof(ThreadStaticAttribute).GetConstructors()[0], new byte[0]);
var mb =
tb.DefineMethod(
"Method",
MethodAttributes.Public | MethodAttributes.Static);
var ilg = mb.GetILGenerator();
ilg.Emit(OpCodes.Ldc_I4_1);
ilg.Emit(OpCodes.Stsfld, fb);
ilg.Emit(OpCodes.Ret);
}
Type createdType = tb.CreateType();
UseTLSStaticFromLoaderAllocator = (Action)createdType.GetMethods()[0].CreateDelegate(typeof(Action));
IsLoaderAllocatorLive = GCHandle.Alloc(createdType, GCHandleType.WeakTrackResurrection);
}
void ForceCollectibleTLSStaticToGoThroughThreadTermination()
{
int iteration = 0;
for (int i = 0; i < 10; i++)
{
Console.WriteLine($"Iteration {iteration++}");
var createLAThread = new Thread(CreateLoaderAllocatorWithTLS);
createLAThread.Start();
createLAThread.Join();
var crashThread = new Thread(ThreadThatWaitsForLoaderAllocatorToDisappear);
crashThread.Start();
crashThread.Join();
}
}
[Fact]
public static void TestEntryPoint()
{
new CollectibleThreadStaticShutdownRace().ForceCollectibleTLSStaticToGoThroughThreadTermination();
}
}
}

View file

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- Needed for mechanical merging of all remaining tests, this particular project may not actually need process isolation -->
<RequiresProcessIsolation>true</RequiresProcessIsolation>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
<Compile Include="CollectibleTLSStaticCollection.cs" />
</ItemGroup>
</Project>

View file

@ -328,28 +328,70 @@ public static unsafe class UnsafeAccessorsTests
extern static ref delegate*<void> GetFPtr(ref AllFields f); extern static ref delegate*<void> GetFPtr(ref AllFields f);
} }
// Contains fields that have modopts/modreqs // Contains fields that are volatile
struct FieldsWithModifiers struct VolatileFields
{ {
private static volatile int s_vInt; private static volatile int s_vInt;
private volatile int _vInt; private volatile int _vInt;
} }
[Fact] // Accessors for fields that are volatile
public static void Verify_AccessFieldsWithModifiers() static class AccessorsVolatile
{ {
Console.WriteLine($"Running {nameof(Verify_AccessFieldsWithModifiers)}");
FieldsWithModifiers fieldsWithModifiers = default;
GetStaticVolatileInt(ref fieldsWithModifiers) = default;
GetVolatileInt(ref fieldsWithModifiers) = default;
[UnsafeAccessor(UnsafeAccessorKind.StaticField, Name="s_vInt")] [UnsafeAccessor(UnsafeAccessorKind.StaticField, Name="s_vInt")]
extern static ref int GetStaticVolatileInt(ref FieldsWithModifiers f); public extern static ref int GetStaticVolatileInt(ref VolatileFields f);
[UnsafeAccessor(UnsafeAccessorKind.Field, Name="_vInt")] [UnsafeAccessor(UnsafeAccessorKind.Field, Name="_vInt")]
extern static ref int GetVolatileInt(ref FieldsWithModifiers f); public extern static ref int GetVolatileInt(ref VolatileFields f);
}
[Fact]
public static void Verify_AccessFieldsWithVolatile()
{
Console.WriteLine($"Running {nameof(Verify_AccessFieldsWithVolatile)}");
VolatileFields fieldsWithVolatile = default;
AccessorsVolatile.GetStaticVolatileInt(ref fieldsWithVolatile) = default;
AccessorsVolatile.GetVolatileInt(ref fieldsWithVolatile) = default;
}
// Contains fields that are readonly
readonly struct ReadOnlyFields
{
public static readonly int s_rInt;
public readonly int _rInt;
}
// Accessors for fields that are readonly
static class AccessorsReadOnly
{
[UnsafeAccessor(UnsafeAccessorKind.StaticField, Name="s_rInt")]
public extern static ref readonly int GetStaticReadOnlyInt(ref readonly ReadOnlyFields f);
[UnsafeAccessor(UnsafeAccessorKind.Field, Name="_rInt")]
public extern static ref readonly int GetReadOnlyInt(ref readonly ReadOnlyFields f);
}
[Fact]
public static void Verify_AccessFieldsWithReadOnlyRefs()
{
Console.WriteLine($"Running {nameof(Verify_AccessFieldsWithReadOnlyRefs)}");
ReadOnlyFields readOnlyFields = default;
Assert.True(Unsafe.AreSame(in AccessorsReadOnly.GetStaticReadOnlyInt(in readOnlyFields), in ReadOnlyFields.s_rInt));
Assert.True(Unsafe.AreSame(in AccessorsReadOnly.GetReadOnlyInt(in readOnlyFields), in readOnlyFields._rInt));
// Test the local declaration of the signature since it places modopts/modreqs differently.
Assert.True(Unsafe.AreSame(in GetStaticReadOnlyIntLocal(in readOnlyFields), in ReadOnlyFields.s_rInt));
Assert.True(Unsafe.AreSame(in GetReadOnlyIntLocal(in readOnlyFields), in readOnlyFields._rInt));
[UnsafeAccessor(UnsafeAccessorKind.StaticField, Name="s_rInt")]
extern static ref readonly int GetStaticReadOnlyIntLocal(ref readonly ReadOnlyFields f);
[UnsafeAccessor(UnsafeAccessorKind.Field, Name="_rInt")]
extern static ref readonly int GetReadOnlyIntLocal(ref readonly ReadOnlyFields f);
} }
[Fact] [Fact]

View file

@ -1010,6 +1010,9 @@
<ExcludeList Include="$(XunitTestBinBase)/Loader/CollectibleAssemblies/ByRefLocals/ByRefLocals/*"> <ExcludeList Include="$(XunitTestBinBase)/Loader/CollectibleAssemblies/ByRefLocals/ByRefLocals/*">
<Issue>https://github.com/dotnet/runtimelab/issues/155: Collectible assemblies</Issue> <Issue>https://github.com/dotnet/runtimelab/issues/155: Collectible assemblies</Issue>
</ExcludeList> </ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/Loader/CollectibleAssemblies/Statics/CollectibleTLSStaticCollection/*">
<Issue>https://github.com/dotnet/runtimelab/issues/155: Collectible assemblies</Issue>
</ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/Loader/CollectibleAssemblies/Statics/CollectibleStatics/*"> <ExcludeList Include="$(XunitTestBinBase)/Loader/CollectibleAssemblies/Statics/CollectibleStatics/*">
<Issue>https://github.com/dotnet/runtimelab/issues/155: Collectible assemblies</Issue> <Issue>https://github.com/dotnet/runtimelab/issues/155: Collectible assemblies</Issue>
</ExcludeList> </ExcludeList>
@ -2464,6 +2467,10 @@
<ExcludeList Include = "$(XunitTestBinBase)/reflection/RefEmit/EmittingIgnoresAccessChecksToAttributeIsRespected/**"> <ExcludeList Include = "$(XunitTestBinBase)/reflection/RefEmit/EmittingIgnoresAccessChecksToAttributeIsRespected/**">
<Issue>Reflection.Emit is not supported on fullaot</Issue> <Issue>Reflection.Emit is not supported on fullaot</Issue>
</ExcludeList> </ExcludeList>
<ExcludeList Include="$(XunitTestBinBase)/Loader\classloader\MethodImpl\CovariantReturns\UnitTest\UnitTest_GVM_TypeLoadException\*">
<Issue>Attempting to JIT compile method 'void CMain:RunInvalidTest1 ()' while running in aot-only mode.</Issue>
</ExcludeList>
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(RuntimeFlavor)' == 'mono' and ('$(RuntimeVariant)' == 'llvmfullaot' or '$(RuntimeVariant)' == 'llvmaot' or '$(RuntimeVariant)' == 'minifullaot' or '$(TargetsAppleMobile)' == 'true')"> <ItemGroup Condition="'$(RuntimeFlavor)' == 'mono' and ('$(RuntimeVariant)' == 'llvmfullaot' or '$(RuntimeVariant)' == 'llvmaot' or '$(RuntimeVariant)' == 'minifullaot' or '$(TargetsAppleMobile)' == 'true')">