diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json index 04e469de677..8f18a12d27c 100644 --- a/.config/dotnet-tools.json +++ b/.config/dotnet-tools.json @@ -3,7 +3,7 @@ "isRoot": true, "tools": { "microsoft.dotnet.darc": { - "version": "1.1.0-beta.25257.6", + "version": "1.1.0-beta.25259.3", "commands": [ "darc" ] diff --git a/eng/PublishSourceBuild.props b/eng/PublishSourceBuild.props index 7b23c20af25..4206e9ab288 100644 --- a/eng/PublishSourceBuild.props +++ b/eng/PublishSourceBuild.props @@ -9,7 +9,8 @@ Outputs="$(BaseIntermediateOutputPath)ReportPoisonUsage.complete"> - + + diff --git a/eng/Publishing.props b/eng/Publishing.props index a254f81a148..221a9f5c334 100644 --- a/eng/Publishing.props +++ b/eng/Publishing.props @@ -39,11 +39,6 @@ - - - $([MSBuild]::NormalizePath('$(ArtifactsBinDir)', 'Microsoft.DotNet.UnifiedBuild.Tasks', '$(Configuration)', 'Microsoft.DotNet.UnifiedBuild.Tasks.dll')) - - diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index 161b3e41b5f..5e3225c2815 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -10,9 +10,9 @@ https://github.com/dotnet/arcade f68e9e905ba5a7b6437b7560d5a6b170057ecb2f - + https://github.com/dotnet/arcade-services - 83dd68a5d7d5ccaed7e821cfc7e3c08e10cc3d8d + bd2309670213218bc0e2073379e4985b346600c7 diff --git a/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/ReadRepoInfoFromSourceManifest.cs b/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/ReadRepoInfoFromSourceManifest.cs new file mode 100644 index 00000000000..9b4371eb9e2 --- /dev/null +++ b/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/ReadRepoInfoFromSourceManifest.cs @@ -0,0 +1,58 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text.Json; +using System.Text.Json.Nodes; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Microsoft.DotNet.UnifiedBuild.Tasks +{ + // Takes a path to a source-manifest.json file and + // reads the information for a specific repo from it. + public class ReadRepoInfoFromSourceManifest : Task + { + [Required] + public string SourceManifest { get; set; } = ""; + + [Required] + public string RepositoryName { get; set; } = ""; + + /// + /// Returns metadata about the repository from source-manifest.json. + /// + [Output] + public ITaskItem? RepoInfo { get; set; } + + public override bool Execute() + { + if (!File.Exists(SourceManifest)) + { + Log.LogError($"Source manifest file not found: {SourceManifest}"); + return false; + } + + JsonArray? repositories = JsonNode.Parse(File.OpenRead(SourceManifest))?["repositories"]?.AsArray(); + + JsonObject? repo = repositories + ?.Where(p => p?["path"]?.ToString() == RepositoryName) + .FirstOrDefault() + ?.AsObject(); + + if (repo == null) + { + Log.LogError($"Repository {RepositoryName} not found in source manifest."); + return false; + } + + RepoInfo = new TaskItem(RepositoryName, repo.ToDictionary(p => p.Key, p => p.Value?.ToString())); + + return true; + } + } +} diff --git a/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/UpdateNuGetConfigPackageSourcesMappings.cs b/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/UpdateNuGetConfigPackageSourcesMappings.cs index 7d526832d0d..5a6c99ae3bc 100644 --- a/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/UpdateNuGetConfigPackageSourcesMappings.cs +++ b/eng/tools/tasks/Microsoft.DotNet.UnifiedBuild.Tasks/UpdateNuGetConfigPackageSourcesMappings.cs @@ -319,7 +319,15 @@ private void DiscoverPackagesFromAllSourceBuildSources(XElement pkgSourcesElemen continue; } - string[] packages = Directory.GetFiles(path, "*.nupkg", SearchOption.AllDirectories); + // previously-source-built source contains SBRP packages in a subfolder. + // We do not want to enumerate those packages as they already exist in reference packages source. + // SBRP folder will be removed with https://github.com/dotnet/source-build/issues/4930 + SearchOption searchOption = + packageSource.Equals(PreviouslySourceBuiltSourceName) + ? SearchOption.TopDirectoryOnly + : SearchOption.AllDirectories; + + string[] packages = Directory.GetFiles(path, "*.nupkg", searchOption); Array.Sort(packages); foreach (string package in packages) { diff --git a/prereqs/git-info/arcade.props b/prereqs/git-info/arcade.props index f8defe97e78..d8f51fdc5a1 100644 --- a/prereqs/git-info/arcade.props +++ b/prereqs/git-info/arcade.props @@ -1,8 +1,8 @@  - 48c22bf560e40ae692a9098d29466539aa6c2e14 - 20250507.2 - 10.0.0-beta.25257.2 + 80c4e4d26cb85c86f7e1be77d2d9eceeef0f3493 + 20250509.2 + 10.0.0-beta.25259.2 \ No newline at end of file diff --git a/prereqs/git-info/aspnetcore.props b/prereqs/git-info/aspnetcore.props index 12832243b0f..74c40461e2a 100644 --- a/prereqs/git-info/aspnetcore.props +++ b/prereqs/git-info/aspnetcore.props @@ -1,8 +1,8 @@  - 1a7ca4a8236d2930b8af2489c0c3a14eb8627544 - 20250508.6 - 10.0.0-preview.5.25258.6 + 6567ae56ec038ec9b71d3cd6098671da39bf1504 + 20250512.8 + 10.0.0-preview.5.25262.8 \ No newline at end of file diff --git a/prereqs/git-info/cecil.props b/prereqs/git-info/cecil.props index 9c071741636..83a1cbe4fbf 100644 --- a/prereqs/git-info/cecil.props +++ b/prereqs/git-info/cecil.props @@ -1,8 +1,8 @@  - ace481b2c118341192e9ac0caceb17cede03ed47 - 20250502.1 - 0.11.5-alpha.25252.1 + 091a4d494e2575c524c316013a482ec88bba28f2 + 20250511.1 + 0.11.5-alpha.25261.1 \ No newline at end of file diff --git a/prereqs/git-info/deployment-tools.props b/prereqs/git-info/deployment-tools.props index ba67a4d4a57..cc99514f08a 100644 --- a/prereqs/git-info/deployment-tools.props +++ b/prereqs/git-info/deployment-tools.props @@ -1,8 +1,8 @@  - c97b44a3c5d3504ae98d3499bcdce4828d3d7230 - 20250508.1 - 9.0.0-preview.1.25258.1 + e49e231fca51db9fad01d36efdd230d3307640cc + 20250512.1 + 9.0.0-preview.1.25262.1 \ No newline at end of file diff --git a/prereqs/git-info/diagnostics.props b/prereqs/git-info/diagnostics.props index e2a27d99e87..9123991a484 100644 --- a/prereqs/git-info/diagnostics.props +++ b/prereqs/git-info/diagnostics.props @@ -1,8 +1,8 @@  - aebf15d23e5a25ab718e780a29d8aca9a5280425 - 20250506.1 - 9.0.625601 + 3a08702ea8e0083a74e10556c60c0bccd868b64a + 20250512.2 + 9.0.626202 \ No newline at end of file diff --git a/prereqs/git-info/efcore.props b/prereqs/git-info/efcore.props index c4c38e90651..26e9db422d8 100644 --- a/prereqs/git-info/efcore.props +++ b/prereqs/git-info/efcore.props @@ -1,8 +1,8 @@  - a72632d6bfe67740954f74da5e42e1795e405522 - 20250508.1 - 10.0.0-preview.4.25258.1 + 7a87abf268190f3a0d5f218e9b0b595360701af3 + 20250512.1 + 10.0.0-preview.4.25262.1 \ No newline at end of file diff --git a/prereqs/git-info/emsdk.props b/prereqs/git-info/emsdk.props index ce4559c5a5d..f5cd2ae6f49 100644 --- a/prereqs/git-info/emsdk.props +++ b/prereqs/git-info/emsdk.props @@ -1,8 +1,8 @@  - b71a7e2de42aa8486e84ec10765c45e13109ccea - 20250508.3 - 10.0.0-preview.5.25258.3 + 06aad6dee7a5385f4d753d9111be036e641d7c3a + 20250512.1 + 10.0.0-preview.5.25262.1 \ No newline at end of file diff --git a/prereqs/git-info/nuget-client.props b/prereqs/git-info/nuget-client.props index e097599567c..0420dd29709 100644 --- a/prereqs/git-info/nuget-client.props +++ b/prereqs/git-info/nuget-client.props @@ -1,8 +1,8 @@  - ebbb676221eaa2a8aed9cf89e8719b7139251e10 - 6.15.0.45 - 6.15.0-preview.1.45 + e4e3b79701686199bc804a06533d2df054924d7e + 6.15.0.50 + 6.15.0-preview.1.50 \ No newline at end of file diff --git a/prereqs/git-info/razor.props b/prereqs/git-info/razor.props index eade1748e80..2db2e207720 100644 --- a/prereqs/git-info/razor.props +++ b/prereqs/git-info/razor.props @@ -1,8 +1,8 @@  - ddcd02f08f9ab3c57598550c15a7ce501341a5dd - 20250507.4 - 10.0.0-preview.25257.4 + c971e1c19e2d56f9d8a396f7a72b245495340bae + 20250512.1 + 10.0.0-preview.25262.1 \ No newline at end of file diff --git a/prereqs/git-info/roslyn-analyzers.props b/prereqs/git-info/roslyn-analyzers.props index 856e8495bbf..1a4f7eae270 100644 --- a/prereqs/git-info/roslyn-analyzers.props +++ b/prereqs/git-info/roslyn-analyzers.props @@ -1,8 +1,8 @@  - fb6e4b4d3f36ff60dd731a7b2006dab231c70935 - 20250507.1 - 10.0.0-preview.25257.1 + 4829e8048a7b398fc72304823bd6a4361fd31582 + 20250510.1 + 10.0.0-preview.25260.1 \ No newline at end of file diff --git a/prereqs/git-info/roslyn.props b/prereqs/git-info/roslyn.props index 1592b161588..ca6f43be563 100644 --- a/prereqs/git-info/roslyn.props +++ b/prereqs/git-info/roslyn.props @@ -1,8 +1,8 @@  - b422f78da6c84f4c1e3685580f9aa79c743d16c7 - 20250508.10 - 5.0.0-1.25258.10 + 299955a9f762cc8e4b716a4801dc02ca6f41e3ef + 20250512.6 + 5.0.0-1.25262.6 \ No newline at end of file diff --git a/prereqs/git-info/runtime.props b/prereqs/git-info/runtime.props index a76a6fc89f0..52633a09c70 100644 --- a/prereqs/git-info/runtime.props +++ b/prereqs/git-info/runtime.props @@ -1,8 +1,8 @@  - e67e997094b65c8ed7289b00f2304288d8f75a12 - 20250509.6 - 10.0.0-preview.5.25259.6 + d2c561859bd6474b8ec38bf4ee7296e4e717ce1c + 20250512.10 + 10.0.0-preview.5.25262.10 \ No newline at end of file diff --git a/prereqs/git-info/scenario-tests.props b/prereqs/git-info/scenario-tests.props index 62d6c287e43..3c03a4cf4be 100644 --- a/prereqs/git-info/scenario-tests.props +++ b/prereqs/git-info/scenario-tests.props @@ -1,8 +1,8 @@  - 3ba55042a88ef20d2aba4475d7622d3fa14c0527 - 20250506.1 + 828faff7300aac7fae6f9544393f9cb317baeb6d + 20250512.1 10.0.0-preview.25221.1 \ No newline at end of file diff --git a/prereqs/git-info/sdk.props b/prereqs/git-info/sdk.props index 23ec6aff0bd..9f9d39945f9 100644 --- a/prereqs/git-info/sdk.props +++ b/prereqs/git-info/sdk.props @@ -1,8 +1,8 @@  - c8d913c0a76d258b2858966139ba67b4ce7873a0 - 20250508.26 - 10.0.100-preview.5.25258.26 + 6e5ee83b67a1b1f1be82202e91611696d0ea4f93 + 20250512.11 + 10.0.100-preview.5.25262.11 \ No newline at end of file diff --git a/prereqs/git-info/source-build-externals.props b/prereqs/git-info/source-build-externals.props index 541d5f3ee99..ea9691d1110 100644 --- a/prereqs/git-info/source-build-externals.props +++ b/prereqs/git-info/source-build-externals.props @@ -1,8 +1,8 @@  - 51f102c8aa5afcd42ff3a3c8a687262b194bf929 - 20250508.2 + a4f971d850e3a10462dd8ec2be47c90532e3490e + 20250511.1 10.0.622801 \ No newline at end of file diff --git a/prereqs/git-info/source-build-reference-packages.props b/prereqs/git-info/source-build-reference-packages.props index cfdb6cd5068..01cd870baef 100644 --- a/prereqs/git-info/source-build-reference-packages.props +++ b/prereqs/git-info/source-build-reference-packages.props @@ -1,8 +1,8 @@  - 804fed8577d3f6226b1a12966af5ddde6928106b - 20250508.1 + b43f862282711dcccd5b534620443e4c2947f8ba + 20250511.1 \ No newline at end of file diff --git a/prereqs/git-info/sourcelink.props b/prereqs/git-info/sourcelink.props index e4e5de7ec0f..0385a8aed6e 100644 --- a/prereqs/git-info/sourcelink.props +++ b/prereqs/git-info/sourcelink.props @@ -1,8 +1,8 @@  - b1cdbdfa41d0f0135dbdb574cd47c7010dd5cf94 - 20250508.2 - 10.0.0-beta.25258.2 + 8be2b265e8ac8f8dc9a3e97026cfdc8ee2cb587c + 20250511.1 + 10.0.0-beta.25261.1 \ No newline at end of file diff --git a/prereqs/git-info/symreader.props b/prereqs/git-info/symreader.props index f8d88e9f1f2..ee1d627b671 100644 --- a/prereqs/git-info/symreader.props +++ b/prereqs/git-info/symreader.props @@ -1,8 +1,8 @@  - 6565fef44c1528244224690207a3f0c2a4b9295a - 20250506.1 - 2.2.0-beta.25256.1 + d38d92c12935201bb8852096935c267d53592ad9 + 20250512.1 + 2.2.0-beta.25262.1 \ No newline at end of file diff --git a/prereqs/git-info/templating.props b/prereqs/git-info/templating.props index 6ff99a11368..b4f3cf50287 100644 --- a/prereqs/git-info/templating.props +++ b/prereqs/git-info/templating.props @@ -1,8 +1,8 @@  - fd2db2bebc77711b3844faefb015af6a4ca59c3c - 20250507.7 - 10.0.100-preview.5.25257.7 + db6256f5f72d0b954273e94f616f1bf0ba9c443c + 20250511.1 + 10.0.100-preview.5.25261.1 \ No newline at end of file diff --git a/prereqs/git-info/windowsdesktop.props b/prereqs/git-info/windowsdesktop.props index eff9a049531..c3b548dffde 100644 --- a/prereqs/git-info/windowsdesktop.props +++ b/prereqs/git-info/windowsdesktop.props @@ -1,8 +1,8 @@  - 1e5f448ed7d1774c0f8665c66e50d6e2173c27bb - 20250507.5 - 10.0.0-preview.5.25257.5 + 2736c90fe4a9e7397341e9288ca5a0b9caa0533f + 20250510.1 + 10.0.0-preview.5.25260.1 \ No newline at end of file diff --git a/prereqs/git-info/winforms.props b/prereqs/git-info/winforms.props index 644713b7ea8..8b1610ff0d8 100644 --- a/prereqs/git-info/winforms.props +++ b/prereqs/git-info/winforms.props @@ -1,8 +1,8 @@  - dd514dc4d78cab740356965cb7dd121c3dbf865d - 20250508.5 - 10.0.0-preview.5.25258.5 + 10c8369f4fa2a945b7477b9f91e04ddea968c23c + 20250512.1 + 10.0.0-preview.5.25262.1 \ No newline at end of file diff --git a/prereqs/git-info/wpf.props b/prereqs/git-info/wpf.props index 2b3d052d672..e6611433152 100644 --- a/prereqs/git-info/wpf.props +++ b/prereqs/git-info/wpf.props @@ -1,8 +1,8 @@  - fdce5403b04a7098f08d074589c8b38cf9dc7bf8 - 20250508.7 - 10.0.0-preview.5.25258.7 + ac5efa2727c7980fa9623e8b41411866d25e7332 + 20250512.2 + 10.0.0-preview.5.25262.2 \ No newline at end of file diff --git a/prereqs/git-info/xdt.props b/prereqs/git-info/xdt.props index 08159435ef5..c80aef1187b 100644 --- a/prereqs/git-info/xdt.props +++ b/prereqs/git-info/xdt.props @@ -1,8 +1,8 @@  - 0819f8fa746a99202a4d1c0e3be921e18a9f049f - 20250508.1 - 10.0.0-preview.25258.1 + 9c96c93edcbcd43de208ae76ae782b98786da623 + 20250512.1 + 10.0.0-preview.25262.1 \ No newline at end of file diff --git a/repo-projects/Directory.Build.targets b/repo-projects/Directory.Build.targets index 9e7b8b3a007..d71028404ef 100644 --- a/repo-projects/Directory.Build.targets +++ b/repo-projects/Directory.Build.targets @@ -447,8 +447,23 @@ + + + + + + + + + + $(CommonArgs) /p:RepoOriginalSourceRevisionId=%(RepoInfo.CommitSha) + + + + DependsOnTargets="GetTransitiveRepositoryReferences;SetRepoOriginalSourceRevisionId"> $(MicrosoftNETCoreAppRuntimeVersion) + Condition=" $([System.String]::new('%(Identity)').StartsWith('Microsoft.NETCore.App.Runtime.')) or $([System.String]::new('%(Identity)').StartsWith('Microsoft.NETCore.App.Crossgen2.'))">$(MicrosoftNETCoreAppRefVersion) diff --git a/src/aspnetcore/eng/Version.Details.xml b/src/aspnetcore/eng/Version.Details.xml index 3959831b251..19c9aad572b 100644 --- a/src/aspnetcore/eng/Version.Details.xml +++ b/src/aspnetcore/eng/Version.Details.xml @@ -8,337 +8,337 @@ See https://github.com/dotnet/arcade/blob/master/Documentation/Darc.md for instructions on using darc. --> - + - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb @@ -357,44 +357,44 @@ https://github.com/dotnet/roslyn afdd413cee50c16318620252e4e64dc326e2d300 - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb https://github.com/dotnet/extensions diff --git a/src/aspnetcore/eng/Versions.props b/src/aspnetcore/eng/Versions.props index 5a1182d5ece..81a225c53d7 100644 --- a/src/aspnetcore/eng/Versions.props +++ b/src/aspnetcore/eng/Versions.props @@ -67,94 +67,94 @@ --> - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 9.5.0-preview.1.25252.3 9.5.0-preview.1.25252.3 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 + 10.0.0-preview.4.25260.104 + 10.0.0-preview.4.25260.104 + 10.0.0-preview.4.25260.104 + 10.0.0-preview.4.25260.104 + 10.0.0-preview.4.25260.104 + 10.0.0-preview.4.25260.104 + 10.0.0-preview.4.25260.104 + 10.0.0-preview.4.25260.104 4.13.0-3.24613.7 @@ -167,12 +167,12 @@ 6.2.4 6.2.4 - 10.0.0-beta.25257.101 - 10.0.0-beta.25257.101 - 10.0.0-beta.25257.101 - 10.0.0-beta.25257.101 + 10.0.0-beta.25260.104 + 10.0.0-beta.25260.104 + 10.0.0-beta.25260.104 + 10.0.0-beta.25260.104 - 10.0.0-preview.25257.101 + 10.0.0-preview.25260.104 1.0.0-prerelease.25217.3 1.0.0-prerelease.25217.3 @@ -189,13 +189,6 @@ Versions below this comment are not managed by automation and can be changed as needed. --> - - - $(MicrosoftNETCoreAppRuntimewinx64Version) - 6.0.0 diff --git a/src/aspnetcore/eng/build.ps1 b/src/aspnetcore/eng/build.ps1 index 5d58d01abc5..96bc05a6cbe 100644 --- a/src/aspnetcore/eng/build.ps1 +++ b/src/aspnetcore/eng/build.ps1 @@ -99,6 +99,9 @@ Additional feed that can be used when downloading .NET runtimes and SDKs .PARAMETER RuntimeSourceFeedKey Key for feed that can be used when downloading .NET runtimes and SDKs +.PARAMETER ProductBuild +Build the repository in product mode (short: -pb). + .EXAMPLE Building both native and managed projects. @@ -196,6 +199,10 @@ param( [Alias('DotNetRuntimeSourceFeedKey')] [string]$RuntimeSourceFeedKey, + # Product build + [Alias('pb')] + [switch]$ProductBuild, + # Capture the rest [Parameter(ValueFromRemainingArguments = $true)] [string[]]$MSBuildArguments @@ -275,6 +282,8 @@ $MSBuildArguments += "/p:Publish=$Publish" $MSBuildArguments += "/p:TargetArchitecture=$Architecture" $MSBuildArguments += "/p:TargetOsName=win" +if ($ProductBuild) { $MSBuildArguments += "/p:DotNetBuildRepo=$ProductBuild" } + if (-not $Configuration) { $Configuration = if ($CI) { 'Release' } else { 'Debug' } } @@ -289,6 +298,7 @@ if ($RuntimeSourceFeed -or $RuntimeSourceFeedKey) { $ToolsetBuildArguments += $runtimeFeedArg $ToolsetBuildArguments += $runtimeFeedKeyArg } +if ($ProductBuild) { $ToolsetBuildArguments += "/p:DotNetBuildRepo=$ProductBuild" } # Split build categories between dotnet msbuild and desktop msbuild. Use desktop msbuild as little as possible. [string[]]$dotnetBuildArguments = '' @@ -352,10 +362,6 @@ Remove-Item variable:global:_DotNetInstallDir -ea Ignore Remove-Item variable:global:_ToolsetBuildProj -ea Ignore Remove-Item variable:global:_MSBuildExe -ea Ignore -# tools.ps1 expects the remaining arguments to be available via the $properties string array variable -# TODO: Remove when https://github.com/dotnet/source-build/issues/4337 is implemented. -[string[]] $properties = $MSBuildArguments - # Import Arcade . "$PSScriptRoot/common/tools.ps1" diff --git a/src/aspnetcore/eng/build.sh b/src/aspnetcore/eng/build.sh index 3da456256ce..fa217f24ec5 100755 --- a/src/aspnetcore/eng/build.sh +++ b/src/aspnetcore/eng/build.sh @@ -35,6 +35,8 @@ target_arch='x64' configuration='' runtime_source_feed='' runtime_source_feed_key='' +source_build='' +product_build='' if [ "$(uname)" = "Darwin" ]; then target_os_name='osx' @@ -88,6 +90,9 @@ Options: --runtime-source-feed Additional feed that can be used when downloading .NET runtimes and SDKs --runtime-source-feed-key Key for feed that can be used when downloading .NET runtimes and SDKs + --sourceBuild|-sb Build the repository in source-only mode. + --productBuild|-pb Build the repository in product-build mode. + Description: This build script installs required tools and runs an MSBuild command on this repository This script can be used to invoke various targets, such as targets to produce packages @@ -247,6 +252,13 @@ while [[ $# -gt 0 ]]; do [ -z "${1:-}" ] && __error "Missing value for parameter --runtime-source-feed-key" && __usage runtime_source_feed_key="${1:-}" ;; + -sourcebuild|-source-build|-sb) + source_build=true + product_build=true + ;; + -productbuild|-product-build|-pb) + product_build=true + ;; *) msbuild_args[${#msbuild_args[*]}]="$1" ;; @@ -304,6 +316,8 @@ fi [ ! -z "$build_nodejs" ] && msbuild_args[${#msbuild_args[*]}]="-p:BuildNodeJSUnlessSourcebuild=$build_nodejs" [ ! -z "$build_managed" ] && msbuild_args[${#msbuild_args[*]}]="-p:BuildManaged=$build_managed" [ ! -z "$build_installers" ] && msbuild_args[${#msbuild_args[*]}]="-p:BuildInstallers=$build_installers" +[ ! -z "$product_build" ] && msbuild_args[${#msbuild_args[*]}]="-p:DotNetBuildRepo=$product_build" +[ ! -z "$source_build" ] && msbuild_args[${#msbuild_args[*]}]="-p:DotNetBuildSourceOnly=$source_build" # Run restore by default unless --no-restore or --no-build was specified. [ -z "$run_restore" ] && run_restore=true @@ -333,13 +347,15 @@ msbuild_args[${#msbuild_args[*]}]="-p:Configuration=$configuration" # Set up additional runtime args toolset_build_args=() if [ ! -z "$runtime_source_feed$runtime_source_feed_key" ]; then - runtimeFeedArg="/p:DotNetRuntimeSourceFeed=$runtime_source_feed" - runtimeFeedKeyArg="/p:DotNetRuntimeSourceFeedKey=$runtime_source_feed_key" + runtimeFeedArg="-p:DotNetRuntimeSourceFeed=$runtime_source_feed" + runtimeFeedKeyArg="-p:DotNetRuntimeSourceFeedKey=$runtime_source_feed_key" msbuild_args[${#msbuild_args[*]}]=$runtimeFeedArg msbuild_args[${#msbuild_args[*]}]=$runtimeFeedKeyArg toolset_build_args[${#toolset_build_args[*]}]=$runtimeFeedArg toolset_build_args[${#toolset_build_args[*]}]=$runtimeFeedKeyArg fi +[ ! -z "$product_build" ] && toolset_build_args[${#toolset_build_args[*]}]="-p:DotNetBuildRepo=$product_build" +[ ! -z "$source_build" ] && toolset_build_args[${#toolset_build_args[*]}]="-p:DotNetBuildSourceOnly=$source_build" # Initialize global variables need to be set before the import of Arcade is imported restore=$run_restore @@ -359,10 +375,6 @@ if [ "$(uname)" = "Darwin" ]; then ulimit -n 10000 fi -# tools.sh expects the remaining arguments to be available via the $properties string array variable -# TODO: Remove when https://github.com/dotnet/source-build/issues/4337 is implemented. -properties=$msbuild_args - # Import Arcade . "$DIR/common/tools.sh" diff --git a/src/aspnetcore/eng/common/core-templates/steps/source-build.yml b/src/aspnetcore/eng/common/core-templates/steps/source-build.yml index c7c062e88ee..f2a0f347fdd 100644 --- a/src/aspnetcore/eng/common/core-templates/steps/source-build.yml +++ b/src/aspnetcore/eng/common/core-templates/steps/source-build.yml @@ -38,14 +38,9 @@ steps: targetRidArgs='/p:TargetRid=${{ parameters.platform.targetRID }}' fi - runtimeOsArgs= - if [ '${{ parameters.platform.runtimeOS }}' != '' ]; then - runtimeOsArgs='/p:RuntimeOS=${{ parameters.platform.runtimeOS }}' - fi - - baseOsArgs= - if [ '${{ parameters.platform.baseOS }}' != '' ]; then - baseOsArgs='/p:BaseOS=${{ parameters.platform.baseOS }}' + baseRidArgs= + if [ '${{ parameters.platform.baseRID }}' != '' ]; then + baseRidArgs='/p:BaseRid=${{ parameters.platform.baseRID }}' fi portableBuildArgs= @@ -59,8 +54,7 @@ steps: ${{ parameters.platform.buildArguments }} \ $internalRuntimeDownloadArgs \ $targetRidArgs \ - $runtimeOsArgs \ - $baseOsArgs \ + $baseRidArgs \ $portableBuildArgs \ /p:DotNetBuildSourceOnly=true \ /p:DotNetBuildRepo=true \ diff --git a/src/aspnetcore/eng/common/tools.sh b/src/aspnetcore/eng/common/tools.sh index d51f300c772..cc007b1f15a 100755 --- a/src/aspnetcore/eng/common/tools.sh +++ b/src/aspnetcore/eng/common/tools.sh @@ -5,6 +5,9 @@ # CI mode - set to true on CI server for PR validation build or official build. ci=${ci:-false} +# Build mode +source_build=${source_build:-false} + # Set to true to use the pipelines logger which will enable Azure logging output. # https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md # This flag is meant as a temporary opt-opt for the feature while validate it across @@ -58,7 +61,8 @@ use_installed_dotnet_cli=${use_installed_dotnet_cli:-true} dotnetInstallScriptVersion=${dotnetInstallScriptVersion:-'v1'} # True to use global NuGet cache instead of restoring packages to repository-local directory. -if [[ "$ci" == true ]]; then +# Keep in sync with NuGetPackageroot in Arcade SDK's RepositoryLayout.props. +if [[ "$ci" == true || "$source_build" == true ]]; then use_global_nuget_cache=${use_global_nuget_cache:-false} else use_global_nuget_cache=${use_global_nuget_cache:-true} diff --git a/src/aspnetcore/eng/targets/Helix.Common.props b/src/aspnetcore/eng/targets/Helix.Common.props index c5628d35c2f..e517b9410d2 100644 --- a/src/aspnetcore/eng/targets/Helix.Common.props +++ b/src/aspnetcore/eng/targets/Helix.Common.props @@ -1,12 +1,13 @@ - (AlmaLinux.8.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:almalinux-8-helix-amd64 - (Alpine.318.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.18-helix-amd64 - (Debian.12.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-amd64 - (Fedora.41.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-41-helix - (Mariner)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:cbl-mariner-2.0-helix-amd64 - (Debian.12.Arm64.Open)ubuntu.2204.armarch.open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-12-helix-arm64v8 + (AlmaLinux.9.Amd64.Open)azurelinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:almalinux-9-helix-amd64 + (Alpine.321.Amd64.Open)azurelinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.21-helix-amd64 + (AzureLinux.30.Amd64.Open)azurelinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-helix-amd64 + (Debian.13.Amd64.Open)azurelinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-amd64 + (Fedora.42.Amd64.Open)azurelinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-42-helix-amd64 + + (Debian.13.Arm64.Open)ubuntu.2204.armarch.open@mcr.microsoft.com/dotnet-buildtools/prereqs:debian-13-helix-arm64v8 false @@ -38,14 +39,15 @@ - + - - - - - + + + + + + diff --git a/src/aspnetcore/eng/targets/Helix.targets b/src/aspnetcore/eng/targets/Helix.targets index 70e01877bef..d58bc8feedd 100644 --- a/src/aspnetcore/eng/targets/Helix.targets +++ b/src/aspnetcore/eng/targets/Helix.targets @@ -16,11 +16,11 @@ - $(HelixQueueAlmaLinux8); - $(HelixQueueAlpine318); - $(HelixQueueDebian12); + $(HelixQueueAlmaLinux); + $(HelixQueueAlpine); + $(HelixQueueAzureLinux); + $(HelixQueueDebian); $(HelixQueueFedora40); - $(HelixQueueMariner); Ubuntu.2004.Amd64.Open; true diff --git a/src/aspnetcore/eng/testing/linker/SupportFiles/Directory.Build.targets b/src/aspnetcore/eng/testing/linker/SupportFiles/Directory.Build.targets index 765082e447a..68afc5df367 100644 --- a/src/aspnetcore/eng/testing/linker/SupportFiles/Directory.Build.targets +++ b/src/aspnetcore/eng/testing/linker/SupportFiles/Directory.Build.targets @@ -8,10 +8,10 @@ + RuntimeFrameworkVersion="$(MicrosoftNETCoreAppRefVersion)" /> + Version="$(MicrosoftNETCoreAppRefVersion)" /> $(MicrosoftNETCoreAppRuntimeVersion) + Condition=" '%(TargetFramework)' == '$(TargetFramework)' ">$(MicrosoftNETCoreAppRefVersion) $(MicrosoftNETCoreAppRefVersion) $(MicrosoftNETCoreAppRuntimeVersion) + '%(TargetFramework)' == '$(TargetFramework)'">$(MicrosoftNETCoreAppRefVersion) $(TargetRuntimeIdentifier) $(MicrosoftNETCoreAppRuntimeVersion) + Condition=" '%(TargetFramework)' == '$(TargetFramework)' ">$(MicrosoftNETCoreAppRefVersion) $(TargetRuntimeIdentifier) $(MicrosoftNETCoreAppRuntimeVersion) + Condition=" '%(TargetFramework)' == '$(TargetFramework)' ">$(MicrosoftNETCoreAppRefVersion) $(TargetRuntimeIdentifier) diff --git a/src/aspnetcore/eng/testing/linker/project.csproj.template b/src/aspnetcore/eng/testing/linker/project.csproj.template index ea368a6caa5..160271a57fb 100644 --- a/src/aspnetcore/eng/testing/linker/project.csproj.template +++ b/src/aspnetcore/eng/testing/linker/project.csproj.template @@ -5,7 +5,6 @@ Exe {RuntimeIdentifier} {PublishAot} - {MicrosoftNETCoreAppRuntimeVersion} {MicrosoftNETCoreAppRefVersion} {RepoRoot} diff --git a/src/aspnetcore/eng/testing/linker/trimmingTests.targets b/src/aspnetcore/eng/testing/linker/trimmingTests.targets index 1018b14a641..32235265135 100644 --- a/src/aspnetcore/eng/testing/linker/trimmingTests.targets +++ b/src/aspnetcore/eng/testing/linker/trimmingTests.targets @@ -84,7 +84,6 @@ .Replace('{TargetFramework}', '%(TestConsoleApps.TargetFramework)') .Replace('{RuntimeIdentifier}','%(TestConsoleApps.TestRuntimeIdentifier)') .Replace('{PublishAot}','$(IsNativeAotTestProject)') - .Replace('{MicrosoftNETCoreAppRuntimeVersion}','$(MicrosoftNETCoreAppRuntimeVersion)') .Replace('{MicrosoftNETCoreAppRefVersion}','$(MicrosoftNETCoreAppRefVersion)') .Replace('{RepoRoot}', '$(RepoRoot)') .Replace('{ExtraTrimmerArgs}', '%(TestConsoleApps.ExtraTrimmerArgs)') diff --git a/src/aspnetcore/eng/tools/GenerateFiles/Directory.Build.targets.in b/src/aspnetcore/eng/tools/GenerateFiles/Directory.Build.targets.in index 26dfad97a0e..fb93cb80601 100644 --- a/src/aspnetcore/eng/tools/GenerateFiles/Directory.Build.targets.in +++ b/src/aspnetcore/eng/tools/GenerateFiles/Directory.Build.targets.in @@ -54,12 +54,12 @@ + Version="${MicrosoftNETCoreAppRefVersion}" /> @@ -67,7 +67,7 @@ ${MicrosoftNETCoreAppRuntimeVersion} + Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRefVersion} ${MicrosoftNETCoreAppRefVersion} ${MicrosoftNETCoreAppRuntimeVersion} + '$(TargetLatestDotNetRuntime)' != 'false' ">${MicrosoftNETCoreAppRefVersion} %(RuntimePackRuntimeIdentifiers);$(TargetRuntimeIdentifier) ${MicrosoftNETCoreAppRuntimeVersion} + Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRefVersion} $(TargetRuntimeIdentifier) ${MicrosoftNETCoreAppRuntimeVersion} + Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRefVersion} $(TargetRuntimeIdentifier) ${MicrosoftNETCoreAppRuntimeVersion} + Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRefVersion} @@ -109,13 +109,13 @@ ${MicrosoftNETCoreAppRuntimeVersion} + Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRefVersion} %(Crossgen2RuntimeIdentifiers);$(NETCoreSdkRuntimeIdentifier);$(TargetRuntimeIdentifier) ${MicrosoftNETCoreAppRuntimeVersion} + Condition=" '%(TargetFramework)' == '${DefaultNetCoreTargetFramework}' ">${MicrosoftNETCoreAppRefVersion} diff --git a/src/aspnetcore/eng/tools/GenerateFiles/GenerateFiles.csproj b/src/aspnetcore/eng/tools/GenerateFiles/GenerateFiles.csproj index dbe1c76adde..48f57adcade 100644 --- a/src/aspnetcore/eng/tools/GenerateFiles/GenerateFiles.csproj +++ b/src/aspnetcore/eng/tools/GenerateFiles/GenerateFiles.csproj @@ -23,7 +23,6 @@ MicrosoftAspNetCoreAppRefVersion=$(TargetingPackVersion); MicrosoftAspNetCoreAppRuntimeVersion=$(SharedFxVersion); MicrosoftNETCoreAppRefVersion=$(MicrosoftNETCoreAppRefVersion); - MicrosoftNETCoreAppRuntimeVersion=$(MicrosoftNETCoreAppRuntimeVersion); MicrosoftPlaywrightCLIVersion=$(MicrosoftPlaywrightCLIVersion); LibNetHostAppPackVersion=$(BundledNETCoreAppPackageVersion); SupportedRuntimeIdentifiers=$([MSBuild]::Escape($(SupportedRuntimeIdentifiers))); diff --git a/src/aspnetcore/global.json b/src/aspnetcore/global.json index eed19039f29..2445fe6f7b1 100644 --- a/src/aspnetcore/global.json +++ b/src/aspnetcore/global.json @@ -27,9 +27,9 @@ "jdk": "latest" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25257.101", - "Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25257.101", - "Microsoft.DotNet.SharedFramework.Sdk": "10.0.0-beta.25257.101", + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25260.104", + "Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25260.104", + "Microsoft.DotNet.SharedFramework.Sdk": "10.0.0-beta.25260.104", "Microsoft.Build.NoTargets": "3.7.0", "Microsoft.Build.Traversal": "3.4.0" } diff --git a/src/aspnetcore/src/Components/Web/src/Internal/IInternalWebJSInProcessRuntime.cs b/src/aspnetcore/src/Components/Web/src/Internal/IInternalWebJSInProcessRuntime.cs index 86d91a3fb2d..a68fb052932 100644 --- a/src/aspnetcore/src/Components/Web/src/Internal/IInternalWebJSInProcessRuntime.cs +++ b/src/aspnetcore/src/Components/Web/src/Internal/IInternalWebJSInProcessRuntime.cs @@ -22,5 +22,6 @@ public interface IInternalWebJSInProcessRuntime /// /// For internal framework use only. /// - string InvokeJS(in JSInvocationInfo invocationInfo); + string InvokeJS(in JSInvocationInfo invocationInfo) + => throw new NotImplementedException(); } diff --git a/src/aspnetcore/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs b/src/aspnetcore/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs index 4023915b3f2..3da563d5bc8 100644 --- a/src/aspnetcore/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs +++ b/src/aspnetcore/src/Components/test/E2ETest/ServerRenderingTests/FormHandlingTests/FormWithParentBindingContextTest.cs @@ -1309,7 +1309,7 @@ public void CanBindToFormWithFiles() } [Theory] - [InlineData(true)] + // [InlineData(true)] QuarantinedTest: https://github.com/dotnet/aspnetcore/issues/61882 [InlineData(false)] public void CanUseFormWithMethodGet(bool suppressEnhancedNavigation) { diff --git a/src/aspnetcore/src/Framework/App.Ref/src/Microsoft.AspNetCore.App.Ref.sfxproj b/src/aspnetcore/src/Framework/App.Ref/src/Microsoft.AspNetCore.App.Ref.sfxproj index b566e2e5926..44cd40b611d 100644 --- a/src/aspnetcore/src/Framework/App.Ref/src/Microsoft.AspNetCore.App.Ref.sfxproj +++ b/src/aspnetcore/src/Framework/App.Ref/src/Microsoft.AspNetCore.App.Ref.sfxproj @@ -160,11 +160,11 @@ '%(ReferencePath.NuGetSourceType)' == 'Package' " /> - <_AspNetCoreAppPackageOverrides Include="@(ReferencePath->'%(FileName)|$(MicrosoftNETCoreAppRuntimeVersion)')" + <_AspNetCoreAppPackageOverrides Include="@(ReferencePath->'%(FileName)|$(MicrosoftNETCoreAppRefVersion)')" Condition="'%(ReferencePath.NuGetPackageId)' == 'Microsoft.Internal.Runtime.AspNetCore.Transport' AND '%(ReferencePath.NuGetSourceType)' == 'Package' " /> diff --git a/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.Composite.sfxproj b/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.Composite.sfxproj index 7bef557274c..94c4ae0f988 100644 --- a/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.Composite.sfxproj +++ b/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.Composite.sfxproj @@ -13,8 +13,8 @@ true LatestPatch - - false + + false true false diff --git a/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.sfxproj b/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.sfxproj index 294ca282e84..1a0d97f7b27 100644 --- a/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.sfxproj +++ b/src/aspnetcore/src/Framework/App.Runtime/src/Microsoft.AspNetCore.App.Runtime.sfxproj @@ -14,7 +14,7 @@ true LatestPatch - false + false true false diff --git a/src/aspnetcore/src/Framework/App.Runtime/src/aspnetcore-base-runtime.proj b/src/aspnetcore/src/Framework/App.Runtime/src/aspnetcore-base-runtime.proj index 842ba7c97d3..2f3f66312a3 100644 --- a/src/aspnetcore/src/Framework/App.Runtime/src/aspnetcore-base-runtime.proj +++ b/src/aspnetcore/src/Framework/App.Runtime/src/aspnetcore-base-runtime.proj @@ -13,7 +13,7 @@ diff --git a/src/aspnetcore/src/Framework/App.Runtime/src/aspnetcore-runtime-composite.proj b/src/aspnetcore/src/Framework/App.Runtime/src/aspnetcore-runtime-composite.proj index a63ae840d27..0bda2132bba 100644 --- a/src/aspnetcore/src/Framework/App.Runtime/src/aspnetcore-runtime-composite.proj +++ b/src/aspnetcore/src/Framework/App.Runtime/src/aspnetcore-runtime-composite.proj @@ -26,8 +26,8 @@ --> - dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-$(TargetRuntimeIdentifier).$(ArchiveFormat) - dotnet-runtime-pgo-$(MicrosoftNETCoreAppRuntimeVersion)-$(TargetRuntimeIdentifier)$(ArchiveExtension) + dotnet-runtime-$(MicrosoftNETCoreAppRefVersion)-$(TargetRuntimeIdentifier).$(ArchiveFormat) + dotnet-runtime-pgo-$(MicrosoftNETCoreAppRefVersion)-$(TargetRuntimeIdentifier)$(ArchiveExtension) Runtime/$(MicrosoftInternalRuntimeAspNetCoreTransportVersion)/$(DotNetRuntimeArchiveFileName) $(BaseIntermediateOutputPath)$(DotNetRuntimeArchiveFileName) diff --git a/src/aspnetcore/src/Framework/App.Runtime/src/aspnetcore-runtime.proj b/src/aspnetcore/src/Framework/App.Runtime/src/aspnetcore-runtime.proj index b636ddc4629..5e15187aa84 100644 --- a/src/aspnetcore/src/Framework/App.Runtime/src/aspnetcore-runtime.proj +++ b/src/aspnetcore/src/Framework/App.Runtime/src/aspnetcore-runtime.proj @@ -29,8 +29,8 @@ --> - dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-$(TargetRuntimeIdentifier).$(ArchiveFormat) - dotnet-runtime-pgo-$(MicrosoftNETCoreAppRuntimeVersion)-$(TargetRuntimeIdentifier)$(ArchiveExtension) + dotnet-runtime-$(MicrosoftNETCoreAppRefVersion)-$(TargetRuntimeIdentifier).$(ArchiveFormat) + dotnet-runtime-pgo-$(MicrosoftNETCoreAppRefVersion)-$(TargetRuntimeIdentifier)$(ArchiveExtension) Runtime/$(MicrosoftInternalRuntimeAspNetCoreTransportVersion)/$(DotNetRuntimeArchiveFileName) $(BaseIntermediateOutputPath)$(DotNetRuntimeArchiveFileName) diff --git a/src/aspnetcore/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj b/src/aspnetcore/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj index eaa52b8b613..09eeccfea52 100644 --- a/src/aspnetcore/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj +++ b/src/aspnetcore/src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj @@ -46,8 +46,8 @@ <_Parameter2>$(TargetRuntimeIdentifier) - <_Parameter1>MicrosoftNETCoreAppRuntimeVersion - <_Parameter2>$(MicrosoftNETCoreAppRuntimeVersion) + <_Parameter1>MicrosoftNETCoreAppRefVersion + <_Parameter2>$(MicrosoftNETCoreAppRefVersion) <_Parameter1>SharedFrameworkBinariesFromRepo diff --git a/src/aspnetcore/src/Framework/test/SharedFxTests.cs b/src/aspnetcore/src/Framework/test/SharedFxTests.cs index 8aed6fa3bff..5578643035b 100644 --- a/src/aspnetcore/src/Framework/test/SharedFxTests.cs +++ b/src/aspnetcore/src/Framework/test/SharedFxTests.cs @@ -96,7 +96,7 @@ public void SharedFrameworkContainsValidRuntimeConfigFile() Assert.Equal(_expectedTfm, (string)runtimeConfig["runtimeOptions"]["tfm"]); Assert.Equal("LatestPatch", (string)runtimeConfig["runtimeOptions"]["rollForward"]); - Assert.Equal(TestData.GetMicrosoftNETCoreAppPackageVersion(), (string)runtimeConfig["runtimeOptions"]["framework"]["version"]); + Assert.Equal(TestData.GetMicrosoftNETCoreAppVersion(), (string)runtimeConfig["runtimeOptions"]["framework"]["version"]); } [Fact] @@ -165,7 +165,7 @@ public void SharedFrameworkAssembliesHaveExpectedAssemblyVersions() .Split(';', StringSplitOptions.RemoveEmptyEntries) .ToHashSet(); - var versionStringWithoutPrereleaseTag = TestData.GetMicrosoftNETCoreAppPackageVersion().Split('-', 2)[0]; + var versionStringWithoutPrereleaseTag = TestData.GetMicrosoftNETCoreAppVersion().Split('-', 2)[0]; var version = Version.Parse(versionStringWithoutPrereleaseTag); var aspnetcoreVersionString = TestData.GetSharedFxVersion().Split('-', 2)[0]; var aspnetcoreVersion = Version.Parse(aspnetcoreVersionString); diff --git a/src/aspnetcore/src/Framework/test/TargetingPackTests.cs b/src/aspnetcore/src/Framework/test/TargetingPackTests.cs index 080372adb0c..bbfb80cf9c1 100644 --- a/src/aspnetcore/src/Framework/test/TargetingPackTests.cs +++ b/src/aspnetcore/src/Framework/test/TargetingPackTests.cs @@ -65,7 +65,7 @@ public void RefAssembliesHaveExpectedAssemblyVersions() .Split(';', StringSplitOptions.RemoveEmptyEntries) .ToHashSet(); - var versionStringWithoutPrereleaseTag = TestData.GetMicrosoftNETCoreAppPackageVersion().Split('-', 2)[0]; + var versionStringWithoutPrereleaseTag = TestData.GetMicrosoftNETCoreAppVersion().Split('-', 2)[0]; var version = Version.Parse(versionStringWithoutPrereleaseTag); var aspnetcoreVersionString = TestData.GetSharedFxVersion().Split('-', 2)[0]; var aspnetcoreVersion = Version.Parse(aspnetcoreVersionString); @@ -148,7 +148,7 @@ public void PackageOverridesContainsCorrectEntries() Assert.Equal(packageOverrideFileLines.Length, runtimeDependencies.Count + aspnetcoreDependencies.Count + 1); // PackageOverrides versions should remain at Major.Minor.0 while servicing. - var netCoreAppPackageVersion = TestData.GetMicrosoftNETCoreAppPackageVersion(); + var netCoreAppPackageVersion = TestData.GetMicrosoftNETCoreAppVersion(); Assert.True( NuGetVersion.TryParse(netCoreAppPackageVersion, out var parsedVersion), "MicrosoftNETCoreAppPackageVersion must be convertable to a NuGetVersion."); diff --git a/src/aspnetcore/src/Framework/test/TestData.cs b/src/aspnetcore/src/Framework/test/TestData.cs index fe88b95fcdd..6d7176d53b3 100644 --- a/src/aspnetcore/src/Framework/test/TestData.cs +++ b/src/aspnetcore/src/Framework/test/TestData.cs @@ -319,7 +319,7 @@ static TestData() public static string GetDefaultNetCoreTargetFramework() => GetTestDataValue("DefaultNetCoreTargetFramework"); - public static string GetMicrosoftNETCoreAppPackageVersion() => GetTestDataValue("MicrosoftNETCoreAppRuntimeVersion"); + public static string GetMicrosoftNETCoreAppVersion() => GetTestDataValue("MicrosoftNETCoreAppRefVersion"); public static string GetReferencePackSharedFxVersion() => GetTestDataValue("ReferencePackSharedFxVersion"); diff --git a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/IValidatableInfo.cs b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/IValidatableInfo.cs index 91766f69cfc..d2a7ccd1fbc 100644 --- a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/IValidatableInfo.cs +++ b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/IValidatableInfo.cs @@ -1,11 +1,14 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; + namespace Microsoft.AspNetCore.Http.Validation; /// /// Represents an interface for validating a value. /// +[Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public interface IValidatableInfo { /// diff --git a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/IValidatableInfoResolver.cs b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/IValidatableInfoResolver.cs index b4d4abe31c2..80a2f0d0d74 100644 --- a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/IValidatableInfoResolver.cs +++ b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/IValidatableInfoResolver.cs @@ -10,6 +10,7 @@ namespace Microsoft.AspNetCore.Http.Validation; /// Provides an interface for resolving the validation information associated /// with a given or . /// +[Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public interface IValidatableInfoResolver { /// diff --git a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/RuntimeValidatableParameterInfoResolver.cs b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/RuntimeValidatableParameterInfoResolver.cs index e2d3e6ffc5c..0728c3ac8b8 100644 --- a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/RuntimeValidatableParameterInfoResolver.cs +++ b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/RuntimeValidatableParameterInfoResolver.cs @@ -1,3 +1,5 @@ +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. diff --git a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableParameterInfo.cs b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableParameterInfo.cs index 58895fc0001..9fba8ab854b 100644 --- a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableParameterInfo.cs +++ b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableParameterInfo.cs @@ -4,12 +4,14 @@ using System.Collections; using System.ComponentModel.DataAnnotations; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; namespace Microsoft.AspNetCore.Http.Validation; /// /// Contains validation information for a parameter. /// +[Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public abstract class ValidatableParameterInfo : IValidatableInfo { private RequiredAttribute? _requiredAttribute; diff --git a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatablePropertyInfo.cs b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatablePropertyInfo.cs index f6dfe94e688..167d5450046 100644 --- a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatablePropertyInfo.cs +++ b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatablePropertyInfo.cs @@ -10,6 +10,7 @@ namespace Microsoft.AspNetCore.Http.Validation; /// /// Contains validation information for a member of a type. /// +[Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public abstract class ValidatablePropertyInfo : IValidatableInfo { private RequiredAttribute? _requiredAttribute; diff --git a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableTypeAttribute.cs b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableTypeAttribute.cs index 0ea382c59a5..a36402ecc40 100644 --- a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableTypeAttribute.cs +++ b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableTypeAttribute.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Diagnostics.CodeAnalysis; + namespace Microsoft.AspNetCore.Http.Validation; /// @@ -8,6 +10,7 @@ namespace Microsoft.AspNetCore.Http.Validation; /// validations generator. /// [AttributeUsage(AttributeTargets.Class)] +[Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public sealed class ValidatableTypeAttribute : Attribute { } diff --git a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableTypeInfo.cs b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableTypeInfo.cs index a20f0ec8a80..82ae03465f9 100644 --- a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableTypeInfo.cs +++ b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidatableTypeInfo.cs @@ -11,6 +11,7 @@ namespace Microsoft.AspNetCore.Http.Validation; /// /// Contains validation information for a type. /// +[Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public abstract class ValidatableTypeInfo : IValidatableInfo { private readonly int _membersCount; diff --git a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidateContext.cs b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidateContext.cs index a78ca7cabfb..3e02c35a472 100644 --- a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidateContext.cs +++ b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidateContext.cs @@ -2,12 +2,14 @@ // The .NET Foundation licenses this file to you under the MIT license. using System.ComponentModel.DataAnnotations; +using System.Diagnostics.CodeAnalysis; namespace Microsoft.AspNetCore.Http.Validation; /// /// Represents the context for validating a validatable object. /// +[Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public sealed class ValidateContext { /// diff --git a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidationOptions.cs b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidationOptions.cs index d27ba37eaf1..dc83ce9282a 100644 --- a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidationOptions.cs +++ b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidationOptions.cs @@ -19,6 +19,7 @@ public class ValidationOptions /// Source-generated resolvers are typically inserted at the beginning of this list /// to ensure they are checked before any runtime-based resolvers. /// + [Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public IList Resolvers { get; } = []; /// @@ -35,6 +36,7 @@ public class ValidationOptions /// When this method returns, contains the validation information for the specified type, /// if the type was found; otherwise, null. /// true if validation information was found for the specified type; otherwise, false. + [Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public bool TryGetValidatableTypeInfo(Type type, [NotNullWhen(true)] out IValidatableInfo? validatableTypeInfo) { foreach (var resolver in Resolvers) @@ -56,6 +58,7 @@ public bool TryGetValidatableTypeInfo(Type type, [NotNullWhen(true)] out IValida /// When this method returns, contains the validation information for the specified parameter, /// if validation information was found; otherwise, null. /// true if validation information was found for the specified parameter; otherwise, false. + [Experimental("ASP0029", UrlFormat = "https://aka.ms/aspnet/analyzer/{0}")] public bool TryGetValidatableParameterInfo(ParameterInfo parameterInfo, [NotNullWhen(true)] out IValidatableInfo? validatableInfo) { foreach (var resolver in Resolvers) diff --git a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidationServiceCollectionExtensions.cs b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidationServiceCollectionExtensions.cs index 77a128842ea..bc4f6a77aba 100644 --- a/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidationServiceCollectionExtensions.cs +++ b/src/aspnetcore/src/Http/Http.Abstractions/src/Validation/ValidationServiceCollectionExtensions.cs @@ -25,7 +25,9 @@ public static IServiceCollection AddValidation(this IServiceCollection services, configureOptions(options); } // Support ParameterInfo resolution at runtime +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. options.Resolvers.Add(new RuntimeValidatableParameterInfoResolver()); +#pragma warning restore ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. }); return services; } diff --git a/src/aspnetcore/src/Http/Http.Abstractions/test/Validation/ValidatableInfoResolverTests.cs b/src/aspnetcore/src/Http/Http.Abstractions/test/Validation/ValidatableInfoResolverTests.cs index 6960162a13c..ab197cf6fde 100644 --- a/src/aspnetcore/src/Http/Http.Abstractions/test/Validation/ValidatableInfoResolverTests.cs +++ b/src/aspnetcore/src/Http/Http.Abstractions/test/Validation/ValidatableInfoResolverTests.cs @@ -1,3 +1,5 @@ +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. diff --git a/src/aspnetcore/src/Http/Http.Abstractions/test/Validation/ValidatableParameterInfoTests.cs b/src/aspnetcore/src/Http/Http.Abstractions/test/Validation/ValidatableParameterInfoTests.cs index c89f182c92f..e10614b2b19 100644 --- a/src/aspnetcore/src/Http/Http.Abstractions/test/Validation/ValidatableParameterInfoTests.cs +++ b/src/aspnetcore/src/Http/Http.Abstractions/test/Validation/ValidatableParameterInfoTests.cs @@ -1,3 +1,5 @@ +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. diff --git a/src/aspnetcore/src/Http/Http.Abstractions/test/Validation/ValidatableTypeInfoTests.cs b/src/aspnetcore/src/Http/Http.Abstractions/test/Validation/ValidatableTypeInfoTests.cs index 2a4c82e704e..98e74bd9d32 100644 --- a/src/aspnetcore/src/Http/Http.Abstractions/test/Validation/ValidatableTypeInfoTests.cs +++ b/src/aspnetcore/src/Http/Http.Abstractions/test/Validation/ValidatableTypeInfoTests.cs @@ -1,3 +1,5 @@ +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. diff --git a/src/aspnetcore/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Emitters/ValidationsGenerator.Emitter.cs b/src/aspnetcore/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Emitters/ValidationsGenerator.Emitter.cs index 73a0271eee8..b929819c591 100644 --- a/src/aspnetcore/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Emitters/ValidationsGenerator.Emitter.cs +++ b/src/aspnetcore/src/Http/Http.Extensions/gen/Microsoft.AspNetCore.Http.ValidationsGenerator/Emitters/ValidationsGenerator.Emitter.cs @@ -37,6 +37,7 @@ private static string Emit(InterceptableLocation addValidation, ImmutableArray //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGenerator.ValidatableType.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGenerator.ValidatableType.cs index 4628c957400..0ddc3613249 100644 --- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGenerator.ValidatableType.cs +++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGenerator.ValidatableType.cs @@ -1,3 +1,5 @@ +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. @@ -12,6 +14,8 @@ public partial class ValidationsGeneratorTests : ValidationsGeneratorTestBase public async Task CanValidateTypesWithAttribute() { var source = """ +#pragma warning disable ASP0029 + using System; using System.ComponentModel.DataAnnotations; using System.Collections.Generic; @@ -374,4 +378,4 @@ async Task ValidInputProducesNoWarnings(IValidatableInfo validatableInfo) } }); } -} \ No newline at end of file +} diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGeneratorTestBase.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGeneratorTestBase.cs index 2310c2c3aaf..bb1cd12470d 100644 --- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGeneratorTestBase.cs +++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/ValidationsGeneratorTestBase.cs @@ -1,3 +1,5 @@ +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateComplexTypes#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateComplexTypes#ValidatableInfoResolver.g.verified.cs index 16e4957dd2a..046365541ef 100644 --- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateComplexTypes#ValidatableInfoResolver.g.verified.cs +++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateComplexTypes#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateIValidatableObject#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateIValidatableObject#ValidatableInfoResolver.g.verified.cs index 82b35b51711..5babdce85f2 100644 --- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateIValidatableObject#ValidatableInfoResolver.g.verified.cs +++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateIValidatableObject#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateParameters#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateParameters#ValidatableInfoResolver.g.verified.cs index 2c1052c8f20..ddd57a0dc8b 100644 --- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateParameters#ValidatableInfoResolver.g.verified.cs +++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateParameters#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidatePolymorphicTypes#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidatePolymorphicTypes#ValidatableInfoResolver.g.verified.cs index 9549ef31387..d435bf7996f 100644 --- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidatePolymorphicTypes#ValidatableInfoResolver.g.verified.cs +++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidatePolymorphicTypes#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecordTypes#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecordTypes#ValidatableInfoResolver.g.verified.cs index 4c0a1096349..2a5085a534a 100644 --- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecordTypes#ValidatableInfoResolver.g.verified.cs +++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecordTypes#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecursiveTypes#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecursiveTypes#ValidatableInfoResolver.g.verified.cs index 3b04d8843a8..7fb61484070 100644 --- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecursiveTypes#ValidatableInfoResolver.g.verified.cs +++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateRecursiveTypes#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypeWithParsableProperties#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypeWithParsableProperties#ValidatableInfoResolver.g.verified.cs index 7eea5401c9c..03f94852185 100644 --- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypeWithParsableProperties#ValidatableInfoResolver.g.verified.cs +++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypeWithParsableProperties#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypesWithAttribute#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypesWithAttribute#ValidatableInfoResolver.g.verified.cs index aa1862d646c..75c87732a0d 100644 --- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypesWithAttribute#ValidatableInfoResolver.g.verified.cs +++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.CanValidateTypesWithAttribute#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.DoesNotEmitForExemptTypes#ValidatableInfoResolver.g.verified.cs b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.DoesNotEmitForExemptTypes#ValidatableInfoResolver.g.verified.cs index d67637d110a..c5a4eb4152b 100644 --- a/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.DoesNotEmitForExemptTypes#ValidatableInfoResolver.g.verified.cs +++ b/src/aspnetcore/src/Http/Http.Extensions/test/ValidationsGenerator/snapshots/ValidationsGeneratorTests.DoesNotEmitForExemptTypes#ValidatableInfoResolver.g.verified.cs @@ -9,6 +9,7 @@ // //------------------------------------------------------------------------------ #nullable enable +#pragma warning disable ASP0029 namespace System.Runtime.CompilerServices { diff --git a/src/aspnetcore/src/Http/Http/perf/Microbenchmarks/ValidatableTypesBenchmark.cs b/src/aspnetcore/src/Http/Http/perf/Microbenchmarks/ValidatableTypesBenchmark.cs index 75abf445ec3..973d22ed067 100644 --- a/src/aspnetcore/src/Http/Http/perf/Microbenchmarks/ValidatableTypesBenchmark.cs +++ b/src/aspnetcore/src/Http/Http/perf/Microbenchmarks/ValidatableTypesBenchmark.cs @@ -1,3 +1,5 @@ +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. diff --git a/src/aspnetcore/src/Http/Routing/src/RouteEndpointDataSource.cs b/src/aspnetcore/src/Http/Routing/src/RouteEndpointDataSource.cs index 59bcd699a59..cbdac85e3e8 100644 --- a/src/aspnetcore/src/Http/Routing/src/RouteEndpointDataSource.cs +++ b/src/aspnetcore/src/Http/Routing/src/RouteEndpointDataSource.cs @@ -239,7 +239,9 @@ private RouteEndpointBuilder CreateRouteEndpointBuilder( // Initialize this route endpoint builder with validation convention if validation options // are registered and validation is not disabled on the endpoint. +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. var hasValidationResolvers = builder.ApplicationServices.GetService>() is { Value: { } options } && options.Resolvers.Count > 0; +#pragma warning restore ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. var hasDisableValidationMetadata = builder.Metadata.OfType().FirstOrDefault() is not null; if (hasValidationResolvers && !hasDisableValidationMetadata) { diff --git a/src/aspnetcore/src/Http/Routing/src/ValidationEndpointFilterFactory.cs b/src/aspnetcore/src/Http/Routing/src/ValidationEndpointFilterFactory.cs index 0e75ea640fa..bd9b841fd55 100644 --- a/src/aspnetcore/src/Http/Routing/src/ValidationEndpointFilterFactory.cs +++ b/src/aspnetcore/src/Http/Routing/src/ValidationEndpointFilterFactory.cs @@ -1,3 +1,5 @@ +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. + // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. diff --git a/src/aspnetcore/src/Http/samples/MinimalValidationSample/Program.cs b/src/aspnetcore/src/Http/samples/MinimalValidationSample/Program.cs index 91be84ed097..9afcebfb2b0 100644 --- a/src/aspnetcore/src/Http/samples/MinimalValidationSample/Program.cs +++ b/src/aspnetcore/src/Http/samples/MinimalValidationSample/Program.cs @@ -26,7 +26,9 @@ app.Run(); // Define validatable types with the ValidatableType attribute +#pragma warning disable ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. [ValidatableType] +#pragma warning restore ASP0029 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. public class Customer { [Required] diff --git a/src/aspnetcore/src/Installers/Windows/WindowsHostingBundle/Product.targets b/src/aspnetcore/src/Installers/Windows/WindowsHostingBundle/Product.targets index 192e36b9583..c4c54cae812 100644 --- a/src/aspnetcore/src/Installers/Windows/WindowsHostingBundle/Product.targets +++ b/src/aspnetcore/src/Installers/Windows/WindowsHostingBundle/Product.targets @@ -7,31 +7,31 @@ - + DotNetRedistLtsInstallerx64 - + DotNetRedistLtsInstallerx86 - + DotNetRedistLtsInstallerarm64 - + DotNetRedistHostInstallerx64 - + DotNetRedistHostInstallerx86 - + DotNetRedistHostInstallerarm64 - + DotNetRedistHostfxrInstallerx64 - + DotNetRedistHostfxrInstallerx86 - + DotNetRedistHostfxrInstallerarm64 @@ -43,32 +43,32 @@ - - dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi + + dotnet-runtime-$(MicrosoftNETCoreAppRefVersion)-win-x64.msi - - dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi + + dotnet-runtime-$(MicrosoftNETCoreAppRefVersion)-win-x86.msi - - dotnet-runtime-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi + + dotnet-runtime-$(MicrosoftNETCoreAppRefVersion)-win-arm64.msi - - dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi + + dotnet-host-$(MicrosoftNETCoreAppRefVersion)-win-x64.msi - - dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi + + dotnet-host-$(MicrosoftNETCoreAppRefVersion)-win-x86.msi - - dotnet-host-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi + + dotnet-host-$(MicrosoftNETCoreAppRefVersion)-win-arm64.msi - - dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-x64.msi + + dotnet-hostfxr-$(MicrosoftNETCoreAppRefVersion)-win-x64.msi - - dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-x86.msi + + dotnet-hostfxr-$(MicrosoftNETCoreAppRefVersion)-win-x86.msi - - dotnet-hostfxr-$(MicrosoftNETCoreAppRuntimeVersion)-win-arm64.msi + + dotnet-hostfxr-$(MicrosoftNETCoreAppRefVersion)-win-arm64.msi diff --git a/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/IJSInProcessObjectReference.cs b/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/IJSInProcessObjectReference.cs index 39f376a1195..d9813f0ddcd 100644 --- a/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/IJSInProcessObjectReference.cs +++ b/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/IJSInProcessObjectReference.cs @@ -28,7 +28,8 @@ public interface IJSInProcessObjectReference : IJSObjectReference, IDisposable /// JSON-serializable arguments. /// An instance that represents the created JS object. [RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed.")] - IJSInProcessObjectReference InvokeNew(string identifier, object?[]? args); + IJSInProcessObjectReference InvokeNew(string identifier, object?[]? args) + => throw new NotImplementedException(); /// /// Reads the value of the specified JavaScript property synchronously. @@ -37,7 +38,8 @@ public interface IJSInProcessObjectReference : IJSObjectReference, IDisposable /// An identifier for the property to read. For example, the value "someScope.someProp" will read the value of the property window.someScope.someProp. /// An instance of obtained by JSON-deserializing the return value. [RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed.")] - TValue GetValue<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier); + TValue GetValue<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier) + => throw new NotImplementedException(); /// /// Updates the value of the specified JavaScript property synchronously. If the property is not defined on the target object, it will be created. @@ -46,5 +48,6 @@ public interface IJSInProcessObjectReference : IJSObjectReference, IDisposable /// An identifier for the property to set. For example, the value "someScope.someProp" will update the property window.someScope.someProp. /// JSON-serializable value. [RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed.")] - void SetValue<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, TValue value); + void SetValue<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, TValue value) + => throw new NotImplementedException(); } diff --git a/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/IJSInProcessRuntime.cs b/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/IJSInProcessRuntime.cs index ed1ea479c8d..cf3954ce026 100644 --- a/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/IJSInProcessRuntime.cs +++ b/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/IJSInProcessRuntime.cs @@ -28,7 +28,8 @@ public interface IJSInProcessRuntime : IJSRuntime /// JSON-serializable arguments. /// An instance that represents the created JS object. [RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed.")] - IJSInProcessObjectReference InvokeNew(string identifier, params object?[]? args); + IJSInProcessObjectReference InvokeNew(string identifier, params object?[]? args) + => throw new NotImplementedException(); /// /// Reads the value of the specified JavaScript property synchronously. @@ -37,7 +38,8 @@ public interface IJSInProcessRuntime : IJSRuntime /// An identifier for the property to read. For example, the value "someScope.someProp" will read the value of the property window.someScope.someProp. /// An instance of obtained by JSON-deserializing the return value. [RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed.")] - TValue GetValue<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier); + TValue GetValue<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier) + => throw new NotImplementedException(); /// /// Updates the value of the specified JavaScript property synchronously. If the property is not defined on the target object, it will be created. @@ -46,5 +48,6 @@ public interface IJSInProcessRuntime : IJSRuntime /// An identifier for the property to set. For example, the value "someScope.someProp" will update the property window.someScope.someProp. /// JSON-serializable value. [RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed.")] - void SetValue<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, TValue value); + void SetValue<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, TValue value) + => throw new NotImplementedException(); } diff --git a/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/IJSObjectReference.cs b/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/IJSObjectReference.cs index 30df4c46d23..cb8cc03329d 100644 --- a/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/IJSObjectReference.cs +++ b/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/IJSObjectReference.cs @@ -43,7 +43,8 @@ public interface IJSObjectReference : IAsyncDisposable /// An identifier for the constructor function to invoke. For example, the value "someScope.SomeClass" will invoke the constructor someScope.SomeClass on the target instance. /// JSON-serializable arguments. /// An instance that represents the created JS object. - ValueTask InvokeNewAsync(string identifier, object?[]? args); + ValueTask InvokeNewAsync(string identifier, object?[]? args) + => throw new NotImplementedException(); /// /// Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the new operator. @@ -55,7 +56,8 @@ public interface IJSObjectReference : IAsyncDisposable /// /// JSON-serializable arguments. /// An instance that represents the created JS object. - ValueTask InvokeNewAsync(string identifier, CancellationToken cancellationToken, object?[]? args); + ValueTask InvokeNewAsync(string identifier, CancellationToken cancellationToken, object?[]? args) + => throw new NotImplementedException(); /// /// Reads the value of the specified JavaScript property asynchronously. @@ -63,7 +65,8 @@ public interface IJSObjectReference : IAsyncDisposable /// The JSON-serializable return type. /// An identifier for the property to read. For example, the value "someScope.someProp" will read the value of the property someScope.someProp on the target instance. /// An instance of obtained by JSON-deserializing the return value. - ValueTask GetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier); + ValueTask GetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier) + => throw new NotImplementedException(); /// /// Reads the value of the specified JavaScript property asynchronously. @@ -75,7 +78,8 @@ public interface IJSObjectReference : IAsyncDisposable /// () from being applied. /// /// An instance of obtained by JSON-deserializing the return value. - ValueTask GetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, CancellationToken cancellationToken); + ValueTask GetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, CancellationToken cancellationToken) + => throw new NotImplementedException(); /// /// Updates the value of the specified JavaScript property asynchronously. If the property is not defined on the target object, it will be created. @@ -84,7 +88,8 @@ public interface IJSObjectReference : IAsyncDisposable /// An identifier for the property to set. For example, the value "someScope.someProp" will update the property someScope.someProp on the target instance. /// JSON-serializable value. /// A that represents the asynchronous invocation operation. - ValueTask SetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, TValue value); + ValueTask SetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, TValue value) + => throw new NotImplementedException(); /// /// Updates the value of the specified JavaScript property asynchronously. If the property is not defined on the target object, it will be created. @@ -97,5 +102,6 @@ public interface IJSObjectReference : IAsyncDisposable /// () from being applied. /// /// A that represents the asynchronous invocation operation. - ValueTask SetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, TValue value, CancellationToken cancellationToken); + ValueTask SetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, TValue value, CancellationToken cancellationToken) + => throw new NotImplementedException(); } diff --git a/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/IJSRuntime.cs b/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/IJSRuntime.cs index 0050c357c49..b897245c0da 100644 --- a/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/IJSRuntime.cs +++ b/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/IJSRuntime.cs @@ -43,7 +43,8 @@ public interface IJSRuntime /// An identifier for the constructor function to invoke. For example, the value "someScope.SomeClass" will invoke the constructor window.someScope.SomeClass. /// JSON-serializable arguments. /// An instance that represents the created JS object. - ValueTask InvokeNewAsync(string identifier, object?[]? args); + ValueTask InvokeNewAsync(string identifier, object?[]? args) + => throw new NotImplementedException(); /// /// Invokes the specified JavaScript constructor function asynchronously. The function is invoked with the new operator. @@ -55,7 +56,8 @@ public interface IJSRuntime /// /// JSON-serializable arguments. /// An instance that represents the created JS object. - ValueTask InvokeNewAsync(string identifier, CancellationToken cancellationToken, object?[]? args); + ValueTask InvokeNewAsync(string identifier, CancellationToken cancellationToken, object?[]? args) + => throw new NotImplementedException(); /// /// Reads the value of the specified JavaScript property asynchronously. @@ -63,7 +65,8 @@ public interface IJSRuntime /// The JSON-serializable return type. /// An identifier for the property to read. For example, the value "someScope.someProp" will read the value of the property window.someScope.someProp. /// An instance of obtained by JSON-deserializing the return value. - ValueTask GetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier); + ValueTask GetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier) + => throw new NotImplementedException(); /// /// Reads the value of the specified JavaScript property asynchronously. @@ -75,7 +78,8 @@ public interface IJSRuntime /// () from being applied. /// /// An instance of obtained by JSON-deserializing the return value. - ValueTask GetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, CancellationToken cancellationToken); + ValueTask GetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, CancellationToken cancellationToken) + => throw new NotImplementedException(); /// /// Updates the value of the specified JavaScript property asynchronously. If the property is not defined on the target object, it will be created. @@ -84,7 +88,8 @@ public interface IJSRuntime /// An identifier for the property to set. For example, the value "someScope.someProp" will update the property window.someScope.someProp. /// JSON-serializable value. /// A that represents the asynchronous invocation operation. - ValueTask SetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, TValue value); + ValueTask SetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, TValue value) + => throw new NotImplementedException(); /// /// Updates the value of the specified JavaScript property asynchronously. If the property is not defined on the target object, it will be created. @@ -97,5 +102,6 @@ public interface IJSRuntime /// () from being applied. /// /// A that represents the asynchronous invocation operation. - ValueTask SetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, TValue value, CancellationToken cancellationToken); + ValueTask SetValueAsync<[DynamicallyAccessedMembers(JsonSerialized)] TValue>(string identifier, TValue value, CancellationToken cancellationToken) + => throw new NotImplementedException(); } diff --git a/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/JSInProcessRuntime.cs b/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/JSInProcessRuntime.cs index 5c8a73b29cd..2bcc5fa729b 100644 --- a/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/JSInProcessRuntime.cs +++ b/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/JSInProcessRuntime.cs @@ -81,7 +81,8 @@ public IJSInProcessObjectReference InvokeNew(string identifier, params object?[] => InvokeJS(identifier, argsJson, JSCallResultType.Default, WindowObjectId); /// - /// Performs a synchronous function invocation. + /// Performs a synchronous function invocation with the call type . + /// For more configuration options, use the overload . /// /// The identifier for the function to invoke. /// A JSON representation of the arguments. @@ -95,5 +96,8 @@ public IJSInProcessObjectReference InvokeNew(string identifier, params object?[] /// /// Configuration of the interop call. /// A JSON representation of the result. - protected abstract string? InvokeJS(in JSInvocationInfo invocationInfo); + protected virtual string? InvokeJS(in JSInvocationInfo invocationInfo) + { + return InvokeJS(invocationInfo.Identifier, invocationInfo.ArgsJson, invocationInfo.ResultType, invocationInfo.TargetInstanceId); + } } diff --git a/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/JSRuntime.cs b/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/JSRuntime.cs index a970c790097..f91746f99f5 100644 --- a/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/JSRuntime.cs +++ b/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/JSRuntime.cs @@ -192,7 +192,8 @@ protected virtual void BeginInvokeJS(long taskId, string identifier, [StringSynt => BeginInvokeJS(taskId, identifier, argsJson, JSCallResultType.Default, WindowObjectId); /// - /// Begins an asynchronous function invocation. + /// Begins an asynchronous function invocation with the call type . + /// For more configuration options, use the overload . /// /// The identifier for the function invocation, or zero if no async callback is required. /// The identifier for the function to invoke. @@ -205,7 +206,10 @@ protected virtual void BeginInvokeJS(long taskId, string identifier, [StringSynt /// Begins an asynchronous function invocation. /// /// Configuration of the interop call from .NET to JavaScript. - protected abstract void BeginInvokeJS(in JSInvocationInfo invocationInfo); + protected virtual void BeginInvokeJS(in JSInvocationInfo invocationInfo) + { + BeginInvokeJS(invocationInfo.AsyncHandle, invocationInfo.Identifier, invocationInfo.ArgsJson, invocationInfo.ResultType, invocationInfo.TargetInstanceId); + } /// /// Completes an async JS interop call from JavaScript to .NET diff --git a/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/PublicAPI.Unshipped.txt b/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/PublicAPI.Unshipped.txt index 3270d74b01a..b6c32d82699 100644 --- a/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/PublicAPI.Unshipped.txt +++ b/src/aspnetcore/src/JSInterop/Microsoft.JSInterop/src/PublicAPI.Unshipped.txt @@ -1,6 +1,4 @@ #nullable enable -abstract Microsoft.JSInterop.JSInProcessRuntime.InvokeJS(in Microsoft.JSInterop.Infrastructure.JSInvocationInfo invocationInfo) -> string? -abstract Microsoft.JSInterop.JSRuntime.BeginInvokeJS(in Microsoft.JSInterop.Infrastructure.JSInvocationInfo invocationInfo) -> void Microsoft.JSInterop.IJSInProcessObjectReference.GetValue(string! identifier) -> TValue Microsoft.JSInterop.IJSInProcessObjectReference.InvokeNew(string! identifier, object?[]? args) -> Microsoft.JSInterop.IJSInProcessObjectReference! Microsoft.JSInterop.IJSInProcessObjectReference.SetValue(string! identifier, TValue value) -> void @@ -62,3 +60,5 @@ static Microsoft.JSInterop.JSObjectReferenceExtensions.InvokeNewAsync(this Micro static Microsoft.JSInterop.JSRuntimeExtensions.InvokeNewAsync(this Microsoft.JSInterop.IJSRuntime! jsRuntime, string! identifier, params object?[]? args) -> System.Threading.Tasks.ValueTask static Microsoft.JSInterop.JSRuntimeExtensions.InvokeNewAsync(this Microsoft.JSInterop.IJSRuntime! jsRuntime, string! identifier, System.Threading.CancellationToken cancellationToken, object?[]? args) -> System.Threading.Tasks.ValueTask static Microsoft.JSInterop.JSRuntimeExtensions.InvokeNewAsync(this Microsoft.JSInterop.IJSRuntime! jsRuntime, string! identifier, System.TimeSpan timeout, object?[]? args) -> System.Threading.Tasks.ValueTask +virtual Microsoft.JSInterop.JSInProcessRuntime.InvokeJS(in Microsoft.JSInterop.Infrastructure.JSInvocationInfo invocationInfo) -> string? +virtual Microsoft.JSInterop.JSRuntime.BeginInvokeJS(in Microsoft.JSInterop.Infrastructure.JSInvocationInfo invocationInfo) -> void diff --git a/src/aspnetcore/src/Middleware/RequestDecompression/src/RequestDecompressionMiddleware.cs b/src/aspnetcore/src/Middleware/RequestDecompression/src/RequestDecompressionMiddleware.cs index 71cd050492c..3f7c99368e8 100644 --- a/src/aspnetcore/src/Middleware/RequestDecompression/src/RequestDecompressionMiddleware.cs +++ b/src/aspnetcore/src/Middleware/RequestDecompression/src/RequestDecompressionMiddleware.cs @@ -62,7 +62,9 @@ private async Task InvokeCore(HttpContext context, Stream decompressionStream) context.GetEndpoint()?.Metadata?.GetMetadata()?.MaxRequestBodySize ?? context.Features.Get()?.MaxRequestBodySize; - context.Request.Body = new SizeLimitedStream(decompressionStream, sizeLimit); + context.Request.Body = new SizeLimitedStream(decompressionStream, sizeLimit, static (long sizeLimit) => throw new BadHttpRequestException( + $"The decompressed request body is larger than the request body size limit {sizeLimit}.", + StatusCodes.Status413PayloadTooLarge)); await _next(context); } finally diff --git a/src/aspnetcore/src/Middleware/RequestDecompression/test/RequestDecompressionMiddlewareTests.cs b/src/aspnetcore/src/Middleware/RequestDecompression/test/RequestDecompressionMiddlewareTests.cs index 0a612fca853..54e0c685adc 100644 --- a/src/aspnetcore/src/Middleware/RequestDecompression/test/RequestDecompressionMiddlewareTests.cs +++ b/src/aspnetcore/src/Middleware/RequestDecompression/test/RequestDecompressionMiddlewareTests.cs @@ -499,8 +499,8 @@ public async Task Endpoint_HasRequestSizeLimit_UsedForRequest(bool exceedsLimit) if (exceedsLimit) { Assert.NotNull(exception); - Assert.IsAssignableFrom(exception); - Assert.Equal("The maximum number of bytes have been read.", exception.Message); + Assert.IsAssignableFrom(exception); + Assert.Equal(StatusCodes.Status413PayloadTooLarge, ((BadHttpRequestException)exception).StatusCode); } else { @@ -583,8 +583,8 @@ public async Task Feature_HasRequestSizeLimit_UsedForRequest(bool exceedsLimit) if (exceedsLimit) { Assert.NotNull(exception); - Assert.IsAssignableFrom(exception); - Assert.Equal("The maximum number of bytes have been read.", exception.Message); + Assert.IsAssignableFrom(exception); + Assert.Equal(StatusCodes.Status413PayloadTooLarge, ((BadHttpRequestException)exception).StatusCode); } else { diff --git a/src/aspnetcore/src/ProjectTemplates/README.md b/src/aspnetcore/src/ProjectTemplates/README.md index 9fb481dee3e..7d34c1a26a2 100644 --- a/src/aspnetcore/src/ProjectTemplates/README.md +++ b/src/aspnetcore/src/ProjectTemplates/README.md @@ -97,7 +97,7 @@ An entire test project can be configured to skip specific platforms using the `< ```xml - $(HelixQueueArmDebian12); + $(HelixQueueArmDebian); ``` @@ -109,7 +109,7 @@ When tests are run as part of the CI infrastructure, a number of different timeo ##### Helix job timeout -When queuing test jobs to the Helix infrastructure, a timeout value is passed that the entire Helix job must complete within, i.e. that job running on a single queue. This default value is set in [eng\targets\Helix.props](/eng/targets/Helix.props): +When queuing test jobs to the Helix infrastructure, a timeout value is passed that the entire Helix job must complete within, i.e. that job running on a single queue. This default value is set in [eng\targets\Helix.props](/eng/targets/Helix.props): ```xml 00:45:00 diff --git a/src/aspnetcore/src/ProjectTemplates/Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj b/src/aspnetcore/src/ProjectTemplates/Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj index 01fd5e06eaf..505dff2b9a6 100644 --- a/src/aspnetcore/src/ProjectTemplates/Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj +++ b/src/aspnetcore/src/ProjectTemplates/Web.ProjectTemplates/Microsoft.DotNet.Web.ProjectTemplates.csproj @@ -23,7 +23,6 @@ MicrosoftIdentityWebGraphServiceClientVersion=$(MicrosoftIdentityWebGraphServiceClientVersion); MicrosoftIdentityWebUIVersion=$(MicrosoftIdentityWebUIVersion); MicrosoftIdentityWebDownstreamApiVersion=$(MicrosoftIdentityWebDownstreamApiVersion); - MicrosoftNETCoreAppRuntimeVersion=$(MicrosoftNETCoreAppRuntimeVersion); SystemNetHttpJsonVersion=$(SystemNetHttpJsonVersion); MicrosoftGraphVersion=$(MicrosoftGraphVersion); diff --git a/src/aspnetcore/src/ProjectTemplates/test/Templates.Mvc.Tests/Templates.Mvc.Tests.csproj b/src/aspnetcore/src/ProjectTemplates/test/Templates.Mvc.Tests/Templates.Mvc.Tests.csproj index e9371e45210..e4150c38bcd 100644 --- a/src/aspnetcore/src/ProjectTemplates/test/Templates.Mvc.Tests/Templates.Mvc.Tests.csproj +++ b/src/aspnetcore/src/ProjectTemplates/test/Templates.Mvc.Tests/Templates.Mvc.Tests.csproj @@ -27,9 +27,9 @@ - $(HelixQueueArmDebian12); - $(HelixQueueDebian12); - $(HelixQueueMariner); + $(HelixQueueArmDebian); + $(HelixQueueAzureLinux); + $(HelixQueueDebian); $(SkipHelixQueues) diff --git a/src/aspnetcore/src/Shared/SizeLimitedStream.cs b/src/aspnetcore/src/Shared/SizeLimitedStream.cs index 6ee758e57de..4d249a36b36 100644 --- a/src/aspnetcore/src/Shared/SizeLimitedStream.cs +++ b/src/aspnetcore/src/Shared/SizeLimitedStream.cs @@ -1,19 +1,22 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +#nullable enable + internal sealed class SizeLimitedStream : Stream { private readonly Stream _innerStream; private readonly long? _sizeLimit; - + private readonly Action? _handleSizeLimit; private long _totalBytesRead; - public SizeLimitedStream(Stream innerStream, long? sizeLimit) + public SizeLimitedStream(Stream innerStream, long? sizeLimit, Action? handleSizeLimit = null) { ArgumentNullException.ThrowIfNull(innerStream); _innerStream = innerStream; _sizeLimit = sizeLimit; + _handleSizeLimit = handleSizeLimit; } public override bool CanRead => _innerStream.CanRead; @@ -48,7 +51,14 @@ public override int Read(byte[] buffer, int offset, int count) _totalBytesRead += bytesRead; if (_totalBytesRead > _sizeLimit) { - throw new InvalidOperationException("The maximum number of bytes have been read."); + if (_handleSizeLimit != null) + { + _handleSizeLimit(_sizeLimit.Value); + } + else + { + throw new InvalidOperationException("The maximum number of bytes have been read."); + } } return bytesRead; @@ -81,7 +91,14 @@ public override async ValueTask ReadAsync(Memory buffer, Cancellation _totalBytesRead += bytesRead; if (_totalBytesRead > _sizeLimit) { - throw new InvalidOperationException("The maximum number of bytes have been read."); + if (_handleSizeLimit != null) + { + _handleSizeLimit(_sizeLimit.Value); + } + else + { + throw new InvalidOperationException("The maximum number of bytes have been read."); + } } return bytesRead; diff --git a/src/aspnetcore/src/SiteExtensions/LoggingBranch/LB.csproj b/src/aspnetcore/src/SiteExtensions/LoggingBranch/LB.csproj index 09810fa61d3..d3308c748de 100644 --- a/src/aspnetcore/src/SiteExtensions/LoggingBranch/LB.csproj +++ b/src/aspnetcore/src/SiteExtensions/LoggingBranch/LB.csproj @@ -9,7 +9,7 @@ content Microsoft.AspNetCore.AzureAppServices.SiteExtension.$(AspNetCoreMajorMinorVersion).$(TargetArchitecture) $(TargetRuntimeIdentifier) - $(MicrosoftNETCoreAppRuntimeVersion) + $(MicrosoftNETCoreAppRefVersion) AzureSiteExtension true false diff --git a/src/aspnetcore/src/Testing/src/xunit/HelixConstants.cs b/src/aspnetcore/src/Testing/src/xunit/HelixConstants.cs index 47f938e8446..d47d10bdd02 100644 --- a/src/aspnetcore/src/Testing/src/xunit/HelixConstants.cs +++ b/src/aspnetcore/src/Testing/src/xunit/HelixConstants.cs @@ -6,8 +6,8 @@ namespace Microsoft.AspNetCore.InternalTesting; public static class HelixConstants { public const string Windows10Arm64 = "Windows.10.Arm64v8.Open;"; - public const string DebianAmd64 = "Debian.11.Amd64.Open;"; - public const string DebianArm64 = "Debian.11.Arm64.Open;"; - public const string AlmaLinuxAmd64 = "(AlmaLinux.8.Amd64.Open)Ubuntu.1804.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:almalinux-8-helix-amd64;"; + public const string DebianAmd64 = "Debian.13.Amd64.Open;"; + public const string DebianArm64 = "Debian.13.Arm64.Open;"; + public const string AlmaLinuxAmd64 = "(AlmaLinux.9.Amd64.Open)azurelinux.3.Amd64.Open@mcr.microsoft.com/dotnet-buildtools/prereqs:almalinux-9-helix-amd64;"; public const string NativeAotNotSupportedHelixQueues = "All.OSX;All.Linux;Windows.11.Amd64.Client.Open;Windows.11.Amd64.Client;Windows.Amd64.Server2022.Open;Windows.Amd64.Server2022;windows.11.arm64.open;windows.11.arm64"; } diff --git a/src/cecil/eng/Version.Details.xml b/src/cecil/eng/Version.Details.xml index 6d55eb3474a..29f8b749402 100644 --- a/src/cecil/eng/Version.Details.xml +++ b/src/cecil/eng/Version.Details.xml @@ -1,12 +1,12 @@ - + - + https://github.com/dotnet/dotnet - 3b83017bbef1dd0918f7c2f894cfd07f56bcd689 + 85778473549347b3e4bad3ea009e9438df7b11bb diff --git a/src/cecil/eng/common/core-templates/steps/source-build.yml b/src/cecil/eng/common/core-templates/steps/source-build.yml index c6b9ef51ac6..f2a0f347fdd 100644 --- a/src/cecil/eng/common/core-templates/steps/source-build.yml +++ b/src/cecil/eng/common/core-templates/steps/source-build.yml @@ -19,19 +19,6 @@ steps: set -x df -h - # If file changes are detected, set CopyWipIntoInnerSourceBuildRepo to copy the WIP changes into the inner source build repo. - internalRestoreArgs= - if ! git diff --quiet; then - internalRestoreArgs='/p:CopyWipIntoInnerSourceBuildRepo=true' - # The 'Copy WIP' feature of source build uses git stash to apply changes from the original repo. - # This only works if there is a username/email configured, which won't be the case in most CI runs. - git config --get user.email - if [ $? -ne 0 ]; then - git config user.email dn-bot@microsoft.com - git config user.name dn-bot - fi - fi - # If building on the internal project, the internal storage variable may be available (usually only if needed) # In that case, add variables to allow the download of internal runtimes if the specified versions are not found # in the default public locations. @@ -46,34 +33,14 @@ steps: buildConfig='$(_BuildConfig)' fi - officialBuildArgs= - if [ '${{ and(ne(variables['System.TeamProject'], 'public'), notin(variables['Build.Reason'], 'PullRequest')) }}' = 'True' ]; then - officialBuildArgs='/p:DotNetPublishUsingPipelines=true /p:OfficialBuildId=$(BUILD.BUILDNUMBER)' - fi - targetRidArgs= if [ '${{ parameters.platform.targetRID }}' != '' ]; then targetRidArgs='/p:TargetRid=${{ parameters.platform.targetRID }}' fi - runtimeOsArgs= - if [ '${{ parameters.platform.runtimeOS }}' != '' ]; then - runtimeOsArgs='/p:RuntimeOS=${{ parameters.platform.runtimeOS }}' - fi - - baseOsArgs= - if [ '${{ parameters.platform.baseOS }}' != '' ]; then - baseOsArgs='/p:BaseOS=${{ parameters.platform.baseOS }}' - fi - - publishArgs= - if [ '${{ parameters.platform.skipPublishValidation }}' != 'true' ]; then - publishArgs='--publish' - fi - - assetManifestFileName=SourceBuild_RidSpecific.xml - if [ '${{ parameters.platform.name }}' != '' ]; then - assetManifestFileName=SourceBuild_${{ parameters.platform.name }}.xml + baseRidArgs= + if [ '${{ parameters.platform.baseRID }}' != '' ]; then + baseRidArgs='/p:BaseRid=${{ parameters.platform.baseRID }}' fi portableBuildArgs= @@ -83,40 +50,22 @@ steps: ${{ coalesce(parameters.platform.buildScript, './build.sh') }} --ci \ --configuration $buildConfig \ - --restore --build --pack $publishArgs -bl \ + --restore --build --pack -bl \ ${{ parameters.platform.buildArguments }} \ - $officialBuildArgs \ $internalRuntimeDownloadArgs \ - $internalRestoreArgs \ $targetRidArgs \ - $runtimeOsArgs \ - $baseOsArgs \ + $baseRidArgs \ $portableBuildArgs \ /p:DotNetBuildSourceOnly=true \ /p:DotNetBuildRepo=true \ - /p:AssetManifestFileName=$assetManifestFileName displayName: Build -# Upload build logs for diagnosis. -- task: CopyFiles@2 - displayName: Prepare BuildLogs staging directory - inputs: - SourceFolder: '$(Build.SourcesDirectory)' - Contents: | - **/*.log - **/*.binlog - artifacts/sb/prebuilt-report/** - TargetFolder: '$(Build.StagingDirectory)/BuildLogs' - CleanTargetFolder: true - continueOnError: true - condition: succeededOrFailed() - - template: /eng/common/core-templates/steps/publish-pipeline-artifacts.yml parameters: is1ESPipeline: ${{ parameters.is1ESPipeline }} args: displayName: Publish BuildLogs - targetPath: '$(Build.StagingDirectory)/BuildLogs' + targetPath: artifacts/log/${{ coalesce(variables._BuildConfig, 'Release') }} artifactName: BuildLogs_SourceBuild_${{ parameters.platform.name }}_Attempt$(System.JobAttempt) continueOnError: true condition: succeededOrFailed() diff --git a/src/cecil/eng/common/tools.sh b/src/cecil/eng/common/tools.sh index d51f300c772..cc007b1f15a 100755 --- a/src/cecil/eng/common/tools.sh +++ b/src/cecil/eng/common/tools.sh @@ -5,6 +5,9 @@ # CI mode - set to true on CI server for PR validation build or official build. ci=${ci:-false} +# Build mode +source_build=${source_build:-false} + # Set to true to use the pipelines logger which will enable Azure logging output. # https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md # This flag is meant as a temporary opt-opt for the feature while validate it across @@ -58,7 +61,8 @@ use_installed_dotnet_cli=${use_installed_dotnet_cli:-true} dotnetInstallScriptVersion=${dotnetInstallScriptVersion:-'v1'} # True to use global NuGet cache instead of restoring packages to repository-local directory. -if [[ "$ci" == true ]]; then +# Keep in sync with NuGetPackageroot in Arcade SDK's RepositoryLayout.props. +if [[ "$ci" == true || "$source_build" == true ]]; then use_global_nuget_cache=${use_global_nuget_cache:-false} else use_global_nuget_cache=${use_global_nuget_cache:-true} diff --git a/src/cecil/global.json b/src/cecil/global.json index 779e69d7a18..18ddac93379 100644 --- a/src/cecil/global.json +++ b/src/cecil/global.json @@ -4,6 +4,6 @@ }, "msbuild-sdks": { "Microsoft.Build.NoTargets": "3.7.0", - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25251.105" + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25260.104" } } diff --git a/src/deployment-tools/eng/Version.Details.xml b/src/deployment-tools/eng/Version.Details.xml index 8eb9821420c..91bd708eebc 100644 --- a/src/deployment-tools/eng/Version.Details.xml +++ b/src/deployment-tools/eng/Version.Details.xml @@ -1,11 +1,11 @@ - + - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb diff --git a/src/deployment-tools/eng/common/core-templates/steps/source-build.yml b/src/deployment-tools/eng/common/core-templates/steps/source-build.yml index c7c062e88ee..f2a0f347fdd 100644 --- a/src/deployment-tools/eng/common/core-templates/steps/source-build.yml +++ b/src/deployment-tools/eng/common/core-templates/steps/source-build.yml @@ -38,14 +38,9 @@ steps: targetRidArgs='/p:TargetRid=${{ parameters.platform.targetRID }}' fi - runtimeOsArgs= - if [ '${{ parameters.platform.runtimeOS }}' != '' ]; then - runtimeOsArgs='/p:RuntimeOS=${{ parameters.platform.runtimeOS }}' - fi - - baseOsArgs= - if [ '${{ parameters.platform.baseOS }}' != '' ]; then - baseOsArgs='/p:BaseOS=${{ parameters.platform.baseOS }}' + baseRidArgs= + if [ '${{ parameters.platform.baseRID }}' != '' ]; then + baseRidArgs='/p:BaseRid=${{ parameters.platform.baseRID }}' fi portableBuildArgs= @@ -59,8 +54,7 @@ steps: ${{ parameters.platform.buildArguments }} \ $internalRuntimeDownloadArgs \ $targetRidArgs \ - $runtimeOsArgs \ - $baseOsArgs \ + $baseRidArgs \ $portableBuildArgs \ /p:DotNetBuildSourceOnly=true \ /p:DotNetBuildRepo=true \ diff --git a/src/deployment-tools/eng/common/tools.sh b/src/deployment-tools/eng/common/tools.sh index d51f300c772..cc007b1f15a 100755 --- a/src/deployment-tools/eng/common/tools.sh +++ b/src/deployment-tools/eng/common/tools.sh @@ -5,6 +5,9 @@ # CI mode - set to true on CI server for PR validation build or official build. ci=${ci:-false} +# Build mode +source_build=${source_build:-false} + # Set to true to use the pipelines logger which will enable Azure logging output. # https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md # This flag is meant as a temporary opt-opt for the feature while validate it across @@ -58,7 +61,8 @@ use_installed_dotnet_cli=${use_installed_dotnet_cli:-true} dotnetInstallScriptVersion=${dotnetInstallScriptVersion:-'v1'} # True to use global NuGet cache instead of restoring packages to repository-local directory. -if [[ "$ci" == true ]]; then +# Keep in sync with NuGetPackageroot in Arcade SDK's RepositoryLayout.props. +if [[ "$ci" == true || "$source_build" == true ]]; then use_global_nuget_cache=${use_global_nuget_cache:-false} else use_global_nuget_cache=${use_global_nuget_cache:-true} diff --git a/src/deployment-tools/global.json b/src/deployment-tools/global.json index 61817e2bd00..6e368302e04 100644 --- a/src/deployment-tools/global.json +++ b/src/deployment-tools/global.json @@ -8,7 +8,7 @@ "dotnet": "10.0.100-preview.3.25201.16" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25257.101", + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25260.104", "Microsoft.Build.NoTargets": "3.7.0", "Microsoft.Build.Traversal": "3.4.0" } diff --git a/src/diagnostics/eng/Version.Details.xml b/src/diagnostics/eng/Version.Details.xml index a7a60ce15df..a5ecb2bfc1f 100644 --- a/src/diagnostics/eng/Version.Details.xml +++ b/src/diagnostics/eng/Version.Details.xml @@ -1,13 +1,13 @@ - + https://github.com/microsoft/clrmd - cccf496872323338afe872dd102720f9606945d4 + fd6ccca33b888a5077a477218cac2461b81e8586 - + https://github.com/microsoft/clrmd - cccf496872323338afe872dd102720f9606945d4 + fd6ccca33b888a5077a477218cac2461b81e8586 diff --git a/src/diagnostics/eng/Versions.props b/src/diagnostics/eng/Versions.props index 71be36d92e0..2d6fa857101 100644 --- a/src/diagnostics/eng/Versions.props +++ b/src/diagnostics/eng/Versions.props @@ -37,7 +37,7 @@ 8.0.0 6.0.0 - 4.0.0-beta.25255.1 + 4.0.0-beta.25261.1 17.10.0-beta1.24272.1 3.1.21 6.0.0 diff --git a/src/diagnostics/src/SOS/Strike/metadata.cpp b/src/diagnostics/src/SOS/Strike/metadata.cpp index 95d12f9aa09..f5a2b807897 100644 --- a/src/diagnostics/src/SOS/Strike/metadata.cpp +++ b/src/diagnostics/src/SOS/Strike/metadata.cpp @@ -2,9 +2,9 @@ // The .NET Foundation licenses this file to you under the MIT license. // ==++== -// - -// +// + +// // ==--== #include "strike.h" #include "util.h" @@ -12,7 +12,7 @@ /**********************************************************************\ * Routine Description: * * * -* This function is called to find the name of a TypeDef using * +* This function is called to find the name of a TypeDef using * * metadata API. * * * \**********************************************************************/ @@ -20,9 +20,14 @@ static HRESULT NameForTypeDef_s(mdTypeDef tkTypeDef, IMetaDataImport *pImport, __out_ecount (capacity_mdName) WCHAR *mdName, size_t capacity_mdName) { + if (pImport == NULL) + { + int res = swprintf_s(mdName, capacity_mdName, W("0x%08x"), tkTypeDef); + return res != -1 ? S_OK : E_FAIL; + } + DWORD flags; ULONG nameLen; - HRESULT hr = pImport->GetTypeDefProps(tkTypeDef, mdName, (ULONG)capacity_mdName, &nameLen, &flags, NULL); @@ -68,13 +73,13 @@ IMetaDataImport* MDImportForModule(DacpModuleData* pModule) IMetaDataImport *pRet = NULL; ToRelease module; HRESULT hr = g_sos->GetModule(pModule->Address, &module); - + if (SUCCEEDED(hr)) hr = module->QueryInterface(IID_IMetaDataImport, (LPVOID *) &pRet); if (SUCCEEDED(hr)) return pRet; - + return NULL; } @@ -104,9 +109,9 @@ HRESULT NameForToken_s(mdTypeDef mb, IMetaDataImport *pImport, __out_ecount (cap //ExtOut("unsupported\n"); return E_FAIL; } - + HRESULT hr = E_FAIL; - + PAL_CPP_TRY { static WCHAR name[MAX_CLASSNAME_LENGTH]; @@ -168,7 +173,7 @@ HRESULT NameForToken_s(mdTypeDef mb, IMetaDataImport *pImport, __out_ecount (cap /**********************************************************************\ * Routine Description: * * * -* This function is called to find the name of a metadata token * +* This function is called to find the name of a metadata token * * using metadata API. * * * \**********************************************************************/ @@ -206,7 +211,7 @@ void NameForToken_s(DacpModuleData *pModule, mdTypeDef mb, __out_ecount (capacit { hr = NameForToken_s (mb, pImport, mdName, capacity_mdName, bClassName); } - + if (!pImport || !SUCCEEDED (hr)) { const SIZE_T capacity_moduleName = mdNameLen+19; @@ -218,7 +223,7 @@ void NameForToken_s(DacpModuleData *pModule, mdTypeDef mb, __out_ecount (capacit if (assembly.isDynamic) { wcscpy_s(moduleName, capacity_moduleName, W("Dynamic ")); } - wcscat_s (moduleName, capacity_moduleName, W("Module in ")); + wcscat_s (moduleName, capacity_moduleName, W("Module in ")); if(g_sos->GetAssemblyName(pModule->Assembly, mdNameLen, g_mdName, NULL)==S_OK) { wcscat_s(moduleName, capacity_moduleName, g_mdName); @@ -238,9 +243,16 @@ class MDInfo public: MDInfo (DWORD_PTR ModuleAddr) { - m_pImport = MDImportForModule(ModuleAddr); - if (!m_pImport) - ExtOut("Unable to get IMetaDataImport for module %p\n", ModuleAddr); + if (ModuleAddr == 0) + { + m_pImport = NULL; + } + else + { + m_pImport = MDImportForModule(ModuleAddr); + if (!m_pImport) + ExtOut("Unable to get IMetaDataImport for module %p\n", ModuleAddr); + } m_pSigBuf = NULL; } @@ -251,7 +263,7 @@ class MDInfo m_pSigBuf = NULL; } - void GetMethodName(mdTypeDef token, CQuickBytes *fullName); + void GetMethodName(mdMethodDef token, CQuickBytes *fullName); GetSignatureStringResults GetMethodSignature(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, CQuickBytes *fullName); GetSignatureStringResults GetSignature(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, CQuickBytes *fullName); @@ -308,46 +320,47 @@ void GetMethodName(mdMethodDef methodDef, IMetaDataImport * pImport, CQuickBytes // Tables for mapping element type to text -const WCHAR *g_wszMapElementType[] = +const WCHAR *g_wszMapElementType[] = { W("End"), // 0x0 W("Void"), // 0x1 W("Boolean"), - W("Char"), + W("Char"), W("I1"), - W("UI1"), + W("U1"), W("I2"), // 0x6 - W("UI2"), + W("U2"), W("I4"), - W("UI4"), + W("U4"), W("I8"), - W("UI8"), + W("U8"), W("R4"), W("R8"), W("String"), W("Ptr"), // 0xf W("ByRef"), // 0x10 - W("ValueClass"), + W("ValueType"), W("Class"), - W("CopyCtor"), + W("Var"), W("MDArray"), // 0x14 - W("GENArray"), + W("GenericInst"), W("TypedByRef"), - W("VALUEARRAY"), - W("I"), - W("U"), - W("R"), // 0x1a - W("FNPTR"), + W("UNUSED"), + W("IntPtr"), + W("UIntPtr"), + W("UNUSED"), // 0x1a + W("FnPtr"), W("Object"), W("SZArray"), - W("GENERICArray"), + W("MVar"), W("CMOD_REQD"), W("CMOD_OPT"), W("INTERNAL"), + W("CMOD_INTERNAL"), }; - -const WCHAR *g_wszCalling[] = -{ + +const WCHAR *g_wszCalling[] = +{ W("[DEFAULT]"), W("[C]"), W("[STDCALL]"), @@ -358,36 +371,44 @@ const WCHAR *g_wszCalling[] = W("[LOCALSIG]"), W("[PROPERTY]"), W("[UNMANAGED]"), + W("[GENERICINST]"), + W("[NATIVEVARARG]"), + W("[UNKNOWN]"), + W("[UNKNOWN]"), + W("[UNKNOWN]"), + W("[UNKNOWN]"), }; -void MDInfo::GetMethodName(mdTypeDef token, CQuickBytes *fullName) +void MDInfo::GetMethodName(mdMethodDef token, CQuickBytes *fullName) { - if (m_pImport == NULL) { - return; - } - - HRESULT hr; - mdTypeDef memTypeDef; - ULONG nameLen; - DWORD flags; - PCCOR_SIGNATURE pbSigBlob; - ULONG ulSigBlob; - ULONG ulCodeRVA; - ULONG ulImplFlags; + HRESULT hr = E_FAIL; + mdTypeDef memTypeDef = mdTypeDefNil; + ULONG nameLen = 0; + DWORD flags = 0; + PCCOR_SIGNATURE pbSigBlob = NULL; + ULONG ulSigBlob = 0; + ULONG ulCodeRVA = 0; + ULONG ulImplFlags = 0; m_pSigBuf = fullName; InitSigBuffer(); WCHAR szFunctionName[1024]; - hr = m_pImport->GetMethodProps(token, &memTypeDef, - szFunctionName, ARRAY_SIZE(szFunctionName), &nameLen, - &flags, &pbSigBlob, &ulSigBlob, &ulCodeRVA, &ulImplFlags); - if (FAILED (hr)) + if (m_pImport != NULL) { + hr = m_pImport->GetMethodProps(token, &memTypeDef, + szFunctionName, ARRAY_SIZE(szFunctionName), &nameLen, + &flags, &pbSigBlob, &ulSigBlob, &ulCodeRVA, &ulImplFlags); + } + + if (FAILED(hr)) + { + swprintf_s(szFunctionName, ARRAY_SIZE(szFunctionName), W("0x%08x"), token); + AddToSigBuffer(szFunctionName); return; } - + szFunctionName[nameLen] = L'\0'; m_szName[0] = L'\0'; if (memTypeDef != mdTypeDefNil) @@ -420,9 +441,6 @@ void MDInfo::GetMethodName(mdTypeDef token, CQuickBytes *fullName) GetSignatureStringResults MDInfo::GetMethodSignature(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, CQuickBytes *fullName) { - if (!m_pImport) - return GSS_ERROR; - m_pSigBuf = fullName; InitSigBuffer(); @@ -431,7 +449,7 @@ GetSignatureStringResults MDInfo::GetMethodSignature(PCCOR_SIGNATURE pbSigBlob, LONG lSigBlobRemaining; if (FAILED(GetFullNameForMD(pbSigBlob, ulSigBlob, &lSigBlobRemaining))) return GSS_ERROR; - + if (lSigBlobRemaining < 0) return GSS_INSUFFICIENT_DATA; @@ -441,9 +459,6 @@ GetSignatureStringResults MDInfo::GetMethodSignature(PCCOR_SIGNATURE pbSigBlob, GetSignatureStringResults MDInfo::GetSignature(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, CQuickBytes *fullName) { - if (!m_pImport) - return GSS_ERROR; - m_pSigBuf = fullName; InitSigBuffer(); @@ -461,10 +476,9 @@ GetSignatureStringResults MDInfo::GetSignature(PCCOR_SIGNATURE pbSigBlob, ULONG return GSS_SUCCESS; } - inline bool isCallConv(unsigned sigByte, CorCallingConvention conv) { - return ((sigByte & IMAGE_CEE_CS_CALLCONV_MASK) == (unsigned) conv); + return ((sigByte & IMAGE_CEE_CS_CALLCONV_MASK) == (unsigned) conv); } #undef IfFailGoto @@ -492,16 +506,11 @@ HRESULT MDInfo::GetFullNameForMD(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, LON // goto ErrExit; AddToSigBuffer (g_wszCalling[ulData & IMAGE_CEE_CS_CALLCONV_MASK]); - if (cb>ulSigBlob) + if (cb>ulSigBlob) goto ErrExit; cbCur += cb; ulSigBlob -= cb; - if (ulData & IMAGE_CEE_CS_CALLCONV_HASTHIS) - AddToSigBuffer ( W(" [hasThis]")); - if (ulData & IMAGE_CEE_CS_CALLCONV_EXPLICITTHIS) - AddToSigBuffer ( W(" [explicit]")); - AddToSigBuffer (W(" ")); if ( isCallConv(ulData,IMAGE_CEE_CS_CALLCONV_FIELD) ) { @@ -510,15 +519,36 @@ HRESULT MDInfo::GetFullNameForMD(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, LON goto ErrExit; AddToSigBuffer ( W(" ")); AddToSigBuffer ( m_szName); - if (cb>ulSigBlob) + if (cb>ulSigBlob) goto ErrExit; cbCur += cb; ulSigBlob -= cb; } - else + else { + if (ulData & IMAGE_CEE_CS_CALLCONV_HASTHIS) + AddToSigBuffer ( W("[hasThis] ")); + if (ulData & IMAGE_CEE_CS_CALLCONV_EXPLICITTHIS) + AddToSigBuffer ( W("[explicit] ")); + + if (ulData & IMAGE_CEE_CS_CALLCONV_GENERIC) + { + ULONG ulGenericCount; + cb = CorSigUncompressData(&pbSigBlob[cbCur], &ulGenericCount); + if (cb>ulSigBlob) + goto ErrExit; + AddToSigBuffer (W("[generic:")); + + WCHAR buffer[16]; + _itow_s(ulGenericCount, buffer, ARRAY_SIZE(buffer), 10); + AddToSigBuffer (buffer); + AddToSigBuffer (W("] ")); + cbCur += cb; + ulSigBlob -= cb; + } + cb = CorSigUncompressData(&pbSigBlob[cbCur], &ulArgs); - if (cb>ulSigBlob) + if (cb>ulSigBlob) goto ErrExit; cbCur += cb; ulSigBlob -= cb; @@ -531,7 +561,7 @@ HRESULT MDInfo::GetFullNameForMD(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, LON AddToSigBuffer (W(" ")); AddToSigBuffer (m_szName); AddToSigBuffer ( W("(")); - if (cb>ulSigBlob) + if (cb>ulSigBlob) goto ErrExit; cbCur += cb; ulSigBlob -= cb; @@ -551,7 +581,7 @@ HRESULT MDInfo::GetFullNameForMD(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, LON if (i != ulArgs) { AddToSigBuffer ( W(",")); } - if (cb>ulSigBlob) + if (cb>ulSigBlob) goto ErrExit; cbCur += cb; @@ -573,39 +603,42 @@ HRESULT MDInfo::GetFullNameForMD(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, LON LPCWSTR MDInfo::TypeDefName(mdTypeDef inTypeDef) { - if (m_pImport == NULL) { - return W(""); + HRESULT hr = E_FAIL; + if (m_pImport != NULL) + { + hr = m_pImport->GetTypeDefProps( + // [IN] The import scope. + inTypeDef, // [IN] TypeDef token for inquiry. + m_szTempBuf, // [OUT] Put name here. + MAX_CLASSNAME_LENGTH , // [IN] size of name buffer in wide chars. + NULL, // [OUT] put size of name (wide chars) here. + NULL, // [OUT] Put flags here. + NULL); // [OUT] Put base class TypeDef/TypeRef here. + } + if (FAILED(hr)) + { + swprintf_s(m_szTempBuf, MAX_CLASSNAME_LENGTH, W("0x%08x"), inTypeDef); } - HRESULT hr; - - hr = m_pImport->GetTypeDefProps( - // [IN] The import scope. - inTypeDef, // [IN] TypeDef token for inquiry. - m_szTempBuf, // [OUT] Put name here. - MAX_CLASSNAME_LENGTH , // [IN] size of name buffer in wide chars. - NULL, // [OUT] put size of name (wide chars) here. - NULL, // [OUT] Put flags here. - NULL); // [OUT] Put base class TypeDef/TypeRef here. - - if (FAILED(hr)) return (W("NoName")); return (m_szTempBuf); } // LPCWSTR MDInfo::TypeDefName() + LPCWSTR MDInfo::TypeRefName(mdTypeRef tr) { - if (m_pImport == NULL) { - return W(""); + HRESULT hr = E_FAIL; + if (m_pImport != NULL) + { + hr = m_pImport->GetTypeRefProps( + tr, // The class ref token. + NULL, // Resolution scope. + m_szTempBuf, // Put the name here. + MAX_CLASSNAME_LENGTH, // Size of the name buffer, wide chars. + NULL); // Put actual size of name here. + } + if (FAILED(hr)) + { + swprintf_s(m_szTempBuf, MAX_CLASSNAME_LENGTH, W("0x%08x"), tr); } - - HRESULT hr; - - hr = m_pImport->GetTypeRefProps( - tr, // The class ref token. - NULL, // Resolution scope. - m_szTempBuf, // Put the name here. - MAX_CLASSNAME_LENGTH, // Size of the name buffer, wide chars. - NULL); // Put actual size of name here. - if (FAILED(hr)) return (W("NoName")); return (m_szTempBuf); } // LPCWSTR MDInfo::TypeRefName() @@ -643,7 +676,6 @@ HRESULT MDInfo::GetOneElementType(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, UL ULONG ulTemp; int iTemp = 0; mdToken tk; - const size_t capacity_buffer = 9; cb = CorSigUncompressData(pbSigBlob, &ulData); @@ -673,11 +705,12 @@ HRESULT MDInfo::GetOneElementType(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, UL } // Handle the underlying element types. - if (ulData >= ELEMENT_TYPE_MAX) + if (ulData >= ELEMENT_TYPE_MAX) { hr = E_FAIL; goto ErrExit; } + while (ulData == ELEMENT_TYPE_PTR || ulData == ELEMENT_TYPE_BYREF) { IfFailGo(AddToSigBuffer(g_wszMapElementType[ulData])); @@ -687,14 +720,24 @@ HRESULT MDInfo::GetOneElementType(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, UL } // Generics - if (ulData == ELEMENT_TYPE_VAR) + if (ulData == ELEMENT_TYPE_VAR || ulData == ELEMENT_TYPE_MVAR) { - IfFailGo(AddToSigBuffer(W("__Canon"))); + if (ulData == ELEMENT_TYPE_VAR) + { + IfFailGo(AddToSigBuffer(W("!"))); + } + else + { + IfFailGo(AddToSigBuffer(W("!!"))); + } + + ULONG varIndex = 0; + IfFailGo(CorSigUncompressData(&pbSigBlob[cbCur], ulSigBlob-cbCur, &varIndex, &cb)); + cbCur += cb; - // The next byte represents which generic parameter is referred to. We - // do not currently use this information, so just bypass this byte. - cbCur++; - + WCHAR buffer[16]; + _itow_s(varIndex, buffer, ARRAY_SIZE(buffer), 10); + AddToSigBuffer(buffer); goto ErrExit; } @@ -707,26 +750,32 @@ HRESULT MDInfo::GetOneElementType(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, UL // Get the number of generic arguments. ULONG numParams = 0; - IfFailGo(CorSigUncompressData(&pbSigBlob[cbCur], 1, &numParams, &cb)); + IfFailGo(CorSigUncompressData(&pbSigBlob[cbCur], ulSigBlob-cbCur, &numParams, &cb)); cbCur += cb; // Print out the list of arguments IfFailGo(AddToSigBuffer(W("<"))); for (ULONG i = 0; i < numParams; i++) { - if (i > 0) + if (i > 0) IfFailGo(AddToSigBuffer(W(","))); - + IfFailGo(GetOneElementType(&pbSigBlob[cbCur], ulSigBlob-cbCur, &cb)); cbCur += cb; } IfFailGo(AddToSigBuffer(W(">"))); goto ErrExit; } - + // Past this point we must have something which directly maps to a value in g_wszMapElementType. + if (ulData >= ARRAY_SIZE(g_wszMapElementType)) + { + IfFailGo(AddToSigBuffer(W("INVALID_ELEMENT_TYPE"))); + return E_FAIL; + } + IfFailGo(AddToSigBuffer(g_wszMapElementType[ulData])); - if (CorIsPrimitiveType((CorElementType)ulData) || + if (CorIsPrimitiveType((CorElementType)ulData) || ulData == ELEMENT_TYPE_TYPEDBYREF || ulData == ELEMENT_TYPE_OBJECT || ulData == ELEMENT_TYPE_I || @@ -737,8 +786,8 @@ HRESULT MDInfo::GetOneElementType(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, UL } AddToSigBuffer(W(" ")); - if (ulData == ELEMENT_TYPE_VALUETYPE || - ulData == ELEMENT_TYPE_CLASS || + if (ulData == ELEMENT_TYPE_VALUETYPE || + ulData == ELEMENT_TYPE_CLASS || ulData == ELEMENT_TYPE_CMOD_REQD || ulData == ELEMENT_TYPE_CMOD_OPT) { @@ -753,8 +802,8 @@ HRESULT MDInfo::GetOneElementType(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, UL else { _ASSERTE(TypeFromToken(tk) == mdtTypeSpec); - WCHAR buffer[capacity_buffer]; - _itow_s (tk, buffer, capacity_buffer, 16); + WCHAR buffer[16]; + _itow_s (tk, buffer, ARRAY_SIZE(buffer), 16); IfFailGo(AddToSigBuffer(buffer)); } if (ulData == ELEMENT_TYPE_CMOD_REQD || @@ -770,13 +819,13 @@ HRESULT MDInfo::GetOneElementType(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, UL } if (ulData == ELEMENT_TYPE_SZARRAY) { - // display the base type of SZARRAY or GENERICARRAY + // display the base type of SZARRAY if (FAILED(GetOneElementType(&pbSigBlob[cbCur], ulSigBlob-cbCur, &cb))) goto ErrExit; cbCur += cb; goto ErrExit; } - if (ulData == ELEMENT_TYPE_FNPTR) + if (ulData == ELEMENT_TYPE_FNPTR) { cb = CorSigUncompressData(&pbSigBlob[cbCur], &ulData); cbCur += cb; @@ -798,7 +847,7 @@ HRESULT MDInfo::GetOneElementType(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, UL cbCur += cb; IfFailGo(AddToSigBuffer(W("("))); - while (numArgs > 0) + while (numArgs > 0) { if (cbCur > ulSigBlob) goto ErrExit; @@ -806,7 +855,7 @@ HRESULT MDInfo::GetOneElementType(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, UL goto ErrExit; cbCur += cb; --numArgs; - if (numArgs > 0) + if (numArgs > 0) IfFailGo(AddToSigBuffer(W(","))); } IfFailGo(AddToSigBuffer(W(")"))); @@ -821,9 +870,8 @@ HRESULT MDInfo::GetOneElementType(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, UL cb = CorSigUncompressPointer(&pbSigBlob[cbCur], (void**)&pvMethodTable); cbCur += cb; - const size_t capacity_szMethodTableValue = 10; - WCHAR szMethodTableValue[10]; - itow_s_ptr((INT_PTR)pvMethodTable, szMethodTableValue, capacity_szMethodTableValue, 16); + WCHAR szMethodTableValue[32]; + itow_s_ptr((INT_PTR)pvMethodTable, szMethodTableValue, ARRAY_SIZE(szMethodTableValue), 16); IfFailGo(AddToSigBuffer(szMethodTableValue)); IfFailGo(AddToSigBuffer(W(" "))); @@ -834,60 +882,68 @@ HRESULT MDInfo::GetOneElementType(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, UL goto ErrExit; } - - if(ulData != ELEMENT_TYPE_ARRAY) return E_FAIL; + if(ulData != ELEMENT_TYPE_ARRAY) + return E_FAIL; + + // Since MDARRAY has extra data, we will use a visual indication + // to group the base type and the ArrayShape. + IfFailGo(AddToSigBuffer(W("{"))); - // display the base type of SDARRAY + // Display the base type of MDARRAY if (FAILED(GetOneElementType(&pbSigBlob[cbCur], ulSigBlob-cbCur, &cb))) goto ErrExit; cbCur += cb; - IfFailGo(AddToSigBuffer(W(" "))); - // display the rank of MDARRAY + // Print the ArrayShape - ECMA-335 II.23.2.13 + AddToSigBuffer(W(", ")); + + // Display the rank cb = CorSigUncompressData(&pbSigBlob[cbCur], &ulData); cbCur += cb; - WCHAR buffer[capacity_buffer]; - _itow_s (ulData, buffer, capacity_buffer, 10); + WCHAR buffer[16]; + _itow_s (ulData, buffer, ARRAY_SIZE(buffer), 10); IfFailGo(AddToSigBuffer(buffer)); + + // we are done if no rank specified if (ulData == 0) - // we are done if no rank specified goto ErrExit; IfFailGo(AddToSigBuffer(W(" "))); + // how many dimensions have size specified? cb = CorSigUncompressData(&pbSigBlob[cbCur], &ulData); cbCur += cb; - _itow_s (ulData, buffer, capacity_buffer, 10); + _itow_s (ulData, buffer, ARRAY_SIZE(buffer), 10); IfFailGo(AddToSigBuffer(buffer)); - if (ulData == 0) { + if (ulData == 0) IfFailGo(AddToSigBuffer(W(" "))); - } - while (ulData) - { + for (;ulData != 0; ulData--) + { cb = CorSigUncompressData(&pbSigBlob[cbCur], &ulTemp); - _itow_s (ulTemp, buffer, capacity_buffer, 10); + _itow_s (ulTemp, buffer, ARRAY_SIZE(buffer), 10); IfFailGo(AddToSigBuffer(buffer)); IfFailGo(AddToSigBuffer(W(" "))); cbCur += cb; - ulData--; } + // how many dimensions have lower bounds specified? cb = CorSigUncompressData(&pbSigBlob[cbCur], &ulData); cbCur += cb; - _itow_s (ulData, buffer, capacity_buffer, 10); + _itow_s (ulData, buffer, ARRAY_SIZE(buffer), 10); IfFailGo(AddToSigBuffer(buffer)); - while (ulData) - { + IfFailGo(AddToSigBuffer(W(" "))); + for (;ulData != 0; ulData--) + { cb = CorSigUncompressSignedInt(&pbSigBlob[cbCur], &iTemp); - _itow_s (iTemp, buffer, capacity_buffer, 10); + _itow_s (iTemp, buffer, ARRAY_SIZE(buffer), 10); IfFailGo(AddToSigBuffer(buffer)); IfFailGo(AddToSigBuffer(W(" "))); cbCur += cb; - ulData--; } - + IfFailGo(AddToSigBuffer(W("}"))); + ErrExit: if (cbCur > ulSigBlob) hr = E_FAIL; @@ -900,17 +956,17 @@ HRESULT MDInfo::GetOneElementType(PCCOR_SIGNATURE pbSigBlob, ULONG ulSigBlob, UL //***************************************************************************** typedef struct tagCOR_ILMETHOD_TINY : IMAGE_COR_ILMETHOD_TINY { - bool IsTiny() const { return((Flags_CodeSize & (CorILMethod_FormatMask >> 1)) == CorILMethod_TinyFormat); } - DWORD GetLocalVarSigTok() const { return(0); } + bool IsTiny() const { return((Flags_CodeSize & (CorILMethod_FormatMask >> 1)) == CorILMethod_TinyFormat); } + DWORD GetLocalVarSigTok() const { return(0); } } COR_ILMETHOD_TINY; //***************************************************************************** -// This strucuture is the 'fat' layout, where no compression is attempted. +// This strucuture is the 'fat' layout, where no compression is attempted. // Note that this structure can be added on at the end, thus making it extensible //***************************************************************************** typedef struct tagCOR_ILMETHOD_FAT : IMAGE_COR_ILMETHOD_FAT { - bool IsFat() const { return((Flags & CorILMethod_FormatMask) == CorILMethod_FatFormat); } - mdToken GetLocalVarSigTok() const { return(LocalVarSigTok); } + bool IsFat() const { return((Flags & CorILMethod_FormatMask) == CorILMethod_FatFormat); } + mdToken GetLocalVarSigTok() const { return(LocalVarSigTok); } } COR_ILMETHOD_FAT; diff --git a/src/diagnostics/src/SOS/Strike/strike.cpp b/src/diagnostics/src/SOS/Strike/strike.cpp index 766c574d3bc..4dab0bd56c5 100644 --- a/src/diagnostics/src/SOS/Strike/strike.cpp +++ b/src/diagnostics/src/SOS/Strike/strike.cpp @@ -844,8 +844,7 @@ DECLARE_API(DumpIL) return Status; } - -void DumpSigWorker ( +static void DumpSigWorker ( DWORD_PTR dwSigAddr, DWORD_PTR dwModuleAddr, BOOL fMethod) @@ -946,21 +945,24 @@ DECLARE_API(DumpSig) { return E_INVALIDARG; } - if (nArg != 2) + + if (nArg < 1 || nArg > 2) { - ExtOut("%sdumpsig \n", SOSPrefix); + ExtOut("%sdumpsig []?\n", SOSPrefix); return E_INVALIDARG; } DWORD_PTR dwSigAddr = GetExpression(sigExpr.data); - DWORD_PTR dwModuleAddr = GetExpression(moduleExpr.data); - - if (dwSigAddr == 0 || dwModuleAddr == 0) + if (dwSigAddr == 0) { - ExtOut("Invalid parameters %s %s\n", sigExpr.data, moduleExpr.data); - return Status; + ExtOut("Invalid parameter %s\n", sigExpr.data); + return E_INVALIDARG; } + DWORD_PTR dwModuleAddr = 0; + if (nArg == 2) + dwModuleAddr = GetExpression(moduleExpr.data); + DumpSigWorker(dwSigAddr, dwModuleAddr, TRUE); return Status; } @@ -994,21 +996,23 @@ DECLARE_API(DumpSigElem) return E_INVALIDARG; } - if (nArg != 2) + if (nArg < 1 || nArg > 2) { - ExtOut("%sdumpsigelem \n", SOSPrefix); + ExtOut("%sdumpsigelem []?\n", SOSPrefix); return E_INVALIDARG; } DWORD_PTR dwSigAddr = GetExpression(sigExpr.data); - DWORD_PTR dwModuleAddr = GetExpression(moduleExpr.data); - - if (dwSigAddr == 0 || dwModuleAddr == 0) + if (dwSigAddr == 0) { - ExtOut("Invalid parameters %s %s\n", sigExpr.data, moduleExpr.data); + ExtOut("Invalid parameter %s\n", sigExpr.data); return E_INVALIDARG; } + DWORD_PTR dwModuleAddr = 0; + if (nArg == 2) + dwModuleAddr = GetExpression(moduleExpr.data); + DumpSigWorker(dwSigAddr, dwModuleAddr, FALSE); return Status; } @@ -8073,9 +8077,9 @@ DECLARE_API(EEVersion) } } else + { ExtOut("Workstation mode\n"); - - + } if (!GetGcStructuresValid()) { diff --git a/src/efcore/eng/Version.Details.xml b/src/efcore/eng/Version.Details.xml index 8f943ad891b..8c6354d49bc 100644 --- a/src/efcore/eng/Version.Details.xml +++ b/src/efcore/eng/Version.Details.xml @@ -1,84 +1,84 @@ - + - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb diff --git a/src/efcore/eng/Versions.props b/src/efcore/eng/Versions.props index ec4852a38a0..a0445bb5d2f 100644 --- a/src/efcore/eng/Versions.props +++ b/src/efcore/eng/Versions.props @@ -16,24 +16,24 @@ False - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 - 10.0.0-preview.5.25257.101 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 + 10.0.0-preview.5.25260.104 - 10.0.0-beta.25257.101 + 10.0.0-beta.25260.104 17.13.9 diff --git a/src/efcore/eng/common/core-templates/steps/source-build.yml b/src/efcore/eng/common/core-templates/steps/source-build.yml index 325231215d5..f2a0f347fdd 100644 --- a/src/efcore/eng/common/core-templates/steps/source-build.yml +++ b/src/efcore/eng/common/core-templates/steps/source-build.yml @@ -38,14 +38,9 @@ steps: targetRidArgs='/p:TargetRid=${{ parameters.platform.targetRID }}' fi - runtimeOsArgs= - if [ '${{ parameters.platform.runtimeOS }}' != '' ]; then - runtimeOsArgs='/p:RuntimeOS=${{ parameters.platform.runtimeOS }}' - fi - - baseOsArgs= - if [ '${{ parameters.platform.baseOS }}' != '' ]; then - baseOsArgs='/p:BaseOS=${{ parameters.platform.baseOS }}' + baseRidArgs= + if [ '${{ parameters.platform.baseRID }}' != '' ]; then + baseRidArgs='/p:BaseRid=${{ parameters.platform.baseRID }}' fi portableBuildArgs= @@ -59,8 +54,7 @@ steps: ${{ parameters.platform.buildArguments }} \ $internalRuntimeDownloadArgs \ $targetRidArgs \ - $runtimeOsArgs \ - $baseOsArgs \ + $baseRidArgs \ $portableBuildArgs \ /p:DotNetBuildSourceOnly=true \ /p:DotNetBuildRepo=true \ @@ -71,7 +65,7 @@ steps: is1ESPipeline: ${{ parameters.is1ESPipeline }} args: displayName: Publish BuildLogs - targetPath: artifacts/log/$[ coalesce(variables._BuildConfig, 'Release') ]/ + targetPath: artifacts/log/${{ coalesce(variables._BuildConfig, 'Release') }} artifactName: BuildLogs_SourceBuild_${{ parameters.platform.name }}_Attempt$(System.JobAttempt) continueOnError: true condition: succeededOrFailed() diff --git a/src/efcore/eng/common/tools.sh b/src/efcore/eng/common/tools.sh index d51f300c772..cc007b1f15a 100755 --- a/src/efcore/eng/common/tools.sh +++ b/src/efcore/eng/common/tools.sh @@ -5,6 +5,9 @@ # CI mode - set to true on CI server for PR validation build or official build. ci=${ci:-false} +# Build mode +source_build=${source_build:-false} + # Set to true to use the pipelines logger which will enable Azure logging output. # https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md # This flag is meant as a temporary opt-opt for the feature while validate it across @@ -58,7 +61,8 @@ use_installed_dotnet_cli=${use_installed_dotnet_cli:-true} dotnetInstallScriptVersion=${dotnetInstallScriptVersion:-'v1'} # True to use global NuGet cache instead of restoring packages to repository-local directory. -if [[ "$ci" == true ]]; then +# Keep in sync with NuGetPackageroot in Arcade SDK's RepositoryLayout.props. +if [[ "$ci" == true || "$source_build" == true ]]; then use_global_nuget_cache=${use_global_nuget_cache:-false} else use_global_nuget_cache=${use_global_nuget_cache:-true} diff --git a/src/efcore/global.json b/src/efcore/global.json index 4788cf1576b..9dd20ccd1fe 100644 --- a/src/efcore/global.json +++ b/src/efcore/global.json @@ -13,7 +13,7 @@ } }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25257.101", - "Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25257.101" + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25260.104", + "Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25260.104" } } diff --git a/src/efcore/src/EFCore.InMemory/Query/Internal/InMemoryQueryableMethodTranslatingExpressionVisitor.cs b/src/efcore/src/EFCore.InMemory/Query/Internal/InMemoryQueryableMethodTranslatingExpressionVisitor.cs index b259d6aa501..a64883aaf3f 100644 --- a/src/efcore/src/EFCore.InMemory/Query/Internal/InMemoryQueryableMethodTranslatingExpressionVisitor.cs +++ b/src/efcore/src/EFCore.InMemory/Query/Internal/InMemoryQueryableMethodTranslatingExpressionVisitor.cs @@ -1160,6 +1160,16 @@ public Expression Expand(InMemoryQueryExpression queryExpression, Expression lam protected override Expression VisitMember(MemberExpression memberExpression) { + // Fold member access into conditional, i.e. transform + // (test ? expr1 : expr2).Member -> (test ? expr1.Member : expr2.Member) + if (memberExpression.Expression is ConditionalExpression cond) { + return Visit(Expression.Condition( + cond.Test, + Expression.MakeMemberAccess(cond.IfTrue, memberExpression.Member), + Expression.MakeMemberAccess(cond.IfFalse, memberExpression.Member) + )); + } + var innerExpression = Visit(memberExpression.Expression); return TryExpand(innerExpression, MemberIdentity.Create(memberExpression.Member)) diff --git a/src/efcore/src/EFCore.Relational/Query/RelationalSqlTranslatingExpressionVisitor.cs b/src/efcore/src/EFCore.Relational/Query/RelationalSqlTranslatingExpressionVisitor.cs index 512c676a158..3a2fdd6b725 100644 --- a/src/efcore/src/EFCore.Relational/Query/RelationalSqlTranslatingExpressionVisitor.cs +++ b/src/efcore/src/EFCore.Relational/Query/RelationalSqlTranslatingExpressionVisitor.cs @@ -631,6 +631,16 @@ protected override Expression VisitListInit(ListInitExpression listInitExpressio /// protected override Expression VisitMember(MemberExpression memberExpression) { + // Fold member access into conditional, i.e. transform + // (test ? expr1 : expr2).Member -> (test ? expr1.Member : expr2.Member) + if (memberExpression.Expression is ConditionalExpression cond) { + return Visit(Expression.Condition( + cond.Test, + Expression.MakeMemberAccess(cond.IfTrue, memberExpression.Member), + Expression.MakeMemberAccess(cond.IfFalse, memberExpression.Member) + )); + } + var innerExpression = Visit(memberExpression.Expression); return TryBindMember(innerExpression, MemberIdentity.Create(memberExpression.Member), out var expression) diff --git a/src/efcore/test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs b/src/efcore/test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs index 9f3daa18fe4..35b623e098c 100644 --- a/src/efcore/test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs +++ b/src/efcore/test/EFCore.Specification.Tests/Query/GearsOfWarQueryTestBase.cs @@ -1196,6 +1196,36 @@ from t2 in ss.Set() AssertEqual(e.t2, e.t2); }); + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Conditional_Navigation_With_Trivial_Member_Access(bool async) + => AssertQuery( + async, + ss => ss.Set() + .Where(g => (g.AssignedCity != null ? g.AssignedCity : g.CityOfBirth).Name != "Ephyra") + .Select(g => new { g.Nickname }), + elementSorter: e => e.Nickname); + + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Conditional_Navigation_With_Member_Access_On_Same_Type(bool async) + => AssertQuery( + async, + ss => ss.Set() + .Where(g => (g.AssignedCity != null ? g.AssignedCity : g.CityOfBirth).Nation == "Tyrus") + .Select(g => new { g.Nickname, g.FullName }), + elementSorter: e => e.Nickname); + + [ConditionalTheory] + [MemberData(nameof(IsAsyncData))] + public virtual Task Conditional_Navigation_With_Member_Access_On_Related_Types(bool async) + => AssertQuery( + async, + ss => ss.Set() + .Where(g => (g.DeputyCommander != null ? g.DeputyCommander : g.Commander).ThreatLevel == 4) + .Select(g => new { g.Name }), + elementSorter: e => e.Name); + [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public virtual Task Singleton_Navigation_With_Member_Access(bool async) diff --git a/src/efcore/test/EFCore.Specification.Tests/TestModels/GearsOfWarModel/LocustHorde.cs b/src/efcore/test/EFCore.Specification.Tests/TestModels/GearsOfWarModel/LocustHorde.cs index ec87e1442db..8ce30a63e98 100644 --- a/src/efcore/test/EFCore.Specification.Tests/TestModels/GearsOfWarModel/LocustHorde.cs +++ b/src/efcore/test/EFCore.Specification.Tests/TestModels/GearsOfWarModel/LocustHorde.cs @@ -8,6 +8,7 @@ namespace Microsoft.EntityFrameworkCore.TestModels.GearsOfWarModel; public class LocustHorde : Faction { public LocustCommander Commander { get; set; } + public LocustLeader DeputyCommander { get; set; } public List Leaders { get; set; } public string CommanderName { get; set; } diff --git a/src/efcore/test/EFCore.SqlServer.FunctionalTests/Query/GearsOfWarQuerySqlServerTest.cs b/src/efcore/test/EFCore.SqlServer.FunctionalTests/Query/GearsOfWarQuerySqlServerTest.cs index 48c87e39da4..04a021ecb67 100644 --- a/src/efcore/test/EFCore.SqlServer.FunctionalTests/Query/GearsOfWarQuerySqlServerTest.cs +++ b/src/efcore/test/EFCore.SqlServer.FunctionalTests/Query/GearsOfWarQuerySqlServerTest.cs @@ -992,6 +992,61 @@ CROSS JOIN [Tags] AS [t0] """); } + public override async Task Conditional_Navigation_With_Trivial_Member_Access(bool async) + { + await base.Conditional_Navigation_With_Trivial_Member_Access(async); + + AssertSql( + """ +SELECT [g].[Nickname] +FROM [Gears] AS [g] +LEFT JOIN [Cities] AS [c] ON [g].[AssignedCityName] = [c].[Name] +INNER JOIN [Cities] AS [c0] ON [g].[CityOfBirthName] = [c0].[Name] +WHERE CASE + WHEN [c].[Name] IS NOT NULL THEN [c].[Name] + ELSE [c0].[Name] +END <> N'Ephyra' +"""); + } + + public override async Task Conditional_Navigation_With_Member_Access_On_Same_Type(bool async) + { + await base.Conditional_Navigation_With_Member_Access_On_Same_Type(async); + + AssertSql( + """ +SELECT [g].[Nickname], [g].[FullName] +FROM [Gears] AS [g] +LEFT JOIN [Cities] AS [c] ON [g].[AssignedCityName] = [c].[Name] +INNER JOIN [Cities] AS [c0] ON [g].[CityOfBirthName] = [c0].[Name] +WHERE CASE + WHEN [c].[Name] IS NOT NULL THEN [c].[Nation] + ELSE [c0].[Nation] +END = N'Tyrus' +"""); + } + + public override async Task Conditional_Navigation_With_Member_Access_On_Related_Types(bool async) + { + await base.Conditional_Navigation_With_Member_Access_On_Related_Types(async); + + AssertSql( + """ +SELECT [f].[Name] +FROM [Factions] AS [f] +LEFT JOIN [LocustLeaders] AS [l] ON [f].[DeputyCommanderName] = [l].[Name] +LEFT JOIN ( + SELECT [l0].[Name], [l0].[ThreatLevel] + FROM [LocustLeaders] AS [l0] + WHERE [l0].[Discriminator] = N'LocustCommander' +) AS [l1] ON [f].[CommanderName] = [l1].[Name] +WHERE CASE + WHEN [l].[Name] IS NOT NULL THEN [l].[ThreatLevel] + ELSE [l1].[ThreatLevel] +END = CAST(4 AS smallint) +"""); + } + public override async Task Select_Singleton_Navigation_With_Member_Access(bool async) { await base.Select_Singleton_Navigation_With_Member_Access(async); @@ -2793,7 +2848,7 @@ public override async Task Member_access_on_derived_materialized_entity_using_ca AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] AS [f] ORDER BY [f].[Name] """); @@ -2846,7 +2901,7 @@ public override async Task Navigation_access_on_derived_materialized_entity_usin AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated], [l0].[ThreatLevel] AS [Threat] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated], [l0].[ThreatLevel] AS [Threat] FROM [Factions] AS [f] LEFT JOIN ( SELECT [l].[Name], [l].[ThreatLevel] @@ -2925,7 +2980,7 @@ public override async Task Include_on_derived_entity_using_OfType(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated], [l0].[Name], [l0].[Discriminator], [l0].[LocustHordeId], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [l1].[Name], [l1].[Discriminator], [l1].[LocustHordeId], [l1].[ThreatLevel], [l1].[ThreatLevelByte], [l1].[ThreatLevelNullableByte], [l1].[DefeatedByNickname], [l1].[DefeatedBySquadId], [l1].[HighCommandId] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated], [l0].[Name], [l0].[Discriminator], [l0].[LocustHordeId], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [l1].[Name], [l1].[Discriminator], [l1].[LocustHordeId], [l1].[ThreatLevel], [l1].[ThreatLevelByte], [l1].[ThreatLevelNullableByte], [l1].[DefeatedByNickname], [l1].[DefeatedBySquadId], [l1].[HighCommandId] FROM [Factions] AS [f] LEFT JOIN ( SELECT [l].[Name], [l].[Discriminator], [l].[LocustHordeId], [l].[ThreatLevel], [l].[ThreatLevelByte], [l].[ThreatLevelNullableByte], [l].[DefeatedByNickname], [l].[DefeatedBySquadId], [l].[HighCommandId] @@ -3286,7 +3341,7 @@ public override async Task ThenInclude_collection_on_derived_after_derived_refer AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated], [l0].[Name], [l0].[Discriminator], [l0].[LocustHordeId], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[Rank] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated], [l0].[Name], [l0].[Discriminator], [l0].[LocustHordeId], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[Rank] FROM [Factions] AS [f] LEFT JOIN ( SELECT [l].[Name], [l].[Discriminator], [l].[LocustHordeId], [l].[ThreatLevel], [l].[ThreatLevelByte], [l].[ThreatLevelNullableByte], [l].[DefeatedByNickname], [l].[DefeatedBySquadId], [l].[HighCommandId] @@ -3322,7 +3377,7 @@ public override async Task ThenInclude_reference_on_derived_after_derived_collec AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated], [s].[Name], [s].[Discriminator], [s].[LocustHordeId], [s].[ThreatLevel], [s].[ThreatLevelByte], [s].[ThreatLevelNullableByte], [s].[DefeatedByNickname], [s].[DefeatedBySquadId], [s].[HighCommandId], [s].[Nickname], [s].[SquadId], [s].[AssignedCityName], [s].[CityOfBirthName], [s].[Discriminator0], [s].[FullName], [s].[HasSoulPatch], [s].[LeaderNickname], [s].[LeaderSquadId], [s].[Rank] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated], [s].[Name], [s].[Discriminator], [s].[LocustHordeId], [s].[ThreatLevel], [s].[ThreatLevelByte], [s].[ThreatLevelNullableByte], [s].[DefeatedByNickname], [s].[DefeatedBySquadId], [s].[HighCommandId], [s].[Nickname], [s].[SquadId], [s].[AssignedCityName], [s].[CityOfBirthName], [s].[Discriminator0], [s].[FullName], [s].[HasSoulPatch], [s].[LeaderNickname], [s].[LeaderSquadId], [s].[Rank] FROM [Factions] AS [f] LEFT JOIN ( SELECT [l].[Name], [l].[Discriminator], [l].[LocustHordeId], [l].[ThreatLevel], [l].[ThreatLevelByte], [l].[ThreatLevelNullableByte], [l].[DefeatedByNickname], [l].[DefeatedBySquadId], [l].[HighCommandId], [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator] AS [Discriminator0], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank] @@ -3339,7 +3394,7 @@ public override async Task Multiple_derived_included_on_one_method(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated], [l0].[Name], [l0].[Discriminator], [l0].[LocustHordeId], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[Rank] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated], [l0].[Name], [l0].[Discriminator], [l0].[LocustHordeId], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[Rank] FROM [Factions] AS [f] LEFT JOIN ( SELECT [l].[Name], [l].[Discriminator], [l].[LocustHordeId], [l].[ThreatLevel], [l].[ThreatLevelByte], [l].[ThreatLevelNullableByte], [l].[DefeatedByNickname], [l].[DefeatedBySquadId], [l].[HighCommandId] @@ -4460,10 +4515,10 @@ public override async Task Null_semantics_on_nullable_bool_from_inner_join_subqu AssertSql( """ -SELECT [f0].[Id], [f0].[CapitalName], [f0].[Discriminator], [f0].[Name], [f0].[ServerAddress], [f0].[CommanderName], [f0].[Eradicated] +SELECT [f0].[Id], [f0].[CapitalName], [f0].[Discriminator], [f0].[Name], [f0].[ServerAddress], [f0].[CommanderName], [f0].[DeputyCommanderName], [f0].[Eradicated] FROM [LocustLeaders] AS [l] INNER JOIN ( - SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] + SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] AS [f] WHERE [f].[Name] = N'Swarm' ) AS [f0] ON [l].[Name] = [f0].[CommanderName] @@ -4477,10 +4532,10 @@ public override async Task Null_semantics_on_nullable_bool_from_left_join_subque AssertSql( """ -SELECT [f0].[Id], [f0].[CapitalName], [f0].[Discriminator], [f0].[Name], [f0].[ServerAddress], [f0].[CommanderName], [f0].[Eradicated] +SELECT [f0].[Id], [f0].[CapitalName], [f0].[Discriminator], [f0].[Name], [f0].[ServerAddress], [f0].[CommanderName], [f0].[DeputyCommanderName], [f0].[Eradicated] FROM [LocustLeaders] AS [l] LEFT JOIN ( - SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] + SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] AS [f] WHERE [f].[Name] = N'Swarm' ) AS [f0] ON [l].[Name] = [f0].[CommanderName] @@ -5756,9 +5811,7 @@ SELECT CASE END FROM [Gears] AS [g] ORDER BY CASE - WHEN CASE - WHEN [g].[LeaderNickname] IS NOT NULL THEN ~CAST(CAST(LEN([g].[Nickname]) AS int) ^ 5 AS bit) - END IS NOT NULL THEN CAST(1 AS bit) + WHEN [g].[LeaderNickname] IS NOT NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END """); @@ -5978,7 +6031,7 @@ public override async Task Nav_rewrite_with_convert2(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] AS [f] LEFT JOIN [Cities] AS [c] ON [f].[CapitalName] = [c].[Name] LEFT JOIN ( @@ -5996,7 +6049,7 @@ public override async Task Nav_rewrite_with_convert3(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] AS [f] LEFT JOIN [Cities] AS [c] ON [f].[CapitalName] = [c].[Name] LEFT JOIN ( @@ -6288,7 +6341,7 @@ public override async Task Navigation_based_on_complex_expression1(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] AS [f] LEFT JOIN ( SELECT [l].[Name] @@ -6305,7 +6358,7 @@ public override async Task Navigation_based_on_complex_expression2(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] AS [f] LEFT JOIN ( SELECT [l].[Name] @@ -8283,7 +8336,7 @@ public override async Task Comparison_with_value_converted_subclass(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] AS [f] WHERE [f].[ServerAddress] = CAST(N'127.0.0.1' AS nvarchar(45)) """); @@ -8347,7 +8400,7 @@ public override async Task Project_navigation_defined_on_derived_from_entity_wit SELECT [l].[Name], [l].[Discriminator], [l].[LocustHordeId], [l].[ThreatLevel], [l].[ThreatLevelByte], [l].[ThreatLevelNullableByte], [l].[DefeatedByNickname], [l].[DefeatedBySquadId], [l].[HighCommandId], [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[Rank], CASE WHEN [g].[Nickname] IS NULL OR [g].[SquadId] IS NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) -END AS [IsNull], [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated], CASE +END AS [IsNull], [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated], CASE WHEN [f].[Id] IS NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END AS [IsNull], [l0].[Id], [l0].[IsOperational], [l0].[Name], CASE @@ -8457,7 +8510,7 @@ public override async Task Include_after_Select_throws(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated], [c].[Name], [c].[Location], [c].[Nation] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated], [c].[Name], [c].[Location], [c].[Nation] FROM [Factions] AS [f] LEFT JOIN [Cities] AS [c] ON [f].[CapitalName] = [c].[Name] """); @@ -8525,7 +8578,7 @@ public override async Task Include_on_derived_entity_with_cast(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated], [c].[Name], [c].[Location], [c].[Nation] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated], [c].[Name], [c].[Location], [c].[Nation] FROM [Factions] AS [f] LEFT JOIN [Cities] AS [c] ON [f].[CapitalName] = [c].[Name] ORDER BY [f].[Id] @@ -8591,7 +8644,7 @@ public override async Task Project_derivied_entity_with_convert_to_parent(bool a AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] AS [f] """); } diff --git a/src/efcore/test/EFCore.SqlServer.FunctionalTests/Query/TPCGearsOfWarQuerySqlServerTest.cs b/src/efcore/test/EFCore.SqlServer.FunctionalTests/Query/TPCGearsOfWarQuerySqlServerTest.cs index dab41cd54b4..58c359ea089 100644 --- a/src/efcore/test/EFCore.SqlServer.FunctionalTests/Query/TPCGearsOfWarQuerySqlServerTest.cs +++ b/src/efcore/test/EFCore.SqlServer.FunctionalTests/Query/TPCGearsOfWarQuerySqlServerTest.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.TestModels.GearsOfWarModel; @@ -1366,6 +1366,75 @@ FROM [Officers] AS [o0] """); } + public override async Task Conditional_Navigation_With_Trivial_Member_Access(bool async) + { + await base.Conditional_Navigation_With_Trivial_Member_Access(async); + + AssertSql( + """ +SELECT [u].[Nickname] +FROM ( + SELECT [g].[Nickname], [g].[AssignedCityName], [g].[CityOfBirthName] + FROM [Gears] AS [g] + UNION ALL + SELECT [o].[Nickname], [o].[AssignedCityName], [o].[CityOfBirthName] + FROM [Officers] AS [o] +) AS [u] +LEFT JOIN [Cities] AS [c] ON [u].[AssignedCityName] = [c].[Name] +INNER JOIN [Cities] AS [c0] ON [u].[CityOfBirthName] = [c0].[Name] +WHERE CASE + WHEN [c].[Name] IS NOT NULL THEN [c].[Name] + ELSE [c0].[Name] +END <> N'Ephyra' +"""); + } + + public override async Task Conditional_Navigation_With_Member_Access_On_Same_Type(bool async) + { + await base.Conditional_Navigation_With_Member_Access_On_Same_Type(async); + + AssertSql( + """ +SELECT [u].[Nickname], [u].[FullName] +FROM ( + SELECT [g].[Nickname], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[FullName] + FROM [Gears] AS [g] + UNION ALL + SELECT [o].[Nickname], [o].[AssignedCityName], [o].[CityOfBirthName], [o].[FullName] + FROM [Officers] AS [o] +) AS [u] +LEFT JOIN [Cities] AS [c] ON [u].[AssignedCityName] = [c].[Name] +INNER JOIN [Cities] AS [c0] ON [u].[CityOfBirthName] = [c0].[Name] +WHERE CASE + WHEN [c].[Name] IS NOT NULL THEN [c].[Nation] + ELSE [c0].[Nation] +END = N'Tyrus' +"""); + } + + public override async Task Conditional_Navigation_With_Member_Access_On_Related_Types(bool async) + { + await base.Conditional_Navigation_With_Member_Access_On_Related_Types(async); + + AssertSql( + """ +SELECT [l].[Name] +FROM [LocustHordes] AS [l] +LEFT JOIN ( + SELECT [l0].[Name], [l0].[ThreatLevel] + FROM [LocustLeaders] AS [l0] + UNION ALL + SELECT [l1].[Name], [l1].[ThreatLevel] + FROM [LocustCommanders] AS [l1] +) AS [u] ON [l].[DeputyCommanderName] = [u].[Name] +LEFT JOIN [LocustCommanders] AS [l2] ON [l].[CommanderName] = [l2].[Name] +WHERE CASE + WHEN [u].[Name] IS NOT NULL THEN [u].[ThreatLevel] + ELSE [l2].[ThreatLevel] +END = CAST(4 AS smallint) +"""); + } + public override async Task Select_Singleton_Navigation_With_Member_Access(bool async) { await base.Select_Singleton_Navigation_With_Member_Access(async); @@ -3762,7 +3831,7 @@ public override async Task Member_access_on_derived_materialized_entity_using_ca AssertSql( """ -SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[Eradicated] +SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated] FROM [LocustHordes] AS [l] ORDER BY [l].[Name] """); @@ -3811,7 +3880,7 @@ public override async Task Navigation_access_on_derived_materialized_entity_usin AssertSql( """ -SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[Eradicated], [l0].[ThreatLevel] AS [Threat] +SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], [l0].[ThreatLevel] AS [Threat] FROM [LocustHordes] AS [l] LEFT JOIN [LocustCommanders] AS [l0] ON [l].[CommanderName] = [l0].[Name] ORDER BY [l].[Name] @@ -3890,7 +3959,7 @@ public override async Task Include_on_derived_entity_using_OfType(bool async) AssertSql( """ -SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[Eradicated], [l0].[Name], [l0].[LocustHordeId], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [u].[Name], [u].[LocustHordeId], [u].[ThreatLevel], [u].[ThreatLevelByte], [u].[ThreatLevelNullableByte], [u].[DefeatedByNickname], [u].[DefeatedBySquadId], [u].[HighCommandId], [u].[Discriminator] +SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], [l0].[Name], [l0].[LocustHordeId], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [u].[Name], [u].[LocustHordeId], [u].[ThreatLevel], [u].[ThreatLevelByte], [u].[ThreatLevelNullableByte], [u].[DefeatedByNickname], [u].[DefeatedBySquadId], [u].[HighCommandId], [u].[Discriminator] FROM [LocustHordes] AS [l] LEFT JOIN [LocustCommanders] AS [l0] ON [l].[CommanderName] = [l0].[Name] LEFT JOIN ( @@ -4439,7 +4508,7 @@ public override async Task ThenInclude_collection_on_derived_after_derived_refer AssertSql( """ -SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[Eradicated], [l0].[Name], [l0].[LocustHordeId], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [u].[Nickname], [u].[SquadId], [u].[AssignedCityName], [u].[CityOfBirthName], [u].[FullName], [u].[HasSoulPatch], [u].[LeaderNickname], [u].[LeaderSquadId], [u].[Rank], [u].[Discriminator], [u0].[Nickname], [u0].[SquadId], [u0].[AssignedCityName], [u0].[CityOfBirthName], [u0].[FullName], [u0].[HasSoulPatch], [u0].[LeaderNickname], [u0].[LeaderSquadId], [u0].[Rank], [u0].[Discriminator] +SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], [l0].[Name], [l0].[LocustHordeId], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [u].[Nickname], [u].[SquadId], [u].[AssignedCityName], [u].[CityOfBirthName], [u].[FullName], [u].[HasSoulPatch], [u].[LeaderNickname], [u].[LeaderSquadId], [u].[Rank], [u].[Discriminator], [u0].[Nickname], [u0].[SquadId], [u0].[AssignedCityName], [u0].[CityOfBirthName], [u0].[FullName], [u0].[HasSoulPatch], [u0].[LeaderNickname], [u0].[LeaderSquadId], [u0].[Rank], [u0].[Discriminator] FROM [LocustHordes] AS [l] LEFT JOIN [LocustCommanders] AS [l0] ON [l].[CommanderName] = [l0].[Name] LEFT JOIN ( @@ -4501,7 +4570,7 @@ public override async Task ThenInclude_reference_on_derived_after_derived_collec AssertSql( """ -SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[Eradicated], [s].[Name], [s].[LocustHordeId], [s].[ThreatLevel], [s].[ThreatLevelByte], [s].[ThreatLevelNullableByte], [s].[DefeatedByNickname], [s].[DefeatedBySquadId], [s].[HighCommandId], [s].[Discriminator], [s].[Nickname], [s].[SquadId], [s].[AssignedCityName], [s].[CityOfBirthName], [s].[FullName], [s].[HasSoulPatch], [s].[LeaderNickname], [s].[LeaderSquadId], [s].[Rank], [s].[Discriminator0] +SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], [s].[Name], [s].[LocustHordeId], [s].[ThreatLevel], [s].[ThreatLevelByte], [s].[ThreatLevelNullableByte], [s].[DefeatedByNickname], [s].[DefeatedBySquadId], [s].[HighCommandId], [s].[Discriminator], [s].[Nickname], [s].[SquadId], [s].[AssignedCityName], [s].[CityOfBirthName], [s].[FullName], [s].[HasSoulPatch], [s].[LeaderNickname], [s].[LeaderSquadId], [s].[Rank], [s].[Discriminator0] FROM [LocustHordes] AS [l] LEFT JOIN ( SELECT [u].[Name], [u].[LocustHordeId], [u].[ThreatLevel], [u].[ThreatLevelByte], [u].[ThreatLevelNullableByte], [u].[DefeatedByNickname], [u].[DefeatedBySquadId], [u].[HighCommandId], [u].[Discriminator], [u0].[Nickname], [u0].[SquadId], [u0].[AssignedCityName], [u0].[CityOfBirthName], [u0].[FullName], [u0].[HasSoulPatch], [u0].[LeaderNickname], [u0].[LeaderSquadId], [u0].[Rank], [u0].[Discriminator] AS [Discriminator0] @@ -4530,7 +4599,7 @@ public override async Task Multiple_derived_included_on_one_method(bool async) AssertSql( """ -SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[Eradicated], [l0].[Name], [l0].[LocustHordeId], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [u].[Nickname], [u].[SquadId], [u].[AssignedCityName], [u].[CityOfBirthName], [u].[FullName], [u].[HasSoulPatch], [u].[LeaderNickname], [u].[LeaderSquadId], [u].[Rank], [u].[Discriminator], [u0].[Nickname], [u0].[SquadId], [u0].[AssignedCityName], [u0].[CityOfBirthName], [u0].[FullName], [u0].[HasSoulPatch], [u0].[LeaderNickname], [u0].[LeaderSquadId], [u0].[Rank], [u0].[Discriminator] +SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], [l0].[Name], [l0].[LocustHordeId], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [u].[Nickname], [u].[SquadId], [u].[AssignedCityName], [u].[CityOfBirthName], [u].[FullName], [u].[HasSoulPatch], [u].[LeaderNickname], [u].[LeaderSquadId], [u].[Rank], [u].[Discriminator], [u0].[Nickname], [u0].[SquadId], [u0].[AssignedCityName], [u0].[CityOfBirthName], [u0].[FullName], [u0].[HasSoulPatch], [u0].[LeaderNickname], [u0].[LeaderSquadId], [u0].[Rank], [u0].[Discriminator] FROM [LocustHordes] AS [l] LEFT JOIN [LocustCommanders] AS [l0] ON [l].[CommanderName] = [l0].[Name] LEFT JOIN ( @@ -6059,7 +6128,7 @@ public override async Task Null_semantics_on_nullable_bool_from_inner_join_subqu AssertSql( """ -SELECT [l2].[Id], [l2].[CapitalName], [l2].[Name], [l2].[ServerAddress], [l2].[CommanderName], [l2].[Eradicated] +SELECT [l2].[Id], [l2].[CapitalName], [l2].[Name], [l2].[ServerAddress], [l2].[CommanderName], [l2].[DeputyCommanderName], [l2].[Eradicated] FROM ( SELECT [l].[Name] FROM [LocustLeaders] AS [l] @@ -6068,7 +6137,7 @@ SELECT [l0].[Name] FROM [LocustCommanders] AS [l0] ) AS [u] INNER JOIN ( - SELECT [l1].[Id], [l1].[CapitalName], [l1].[Name], [l1].[ServerAddress], [l1].[CommanderName], [l1].[Eradicated] + SELECT [l1].[Id], [l1].[CapitalName], [l1].[Name], [l1].[ServerAddress], [l1].[CommanderName], [l1].[DeputyCommanderName], [l1].[Eradicated] FROM [LocustHordes] AS [l1] WHERE [l1].[Name] = N'Swarm' ) AS [l2] ON [u].[Name] = [l2].[CommanderName] @@ -6082,7 +6151,7 @@ public override async Task Null_semantics_on_nullable_bool_from_left_join_subque AssertSql( """ -SELECT [l2].[Id], [l2].[CapitalName], [l2].[Name], [l2].[ServerAddress], [l2].[CommanderName], [l2].[Eradicated] +SELECT [l2].[Id], [l2].[CapitalName], [l2].[Name], [l2].[ServerAddress], [l2].[CommanderName], [l2].[DeputyCommanderName], [l2].[Eradicated] FROM ( SELECT [l].[Name] FROM [LocustLeaders] AS [l] @@ -6091,7 +6160,7 @@ SELECT [l0].[Name] FROM [LocustCommanders] AS [l0] ) AS [u] LEFT JOIN ( - SELECT [l1].[Id], [l1].[CapitalName], [l1].[Name], [l1].[ServerAddress], [l1].[CommanderName], [l1].[Eradicated] + SELECT [l1].[Id], [l1].[CapitalName], [l1].[Name], [l1].[ServerAddress], [l1].[CommanderName], [l1].[DeputyCommanderName], [l1].[Eradicated] FROM [LocustHordes] AS [l1] WHERE [l1].[Name] = N'Swarm' ) AS [l2] ON [u].[Name] = [l2].[CommanderName] @@ -7823,9 +7892,7 @@ UNION ALL FROM [Officers] AS [o] ) AS [u] ORDER BY CASE - WHEN CASE - WHEN [u].[LeaderNickname] IS NOT NULL THEN ~CAST(CAST(LEN([u].[Nickname]) AS int) ^ 5 AS bit) - END IS NOT NULL THEN CAST(1 AS bit) + WHEN [u].[LeaderNickname] IS NOT NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END """); @@ -8074,7 +8141,7 @@ public override async Task Nav_rewrite_with_convert2(bool async) AssertSql( """ -SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[Eradicated] +SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated] FROM [LocustHordes] AS [l] LEFT JOIN [Cities] AS [c] ON [l].[CapitalName] = [c].[Name] LEFT JOIN [LocustCommanders] AS [l0] ON [l].[CommanderName] = [l0].[Name] @@ -8088,7 +8155,7 @@ public override async Task Nav_rewrite_with_convert3(bool async) AssertSql( """ -SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[Eradicated] +SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated] FROM [LocustHordes] AS [l] LEFT JOIN [Cities] AS [c] ON [l].[CapitalName] = [c].[Name] LEFT JOIN [LocustCommanders] AS [l0] ON [l].[CommanderName] = [l0].[Name] @@ -8448,7 +8515,7 @@ public override async Task Navigation_based_on_complex_expression1(bool async) AssertSql( """ -SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[Eradicated] +SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated] FROM [LocustHordes] AS [l] LEFT JOIN [LocustCommanders] AS [l0] ON [l].[CommanderName] = [l0].[Name] WHERE [l0].[Name] IS NOT NULL @@ -8461,7 +8528,7 @@ public override async Task Navigation_based_on_complex_expression2(bool async) AssertSql( """ -SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[Eradicated] +SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated] FROM [LocustHordes] AS [l] LEFT JOIN [LocustCommanders] AS [l0] ON [l].[CommanderName] = [l0].[Name] WHERE [l0].[Name] IS NOT NULL @@ -10718,7 +10785,7 @@ public override async Task Project_navigation_defined_on_derived_from_entity_wit SELECT [u].[Name], [u].[LocustHordeId], [u].[ThreatLevel], [u].[ThreatLevelByte], [u].[ThreatLevelNullableByte], [u].[DefeatedByNickname], [u].[DefeatedBySquadId], [u].[HighCommandId], [u].[Discriminator], [u0].[Nickname], [u0].[SquadId], [u0].[AssignedCityName], [u0].[CityOfBirthName], [u0].[FullName], [u0].[HasSoulPatch], [u0].[LeaderNickname], [u0].[LeaderSquadId], [u0].[Rank], [u0].[Discriminator], CASE WHEN [u0].[Nickname] IS NULL OR [u0].[SquadId] IS NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) -END AS [IsNull], [l1].[Id], [l1].[CapitalName], [l1].[Name], [l1].[ServerAddress], [l1].[CommanderName], [l1].[Eradicated], CASE +END AS [IsNull], [l1].[Id], [l1].[CapitalName], [l1].[Name], [l1].[ServerAddress], [l1].[CommanderName], [l1].[DeputyCommanderName], [l1].[Eradicated], CASE WHEN [l1].[Id] IS NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END AS [IsNull], [l2].[Id], [l2].[IsOperational], [l2].[Name], CASE @@ -11044,7 +11111,7 @@ public override async Task Comparison_with_value_converted_subclass(bool async) AssertSql( """ -SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[Eradicated] +SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated] FROM [LocustHordes] AS [l] WHERE [l].[ServerAddress] = CAST(N'127.0.0.1' AS nvarchar(45)) """); @@ -11160,7 +11227,7 @@ public override async Task Include_after_Select_throws(bool async) AssertSql( """ -SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[Eradicated], [c].[Name], [c].[Location], [c].[Nation] +SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], [c].[Name], [c].[Location], [c].[Nation] FROM [LocustHordes] AS [l] LEFT JOIN [Cities] AS [c] ON [l].[CapitalName] = [c].[Name] """); @@ -11259,7 +11326,7 @@ public override async Task Project_derivied_entity_with_convert_to_parent(bool a AssertSql( """ -SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[Eradicated] +SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated] FROM [LocustHordes] AS [l] """); } @@ -11437,7 +11504,7 @@ public override async Task Include_on_derived_entity_with_cast(bool async) AssertSql( """ -SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[Eradicated], [c].[Name], [c].[Location], [c].[Nation] +SELECT [l].[Id], [l].[CapitalName], [l].[Name], [l].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], [c].[Name], [c].[Location], [c].[Nation] FROM [LocustHordes] AS [l] LEFT JOIN [Cities] AS [c] ON [l].[CapitalName] = [c].[Name] ORDER BY [l].[Id] diff --git a/src/efcore/test/EFCore.SqlServer.FunctionalTests/Query/TPTGearsOfWarQuerySqlServerTest.cs b/src/efcore/test/EFCore.SqlServer.FunctionalTests/Query/TPTGearsOfWarQuerySqlServerTest.cs index 433caeeebc2..fe4f8f88245 100644 --- a/src/efcore/test/EFCore.SqlServer.FunctionalTests/Query/TPTGearsOfWarQuerySqlServerTest.cs +++ b/src/efcore/test/EFCore.SqlServer.FunctionalTests/Query/TPTGearsOfWarQuerySqlServerTest.cs @@ -1184,6 +1184,65 @@ FROM [Gears] AS [g0] """); } + public override async Task Conditional_Navigation_With_Trivial_Member_Access(bool async) + { + await base.Conditional_Navigation_With_Trivial_Member_Access(async); + + AssertSql( + """ +SELECT [g].[Nickname] +FROM [Gears] AS [g] +LEFT JOIN [Cities] AS [c] ON [g].[AssignedCityName] = [c].[Name] +INNER JOIN [Cities] AS [c0] ON [g].[CityOfBirthName] = [c0].[Name] +WHERE CASE + WHEN [c].[Name] IS NOT NULL THEN [c].[Name] + ELSE [c0].[Name] +END <> N'Ephyra' +"""); + } + + public override async Task Conditional_Navigation_With_Member_Access_On_Same_Type(bool async) + { + await base.Conditional_Navigation_With_Member_Access_On_Same_Type(async); + + AssertSql( + """ +SELECT [g].[Nickname], [g].[FullName] +FROM [Gears] AS [g] +LEFT JOIN [Cities] AS [c] ON [g].[AssignedCityName] = [c].[Name] +INNER JOIN [Cities] AS [c0] ON [g].[CityOfBirthName] = [c0].[Name] +WHERE CASE + WHEN [c].[Name] IS NOT NULL THEN [c].[Nation] + ELSE [c0].[Nation] +END = N'Tyrus' +"""); + } + + public override async Task Conditional_Navigation_With_Member_Access_On_Related_Types(bool async) + { + await base.Conditional_Navigation_With_Member_Access_On_Related_Types(async); + + AssertSql( + """ +SELECT [f].[Name] +FROM [Factions] AS [f] +INNER JOIN [LocustHordes] AS [l] ON [f].[Id] = [l].[Id] +LEFT JOIN ( + SELECT [l0].[Name], [l0].[ThreatLevel] + FROM [LocustLeaders] AS [l0] +) AS [s] ON [l].[DeputyCommanderName] = [s].[Name] +LEFT JOIN ( + SELECT [l1].[Name], [l1].[ThreatLevel] + FROM [LocustLeaders] AS [l1] + INNER JOIN [LocustCommanders] AS [l2] ON [l1].[Name] = [l2].[Name] +) AS [s0] ON [l].[CommanderName] = [s0].[Name] +WHERE CASE + WHEN [s].[Name] IS NOT NULL THEN [s].[ThreatLevel] + ELSE [s0].[ThreatLevel] +END = CAST(4 AS smallint) +"""); + } + public override async Task Select_Singleton_Navigation_With_Member_Access(bool async) { await base.Select_Singleton_Navigation_With_Member_Access(async); @@ -3184,7 +3243,7 @@ public override async Task Member_access_on_derived_materialized_entity_using_ca AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[Eradicated], CASE +SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], CASE WHEN [l].[Id] IS NOT NULL THEN N'LocustHorde' END AS [Discriminator] FROM [Factions] AS [f] @@ -3247,7 +3306,7 @@ public override async Task Navigation_access_on_derived_materialized_entity_usin AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[Eradicated], CASE +SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], CASE WHEN [l].[Id] IS NOT NULL THEN N'LocustHorde' END AS [Discriminator], [s].[ThreatLevel] AS [Threat] FROM [Factions] AS [f] @@ -3341,7 +3400,7 @@ public override async Task Include_on_derived_entity_using_OfType(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[Eradicated], CASE +SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], CASE WHEN [l].[Id] IS NOT NULL THEN N'LocustHorde' END AS [Discriminator], [s].[Name], [s].[LocustHordeId], [s].[ThreatLevel], [s].[ThreatLevelByte], [s].[ThreatLevelNullableByte], [s].[DefeatedByNickname], [s].[DefeatedBySquadId], [s].[HighCommandId], [s0].[Name], [s0].[LocustHordeId], [s0].[ThreatLevel], [s0].[ThreatLevelByte], [s0].[ThreatLevelNullableByte], [s0].[DefeatedByNickname], [s0].[DefeatedBySquadId], [s0].[HighCommandId], [s0].[Discriminator] FROM [Factions] AS [f] @@ -3865,7 +3924,7 @@ public override async Task ThenInclude_collection_on_derived_after_derived_refer AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[Eradicated], CASE +SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], CASE WHEN [l].[Id] IS NOT NULL THEN N'LocustHorde' END AS [Discriminator], [s].[Name], [s].[LocustHordeId], [s].[ThreatLevel], [s].[ThreatLevelByte], [s].[ThreatLevelNullableByte], [s].[DefeatedByNickname], [s].[DefeatedBySquadId], [s].[HighCommandId], [s0].[Nickname], [s0].[SquadId], [s0].[AssignedCityName], [s0].[CityOfBirthName], [s0].[FullName], [s0].[HasSoulPatch], [s0].[LeaderNickname], [s0].[LeaderSquadId], [s0].[Rank], [s0].[Discriminator], [s1].[Nickname], [s1].[SquadId], [s1].[AssignedCityName], [s1].[CityOfBirthName], [s1].[FullName], [s1].[HasSoulPatch], [s1].[LeaderNickname], [s1].[LeaderSquadId], [s1].[Rank], [s1].[Discriminator] FROM [Factions] AS [f] @@ -3928,7 +3987,7 @@ public override async Task ThenInclude_reference_on_derived_after_derived_collec AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[Eradicated], CASE +SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], CASE WHEN [l].[Id] IS NOT NULL THEN N'LocustHorde' END AS [Discriminator], [s0].[Name], [s0].[LocustHordeId], [s0].[ThreatLevel], [s0].[ThreatLevelByte], [s0].[ThreatLevelNullableByte], [s0].[DefeatedByNickname], [s0].[DefeatedBySquadId], [s0].[HighCommandId], [s0].[Discriminator], [s0].[Nickname], [s0].[SquadId], [s0].[AssignedCityName], [s0].[CityOfBirthName], [s0].[FullName], [s0].[HasSoulPatch], [s0].[LeaderNickname], [s0].[LeaderSquadId], [s0].[Rank], [s0].[Discriminator0] FROM [Factions] AS [f] @@ -3957,7 +4016,7 @@ public override async Task Multiple_derived_included_on_one_method(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[Eradicated], CASE +SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], CASE WHEN [l].[Id] IS NOT NULL THEN N'LocustHorde' END AS [Discriminator], [s].[Name], [s].[LocustHordeId], [s].[ThreatLevel], [s].[ThreatLevelByte], [s].[ThreatLevelNullableByte], [s].[DefeatedByNickname], [s].[DefeatedBySquadId], [s].[HighCommandId], [s0].[Nickname], [s0].[SquadId], [s0].[AssignedCityName], [s0].[CityOfBirthName], [s0].[FullName], [s0].[HasSoulPatch], [s0].[LeaderNickname], [s0].[LeaderSquadId], [s0].[Rank], [s0].[Discriminator], [s1].[Nickname], [s1].[SquadId], [s1].[AssignedCityName], [s1].[CityOfBirthName], [s1].[FullName], [s1].[HasSoulPatch], [s1].[LeaderNickname], [s1].[LeaderSquadId], [s1].[Rank], [s1].[Discriminator] FROM [Factions] AS [f] @@ -5145,10 +5204,10 @@ public override async Task Null_semantics_on_nullable_bool_from_inner_join_subqu AssertSql( """ -SELECT [s].[Id], [s].[CapitalName], [s].[Name], [s].[ServerAddress], [s].[CommanderName], [s].[Eradicated], [s].[Discriminator] +SELECT [s].[Id], [s].[CapitalName], [s].[Name], [s].[ServerAddress], [s].[CommanderName], [s].[DeputyCommanderName], [s].[Eradicated], [s].[Discriminator] FROM [LocustLeaders] AS [l] INNER JOIN ( - SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l0].[CommanderName], [l0].[Eradicated], CASE + SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l0].[CommanderName], [l0].[DeputyCommanderName], [l0].[Eradicated], CASE WHEN [l0].[Id] IS NOT NULL THEN N'LocustHorde' END AS [Discriminator] FROM [Factions] AS [f] @@ -5165,10 +5224,10 @@ public override async Task Null_semantics_on_nullable_bool_from_left_join_subque AssertSql( """ -SELECT [s].[Id], [s].[CapitalName], [s].[Name], [s].[ServerAddress], [s].[CommanderName], [s].[Eradicated], [s].[Discriminator] +SELECT [s].[Id], [s].[CapitalName], [s].[Name], [s].[ServerAddress], [s].[CommanderName], [s].[DeputyCommanderName], [s].[Eradicated], [s].[Discriminator] FROM [LocustLeaders] AS [l] LEFT JOIN ( - SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l0].[CommanderName], [l0].[Eradicated], CASE + SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l0].[CommanderName], [l0].[DeputyCommanderName], [l0].[Eradicated], CASE WHEN [l0].[Id] IS NOT NULL THEN N'LocustHorde' END AS [Discriminator] FROM [Factions] AS [f] @@ -6563,9 +6622,7 @@ SELECT CASE END FROM [Gears] AS [g] ORDER BY CASE - WHEN CASE - WHEN [g].[LeaderNickname] IS NOT NULL THEN ~CAST(CAST(LEN([g].[Nickname]) AS int) ^ 5 AS bit) - END IS NOT NULL THEN CAST(1 AS bit) + WHEN [g].[LeaderNickname] IS NOT NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END """); @@ -6804,7 +6861,7 @@ public override async Task Nav_rewrite_with_convert2(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[Eradicated], CASE +SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], CASE WHEN [l].[Id] IS NOT NULL THEN N'LocustHorde' END AS [Discriminator] FROM [Factions] AS [f] @@ -6825,7 +6882,7 @@ public override async Task Nav_rewrite_with_convert3(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[Eradicated], CASE +SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], CASE WHEN [l].[Id] IS NOT NULL THEN N'LocustHorde' END AS [Discriminator] FROM [Factions] AS [f] @@ -7141,7 +7198,7 @@ public override async Task Navigation_based_on_complex_expression1(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[Eradicated], CASE +SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], CASE WHEN [l].[Id] IS NOT NULL THEN N'LocustHorde' END AS [Discriminator] FROM [Factions] AS [f] @@ -7164,7 +7221,7 @@ public override async Task Navigation_based_on_complex_expression2(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[Eradicated], CASE +SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], CASE WHEN [l].[Id] IS NOT NULL THEN N'LocustHorde' END AS [Discriminator] FROM [Factions] AS [f] @@ -9056,7 +9113,7 @@ WHEN [l0].[Name] IS NOT NULL THEN N'LocustCommander' END AS [Discriminator], [s].[Nickname], [s].[SquadId], [s].[AssignedCityName], [s].[CityOfBirthName], [s].[FullName], [s].[HasSoulPatch], [s].[LeaderNickname], [s].[LeaderSquadId], [s].[Rank], [s].[Discriminator], CASE WHEN [s].[Nickname] IS NULL OR [s].[SquadId] IS NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) -END AS [IsNull], [s0].[Id], [s0].[CapitalName], [s0].[Name], [s0].[ServerAddress], [s0].[CommanderName], [s0].[Eradicated], CASE +END AS [IsNull], [s0].[Id], [s0].[CapitalName], [s0].[Name], [s0].[ServerAddress], [s0].[CommanderName], [s0].[DeputyCommanderName], [s0].[Eradicated], CASE WHEN [s0].[Id] IS NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END AS [IsNull], [l2].[Id], [l2].[IsOperational], [l2].[Name], CASE @@ -9073,7 +9130,7 @@ FROM [Gears] AS [g] LEFT JOIN [Officers] AS [o] ON [g].[Nickname] = [o].[Nickname] AND [g].[SquadId] = [o].[SquadId] ) AS [s] ON [l0].[DefeatedByNickname] = [s].[Nickname] AND [l0].[DefeatedBySquadId] = [s].[SquadId] LEFT JOIN ( - SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l1].[CommanderName], [l1].[Eradicated] + SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l1].[CommanderName], [l1].[DeputyCommanderName], [l1].[Eradicated] FROM [Factions] AS [f] INNER JOIN [LocustHordes] AS [l1] ON [f].[Id] = [l1].[Id] ) AS [s0] ON [l].[Name] = [s0].[CommanderName] @@ -9333,7 +9390,7 @@ public override async Task Comparison_with_value_converted_subclass(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[Eradicated], CASE +SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], CASE WHEN [l].[Id] IS NOT NULL THEN N'LocustHorde' END AS [Discriminator] FROM [Factions] AS [f] @@ -9459,7 +9516,7 @@ public override async Task Include_after_Select_throws(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[Eradicated], CASE +SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], CASE WHEN [l].[Id] IS NOT NULL THEN N'LocustHorde' END AS [Discriminator], [c].[Name], [c].[Location], [c].[Nation] FROM [Factions] AS [f] @@ -9546,7 +9603,7 @@ public override async Task Project_derivied_entity_with_convert_to_parent(bool a AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[Eradicated], CASE +SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], CASE WHEN [l].[Id] IS NOT NULL THEN N'LocustHorde' END AS [Discriminator] FROM [Factions] AS [f] @@ -9713,7 +9770,7 @@ public override async Task Include_on_derived_entity_with_cast(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[Eradicated], CASE +SELECT [f].[Id], [f].[CapitalName], [f].[Name], [f].[ServerAddress], [l].[CommanderName], [l].[DeputyCommanderName], [l].[Eradicated], CASE WHEN [l].[Id] IS NOT NULL THEN N'LocustHorde' END AS [Discriminator], [c].[Name], [c].[Location], [c].[Nation] FROM [Factions] AS [f] diff --git a/src/efcore/test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs b/src/efcore/test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs index df6e31c2bed..b8f09ac6bb8 100644 --- a/src/efcore/test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs +++ b/src/efcore/test/EFCore.SqlServer.FunctionalTests/Query/TemporalGearsOfWarQuerySqlServerTest.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using Microsoft.EntityFrameworkCore.SqlServer.Internal; @@ -1066,7 +1066,7 @@ public override async Task Nav_rewrite_with_convert2(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] LEFT JOIN [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c] ON [f].[CapitalName] = [c].[Name] LEFT JOIN ( @@ -1157,7 +1157,7 @@ public override async Task Project_navigation_defined_on_derived_from_entity_wit SELECT [l].[Name], [l].[Discriminator], [l].[LocustHordeId], [l].[PeriodEnd], [l].[PeriodStart], [l].[ThreatLevel], [l].[ThreatLevelByte], [l].[ThreatLevelNullableByte], [l].[DefeatedByNickname], [l].[DefeatedBySquadId], [l].[HighCommandId], [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[PeriodEnd], [g].[PeriodStart], [g].[Rank], CASE WHEN [g].[Nickname] IS NULL OR [g].[SquadId] IS NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) -END AS [IsNull], [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated], CASE +END AS [IsNull], [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated], CASE WHEN [f].[Id] IS NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END AS [IsNull], [l0].[Id], [l0].[IsOperational], [l0].[Name], [l0].[PeriodEnd], [l0].[PeriodStart], CASE @@ -1293,7 +1293,7 @@ public override async Task Member_access_on_derived_materialized_entity_using_ca AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] ORDER BY [f].[Name] """); @@ -2470,7 +2470,7 @@ public override async Task Include_on_derived_entity_using_OfType(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated], [l0].[Name], [l0].[Discriminator], [l0].[LocustHordeId], [l0].[PeriodEnd], [l0].[PeriodStart], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [l1].[Name], [l1].[Discriminator], [l1].[LocustHordeId], [l1].[PeriodEnd], [l1].[PeriodStart], [l1].[ThreatLevel], [l1].[ThreatLevelByte], [l1].[ThreatLevelNullableByte], [l1].[DefeatedByNickname], [l1].[DefeatedBySquadId], [l1].[HighCommandId] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated], [l0].[Name], [l0].[Discriminator], [l0].[LocustHordeId], [l0].[PeriodEnd], [l0].[PeriodStart], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [l1].[Name], [l1].[Discriminator], [l1].[LocustHordeId], [l1].[PeriodEnd], [l1].[PeriodStart], [l1].[ThreatLevel], [l1].[ThreatLevelByte], [l1].[ThreatLevelNullableByte], [l1].[DefeatedByNickname], [l1].[DefeatedBySquadId], [l1].[HighCommandId] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] LEFT JOIN ( SELECT [l].[Name], [l].[Discriminator], [l].[LocustHordeId], [l].[PeriodEnd], [l].[PeriodStart], [l].[ThreatLevel], [l].[ThreatLevelByte], [l].[ThreatLevelNullableByte], [l].[DefeatedByNickname], [l].[DefeatedBySquadId], [l].[HighCommandId] @@ -2482,6 +2482,61 @@ LEFT JOIN ( """); } + public override async Task Conditional_Navigation_With_Trivial_Member_Access(bool async) + { + await base.Conditional_Navigation_With_Trivial_Member_Access(async); + + AssertSql( + """ +SELECT [g].[Nickname] +FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] +LEFT JOIN [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c] ON [g].[AssignedCityName] = [c].[Name] +INNER JOIN [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c0] ON [g].[CityOfBirthName] = [c0].[Name] +WHERE CASE + WHEN [c].[Name] IS NOT NULL THEN [c].[Name] + ELSE [c0].[Name] +END <> N'Ephyra' +"""); + } + + public override async Task Conditional_Navigation_With_Member_Access_On_Same_Type(bool async) + { + await base.Conditional_Navigation_With_Member_Access_On_Same_Type(async); + + AssertSql( + """ +SELECT [g].[Nickname], [g].[FullName] +FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] +LEFT JOIN [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c] ON [g].[AssignedCityName] = [c].[Name] +INNER JOIN [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c0] ON [g].[CityOfBirthName] = [c0].[Name] +WHERE CASE + WHEN [c].[Name] IS NOT NULL THEN [c].[Nation] + ELSE [c0].[Nation] +END = N'Tyrus' +"""); + } + + public override async Task Conditional_Navigation_With_Member_Access_On_Related_Types(bool async) + { + await base.Conditional_Navigation_With_Member_Access_On_Related_Types(async); + + AssertSql( + """ +SELECT [f].[Name] +FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] +LEFT JOIN [LocustLeaders] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l] ON [f].[DeputyCommanderName] = [l].[Name] +LEFT JOIN ( + SELECT [l0].[Name], [l0].[ThreatLevel] + FROM [LocustLeaders] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l0] + WHERE [l0].[Discriminator] = N'LocustCommander' +) AS [l1] ON [f].[CommanderName] = [l1].[Name] +WHERE CASE + WHEN [l].[Name] IS NOT NULL THEN [l].[ThreatLevel] + ELSE [l1].[ThreatLevel] +END = CAST(4 AS smallint) +"""); + } + public override async Task Select_Singleton_Navigation_With_Member_Access(bool async) { await base.Select_Singleton_Navigation_With_Member_Access(async); @@ -2689,7 +2744,7 @@ public override async Task Include_after_Select_throws(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated], [c].[Name], [c].[Location], [c].[Nation], [c].[PeriodEnd], [c].[PeriodStart] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated], [c].[Name], [c].[Location], [c].[Nation], [c].[PeriodEnd], [c].[PeriodStart] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] LEFT JOIN [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c] ON [f].[CapitalName] = [c].[Name] """); @@ -3568,7 +3623,7 @@ public override async Task Nav_rewrite_with_convert3(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] LEFT JOIN [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c] ON [f].[CapitalName] = [c].[Name] LEFT JOIN ( @@ -3913,10 +3968,10 @@ public override async Task Null_semantics_on_nullable_bool_from_inner_join_subqu AssertSql( """ -SELECT [f0].[Id], [f0].[CapitalName], [f0].[Discriminator], [f0].[Name], [f0].[PeriodEnd], [f0].[PeriodStart], [f0].[ServerAddress], [f0].[CommanderName], [f0].[Eradicated] +SELECT [f0].[Id], [f0].[CapitalName], [f0].[Discriminator], [f0].[Name], [f0].[PeriodEnd], [f0].[PeriodStart], [f0].[ServerAddress], [f0].[CommanderName], [f0].[DeputyCommanderName], [f0].[Eradicated] FROM [LocustLeaders] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l] INNER JOIN ( - SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] + SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] WHERE [f].[Name] = N'Swarm' ) AS [f0] ON [l].[Name] = [f0].[CommanderName] @@ -4740,7 +4795,7 @@ public override async Task ThenInclude_collection_on_derived_after_derived_refer AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated], [l0].[Name], [l0].[Discriminator], [l0].[LocustHordeId], [l0].[PeriodEnd], [l0].[PeriodStart], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[PeriodEnd], [g].[PeriodStart], [g].[Rank], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[PeriodEnd], [g0].[PeriodStart], [g0].[Rank] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated], [l0].[Name], [l0].[Discriminator], [l0].[LocustHordeId], [l0].[PeriodEnd], [l0].[PeriodStart], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[PeriodEnd], [g].[PeriodStart], [g].[Rank], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[PeriodEnd], [g0].[PeriodStart], [g0].[Rank] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] LEFT JOIN ( SELECT [l].[Name], [l].[Discriminator], [l].[LocustHordeId], [l].[PeriodEnd], [l].[PeriodStart], [l].[ThreatLevel], [l].[ThreatLevelByte], [l].[ThreatLevelNullableByte], [l].[DefeatedByNickname], [l].[DefeatedBySquadId], [l].[HighCommandId] @@ -4988,7 +5043,7 @@ public override async Task Multiple_derived_included_on_one_method(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated], [l0].[Name], [l0].[Discriminator], [l0].[LocustHordeId], [l0].[PeriodEnd], [l0].[PeriodStart], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[PeriodEnd], [g].[PeriodStart], [g].[Rank], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[PeriodEnd], [g0].[PeriodStart], [g0].[Rank] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated], [l0].[Name], [l0].[Discriminator], [l0].[LocustHordeId], [l0].[PeriodEnd], [l0].[PeriodStart], [l0].[ThreatLevel], [l0].[ThreatLevelByte], [l0].[ThreatLevelNullableByte], [l0].[DefeatedByNickname], [l0].[DefeatedBySquadId], [l0].[HighCommandId], [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[PeriodEnd], [g].[PeriodStart], [g].[Rank], [g0].[Nickname], [g0].[SquadId], [g0].[AssignedCityName], [g0].[CityOfBirthName], [g0].[Discriminator], [g0].[FullName], [g0].[HasSoulPatch], [g0].[LeaderNickname], [g0].[LeaderSquadId], [g0].[PeriodEnd], [g0].[PeriodStart], [g0].[Rank] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] LEFT JOIN ( SELECT [l].[Name], [l].[Discriminator], [l].[LocustHordeId], [l].[PeriodEnd], [l].[PeriodStart], [l].[ThreatLevel], [l].[ThreatLevelByte], [l].[ThreatLevelNullableByte], [l].[DefeatedByNickname], [l].[DefeatedBySquadId], [l].[HighCommandId] @@ -5024,7 +5079,7 @@ public override async Task Include_on_derived_entity_with_cast(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated], [c].[Name], [c].[Location], [c].[Nation], [c].[PeriodEnd], [c].[PeriodStart] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated], [c].[Name], [c].[Location], [c].[Nation], [c].[PeriodEnd], [c].[PeriodStart] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] LEFT JOIN [Cities] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [c] ON [f].[CapitalName] = [c].[Name] ORDER BY [f].[Id] @@ -5603,10 +5658,10 @@ public override async Task Null_semantics_on_nullable_bool_from_left_join_subque AssertSql( """ -SELECT [f0].[Id], [f0].[CapitalName], [f0].[Discriminator], [f0].[Name], [f0].[PeriodEnd], [f0].[PeriodStart], [f0].[ServerAddress], [f0].[CommanderName], [f0].[Eradicated] +SELECT [f0].[Id], [f0].[CapitalName], [f0].[Discriminator], [f0].[Name], [f0].[PeriodEnd], [f0].[PeriodStart], [f0].[ServerAddress], [f0].[CommanderName], [f0].[DeputyCommanderName], [f0].[Eradicated] FROM [LocustLeaders] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [l] LEFT JOIN ( - SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] + SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] WHERE [f].[Name] = N'Swarm' ) AS [f0] ON [l].[Name] = [f0].[CommanderName] @@ -5812,7 +5867,7 @@ public override async Task Navigation_based_on_complex_expression2(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] LEFT JOIN ( SELECT [l].[Name] @@ -5998,7 +6053,7 @@ public override async Task Navigation_based_on_complex_expression1(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] LEFT JOIN ( SELECT [l].[Name] @@ -6112,7 +6167,7 @@ public override async Task Comparison_with_value_converted_subclass(bool async) AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] WHERE [f].[ServerAddress] = CAST(N'127.0.0.1' AS nvarchar(45)) """); @@ -6138,7 +6193,7 @@ public override async Task Navigation_access_on_derived_materialized_entity_usin AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated], [l0].[ThreatLevel] AS [Threat] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated], [l0].[ThreatLevel] AS [Threat] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] LEFT JOIN ( SELECT [l].[Name], [l].[ThreatLevel] @@ -6302,7 +6357,7 @@ public override async Task Project_derivied_entity_with_convert_to_parent(bool a AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] """); } @@ -6344,7 +6399,7 @@ public override async Task ThenInclude_reference_on_derived_after_derived_collec AssertSql( """ -SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[Eradicated], [s].[Name], [s].[Discriminator], [s].[LocustHordeId], [s].[PeriodEnd], [s].[PeriodStart], [s].[ThreatLevel], [s].[ThreatLevelByte], [s].[ThreatLevelNullableByte], [s].[DefeatedByNickname], [s].[DefeatedBySquadId], [s].[HighCommandId], [s].[Nickname], [s].[SquadId], [s].[AssignedCityName], [s].[CityOfBirthName], [s].[Discriminator0], [s].[FullName], [s].[HasSoulPatch], [s].[LeaderNickname], [s].[LeaderSquadId], [s].[PeriodEnd0], [s].[PeriodStart0], [s].[Rank] +SELECT [f].[Id], [f].[CapitalName], [f].[Discriminator], [f].[Name], [f].[PeriodEnd], [f].[PeriodStart], [f].[ServerAddress], [f].[CommanderName], [f].[DeputyCommanderName], [f].[Eradicated], [s].[Name], [s].[Discriminator], [s].[LocustHordeId], [s].[PeriodEnd], [s].[PeriodStart], [s].[ThreatLevel], [s].[ThreatLevelByte], [s].[ThreatLevelNullableByte], [s].[DefeatedByNickname], [s].[DefeatedBySquadId], [s].[HighCommandId], [s].[Nickname], [s].[SquadId], [s].[AssignedCityName], [s].[CityOfBirthName], [s].[Discriminator0], [s].[FullName], [s].[HasSoulPatch], [s].[LeaderNickname], [s].[LeaderSquadId], [s].[PeriodEnd0], [s].[PeriodStart0], [s].[Rank] FROM [Factions] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [f] LEFT JOIN ( SELECT [l].[Name], [l].[Discriminator], [l].[LocustHordeId], [l].[PeriodEnd], [l].[PeriodStart], [l].[ThreatLevel], [l].[ThreatLevelByte], [l].[ThreatLevelNullableByte], [l].[DefeatedByNickname], [l].[DefeatedBySquadId], [l].[HighCommandId], [g].[Nickname], [g].[SquadId], [g].[AssignedCityName], [g].[CityOfBirthName], [g].[Discriminator] AS [Discriminator0], [g].[FullName], [g].[HasSoulPatch], [g].[LeaderNickname], [g].[LeaderSquadId], [g].[PeriodEnd] AS [PeriodEnd0], [g].[PeriodStart] AS [PeriodStart0], [g].[Rank] @@ -7323,9 +7378,7 @@ SELECT CASE END FROM [Gears] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [g] ORDER BY CASE - WHEN CASE - WHEN [g].[LeaderNickname] IS NOT NULL THEN ~CAST(CAST(LEN([g].[Nickname]) AS int) ^ 5 AS bit) - END IS NOT NULL THEN CAST(1 AS bit) + WHEN [g].[LeaderNickname] IS NOT NULL THEN CAST(1 AS bit) ELSE CAST(0 AS bit) END """); diff --git a/src/efcore/test/EFCore.Sqlite.FunctionalTests/Query/GearsOfWarQuerySqliteTest.cs b/src/efcore/test/EFCore.Sqlite.FunctionalTests/Query/GearsOfWarQuerySqliteTest.cs index 8f1b52e55cb..d5f16a848b3 100644 --- a/src/efcore/test/EFCore.Sqlite.FunctionalTests/Query/GearsOfWarQuerySqliteTest.cs +++ b/src/efcore/test/EFCore.Sqlite.FunctionalTests/Query/GearsOfWarQuerySqliteTest.cs @@ -435,7 +435,7 @@ public override async Task Include_on_derived_entity_using_OfType(bool async) AssertSql( """ -SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."Eradicated", "l0"."Name", "l0"."Discriminator", "l0"."LocustHordeId", "l0"."ThreatLevel", "l0"."ThreatLevelByte", "l0"."ThreatLevelNullableByte", "l0"."DefeatedByNickname", "l0"."DefeatedBySquadId", "l0"."HighCommandId", "l1"."Name", "l1"."Discriminator", "l1"."LocustHordeId", "l1"."ThreatLevel", "l1"."ThreatLevelByte", "l1"."ThreatLevelNullableByte", "l1"."DefeatedByNickname", "l1"."DefeatedBySquadId", "l1"."HighCommandId" +SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."DeputyCommanderName", "f"."Eradicated", "l0"."Name", "l0"."Discriminator", "l0"."LocustHordeId", "l0"."ThreatLevel", "l0"."ThreatLevelByte", "l0"."ThreatLevelNullableByte", "l0"."DefeatedByNickname", "l0"."DefeatedBySquadId", "l0"."HighCommandId", "l1"."Name", "l1"."Discriminator", "l1"."LocustHordeId", "l1"."ThreatLevel", "l1"."ThreatLevelByte", "l1"."ThreatLevelNullableByte", "l1"."DefeatedByNickname", "l1"."DefeatedBySquadId", "l1"."HighCommandId" FROM "Factions" AS "f" LEFT JOIN ( SELECT "l"."Name", "l"."Discriminator", "l"."LocustHordeId", "l"."ThreatLevel", "l"."ThreatLevelByte", "l"."ThreatLevelNullableByte", "l"."DefeatedByNickname", "l"."DefeatedBySquadId", "l"."HighCommandId" @@ -601,7 +601,7 @@ public override async Task Navigation_based_on_complex_expression1(bool async) AssertSql( """ -SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."Eradicated" +SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."DeputyCommanderName", "f"."Eradicated" FROM "Factions" AS "f" LEFT JOIN ( SELECT "l"."Name" @@ -1872,7 +1872,7 @@ public override async Task Navigation_based_on_complex_expression2(bool async) AssertSql( """ -SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."Eradicated" +SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."DeputyCommanderName", "f"."Eradicated" FROM "Factions" AS "f" LEFT JOIN ( SELECT "l"."Name" @@ -2019,7 +2019,7 @@ public override async Task Member_access_on_derived_materialized_entity_using_ca AssertSql( """ -SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."Eradicated" +SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."DeputyCommanderName", "f"."Eradicated" FROM "Factions" AS "f" ORDER BY "f"."Name" """); @@ -2214,7 +2214,7 @@ public override async Task Include_after_Select_throws(bool async) AssertSql( """ -SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."Eradicated", "c"."Name", "c"."Location", "c"."Nation" +SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."DeputyCommanderName", "f"."Eradicated", "c"."Name", "c"."Location", "c"."Nation" FROM "Factions" AS "f" LEFT JOIN "Cities" AS "c" ON "f"."CapitalName" = "c"."Name" """); @@ -2421,7 +2421,7 @@ public override async Task Comparison_with_value_converted_subclass(bool async) AssertSql( """ -SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."Eradicated" +SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."DeputyCommanderName", "f"."Eradicated" FROM "Factions" AS "f" WHERE "f"."ServerAddress" = CAST('127.0.0.1' AS TEXT) """); @@ -3382,7 +3382,7 @@ public override async Task Nav_rewrite_with_convert3(bool async) AssertSql( """ -SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."Eradicated" +SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."DeputyCommanderName", "f"."Eradicated" FROM "Factions" AS "f" LEFT JOIN "Cities" AS "c" ON "f"."CapitalName" = "c"."Name" LEFT JOIN ( @@ -3587,7 +3587,7 @@ public override async Task Nav_rewrite_with_convert2(bool async) AssertSql( """ -SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."Eradicated" +SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."DeputyCommanderName", "f"."Eradicated" FROM "Factions" AS "f" LEFT JOIN "Cities" AS "c" ON "f"."CapitalName" = "c"."Name" LEFT JOIN ( @@ -4192,7 +4192,7 @@ public override async Task Project_derivied_entity_with_convert_to_parent(bool a AssertSql( """ -SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."Eradicated" +SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."DeputyCommanderName", "f"."Eradicated" FROM "Factions" AS "f" """); } @@ -4373,7 +4373,7 @@ public override async Task Navigation_access_on_derived_materialized_entity_usin AssertSql( """ -SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."Eradicated", "l0"."ThreatLevel" AS "Threat" +SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."DeputyCommanderName", "f"."Eradicated", "l0"."ThreatLevel" AS "Threat" FROM "Factions" AS "f" LEFT JOIN ( SELECT "l"."Name", "l"."ThreatLevel" @@ -4610,10 +4610,10 @@ public override async Task Null_semantics_on_nullable_bool_from_left_join_subque AssertSql( """ -SELECT "f0"."Id", "f0"."CapitalName", "f0"."Discriminator", "f0"."Name", "f0"."ServerAddress", "f0"."CommanderName", "f0"."Eradicated" +SELECT "f0"."Id", "f0"."CapitalName", "f0"."Discriminator", "f0"."Name", "f0"."ServerAddress", "f0"."CommanderName", "f0"."DeputyCommanderName", "f0"."Eradicated" FROM "LocustLeaders" AS "l" LEFT JOIN ( - SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."Eradicated" + SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."DeputyCommanderName", "f"."Eradicated" FROM "Factions" AS "f" WHERE "f"."Name" = 'Swarm' ) AS "f0" ON "l"."Name" = "f0"."CommanderName" @@ -4678,10 +4678,10 @@ public override async Task Null_semantics_on_nullable_bool_from_inner_join_subqu AssertSql( """ -SELECT "f0"."Id", "f0"."CapitalName", "f0"."Discriminator", "f0"."Name", "f0"."ServerAddress", "f0"."CommanderName", "f0"."Eradicated" +SELECT "f0"."Id", "f0"."CapitalName", "f0"."Discriminator", "f0"."Name", "f0"."ServerAddress", "f0"."CommanderName", "f0"."DeputyCommanderName", "f0"."Eradicated" FROM "LocustLeaders" AS "l" INNER JOIN ( - SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."Eradicated" + SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."DeputyCommanderName", "f"."Eradicated" FROM "Factions" AS "f" WHERE "f"."Name" = 'Swarm' ) AS "f0" ON "l"."Name" = "f0"."CommanderName" @@ -4880,7 +4880,7 @@ public override async Task Project_navigation_defined_on_derived_from_entity_wit AssertSql( """ -SELECT "l"."Name", "l"."Discriminator", "l"."LocustHordeId", "l"."ThreatLevel", "l"."ThreatLevelByte", "l"."ThreatLevelNullableByte", "l"."DefeatedByNickname", "l"."DefeatedBySquadId", "l"."HighCommandId", "g"."Nickname", "g"."SquadId", "g"."AssignedCityName", "g"."CityOfBirthName", "g"."Discriminator", "g"."FullName", "g"."HasSoulPatch", "g"."LeaderNickname", "g"."LeaderSquadId", "g"."Rank", "g"."Nickname" IS NULL OR "g"."SquadId" IS NULL AS "IsNull", "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."Eradicated", "f"."Id" IS NULL AS "IsNull", "l0"."Id", "l0"."IsOperational", "l0"."Name", "l0"."Id" IS NULL AS "IsNull" +SELECT "l"."Name", "l"."Discriminator", "l"."LocustHordeId", "l"."ThreatLevel", "l"."ThreatLevelByte", "l"."ThreatLevelNullableByte", "l"."DefeatedByNickname", "l"."DefeatedBySquadId", "l"."HighCommandId", "g"."Nickname", "g"."SquadId", "g"."AssignedCityName", "g"."CityOfBirthName", "g"."Discriminator", "g"."FullName", "g"."HasSoulPatch", "g"."LeaderNickname", "g"."LeaderSquadId", "g"."Rank", "g"."Nickname" IS NULL OR "g"."SquadId" IS NULL AS "IsNull", "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."DeputyCommanderName", "f"."Eradicated", "f"."Id" IS NULL AS "IsNull", "l0"."Id", "l0"."IsOperational", "l0"."Name", "l0"."Id" IS NULL AS "IsNull" FROM "LocustLeaders" AS "l" LEFT JOIN "Gears" AS "g" ON "l"."DefeatedByNickname" = "g"."Nickname" AND "l"."DefeatedBySquadId" = "g"."SquadId" LEFT JOIN "Factions" AS "f" ON "l"."Name" = "f"."CommanderName" @@ -5962,7 +5962,7 @@ public override async Task ThenInclude_reference_on_derived_after_derived_collec AssertSql( """ -SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."Eradicated", "s"."Name", "s"."Discriminator", "s"."LocustHordeId", "s"."ThreatLevel", "s"."ThreatLevelByte", "s"."ThreatLevelNullableByte", "s"."DefeatedByNickname", "s"."DefeatedBySquadId", "s"."HighCommandId", "s"."Nickname", "s"."SquadId", "s"."AssignedCityName", "s"."CityOfBirthName", "s"."Discriminator0", "s"."FullName", "s"."HasSoulPatch", "s"."LeaderNickname", "s"."LeaderSquadId", "s"."Rank" +SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."DeputyCommanderName", "f"."Eradicated", "s"."Name", "s"."Discriminator", "s"."LocustHordeId", "s"."ThreatLevel", "s"."ThreatLevelByte", "s"."ThreatLevelNullableByte", "s"."DefeatedByNickname", "s"."DefeatedBySquadId", "s"."HighCommandId", "s"."Nickname", "s"."SquadId", "s"."AssignedCityName", "s"."CityOfBirthName", "s"."Discriminator0", "s"."FullName", "s"."HasSoulPatch", "s"."LeaderNickname", "s"."LeaderSquadId", "s"."Rank" FROM "Factions" AS "f" LEFT JOIN ( SELECT "l"."Name", "l"."Discriminator", "l"."LocustHordeId", "l"."ThreatLevel", "l"."ThreatLevelByte", "l"."ThreatLevelNullableByte", "l"."DefeatedByNickname", "l"."DefeatedBySquadId", "l"."HighCommandId", "g"."Nickname", "g"."SquadId", "g"."AssignedCityName", "g"."CityOfBirthName", "g"."Discriminator" AS "Discriminator0", "g"."FullName", "g"."HasSoulPatch", "g"."LeaderNickname", "g"."LeaderSquadId", "g"."Rank" @@ -5997,7 +5997,7 @@ public override async Task ThenInclude_collection_on_derived_after_derived_refer AssertSql( """ -SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."Eradicated", "l0"."Name", "l0"."Discriminator", "l0"."LocustHordeId", "l0"."ThreatLevel", "l0"."ThreatLevelByte", "l0"."ThreatLevelNullableByte", "l0"."DefeatedByNickname", "l0"."DefeatedBySquadId", "l0"."HighCommandId", "g"."Nickname", "g"."SquadId", "g"."AssignedCityName", "g"."CityOfBirthName", "g"."Discriminator", "g"."FullName", "g"."HasSoulPatch", "g"."LeaderNickname", "g"."LeaderSquadId", "g"."Rank", "g0"."Nickname", "g0"."SquadId", "g0"."AssignedCityName", "g0"."CityOfBirthName", "g0"."Discriminator", "g0"."FullName", "g0"."HasSoulPatch", "g0"."LeaderNickname", "g0"."LeaderSquadId", "g0"."Rank" +SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."DeputyCommanderName", "f"."Eradicated", "l0"."Name", "l0"."Discriminator", "l0"."LocustHordeId", "l0"."ThreatLevel", "l0"."ThreatLevelByte", "l0"."ThreatLevelNullableByte", "l0"."DefeatedByNickname", "l0"."DefeatedBySquadId", "l0"."HighCommandId", "g"."Nickname", "g"."SquadId", "g"."AssignedCityName", "g"."CityOfBirthName", "g"."Discriminator", "g"."FullName", "g"."HasSoulPatch", "g"."LeaderNickname", "g"."LeaderSquadId", "g"."Rank", "g0"."Nickname", "g0"."SquadId", "g0"."AssignedCityName", "g0"."CityOfBirthName", "g0"."Discriminator", "g0"."FullName", "g0"."HasSoulPatch", "g0"."LeaderNickname", "g0"."LeaderSquadId", "g0"."Rank" FROM "Factions" AS "f" LEFT JOIN ( SELECT "l"."Name", "l"."Discriminator", "l"."LocustHordeId", "l"."ThreatLevel", "l"."ThreatLevelByte", "l"."ThreatLevelNullableByte", "l"."DefeatedByNickname", "l"."DefeatedBySquadId", "l"."HighCommandId" @@ -6698,7 +6698,7 @@ public override async Task Multiple_derived_included_on_one_method(bool async) AssertSql( """ -SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."Eradicated", "l0"."Name", "l0"."Discriminator", "l0"."LocustHordeId", "l0"."ThreatLevel", "l0"."ThreatLevelByte", "l0"."ThreatLevelNullableByte", "l0"."DefeatedByNickname", "l0"."DefeatedBySquadId", "l0"."HighCommandId", "g"."Nickname", "g"."SquadId", "g"."AssignedCityName", "g"."CityOfBirthName", "g"."Discriminator", "g"."FullName", "g"."HasSoulPatch", "g"."LeaderNickname", "g"."LeaderSquadId", "g"."Rank", "g0"."Nickname", "g0"."SquadId", "g0"."AssignedCityName", "g0"."CityOfBirthName", "g0"."Discriminator", "g0"."FullName", "g0"."HasSoulPatch", "g0"."LeaderNickname", "g0"."LeaderSquadId", "g0"."Rank" +SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."DeputyCommanderName", "f"."Eradicated", "l0"."Name", "l0"."Discriminator", "l0"."LocustHordeId", "l0"."ThreatLevel", "l0"."ThreatLevelByte", "l0"."ThreatLevelNullableByte", "l0"."DefeatedByNickname", "l0"."DefeatedBySquadId", "l0"."HighCommandId", "g"."Nickname", "g"."SquadId", "g"."AssignedCityName", "g"."CityOfBirthName", "g"."Discriminator", "g"."FullName", "g"."HasSoulPatch", "g"."LeaderNickname", "g"."LeaderSquadId", "g"."Rank", "g0"."Nickname", "g0"."SquadId", "g0"."AssignedCityName", "g0"."CityOfBirthName", "g0"."Discriminator", "g0"."FullName", "g0"."HasSoulPatch", "g0"."LeaderNickname", "g0"."LeaderSquadId", "g0"."Rank" FROM "Factions" AS "f" LEFT JOIN ( SELECT "l"."Name", "l"."Discriminator", "l"."LocustHordeId", "l"."ThreatLevel", "l"."ThreatLevelByte", "l"."ThreatLevelNullableByte", "l"."DefeatedByNickname", "l"."DefeatedBySquadId", "l"."HighCommandId" @@ -6793,7 +6793,7 @@ public override async Task Include_on_derived_entity_with_cast(bool async) AssertSql( """ -SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."Eradicated", "c"."Name", "c"."Location", "c"."Nation" +SELECT "f"."Id", "f"."CapitalName", "f"."Discriminator", "f"."Name", "f"."ServerAddress", "f"."CommanderName", "f"."DeputyCommanderName", "f"."Eradicated", "c"."Name", "c"."Location", "c"."Nation" FROM "Factions" AS "f" LEFT JOIN "Cities" AS "c" ON "f"."CapitalName" = "c"."Name" ORDER BY "f"."Id" @@ -7238,8 +7238,9 @@ SELECT CASE END FROM "Gears" AS "g" ORDER BY CASE - WHEN "g"."LeaderNickname" IS NOT NULL THEN length("g"."Nickname") = 5 -END IS NOT NULL + WHEN "g"."LeaderNickname" IS NOT NULL THEN 1 + ELSE 0 +END """); } @@ -7798,6 +7799,61 @@ CROSS JOIN "Tags" AS "t0" """); } + public override async Task Conditional_Navigation_With_Trivial_Member_Access(bool async) + { + await base.Conditional_Navigation_With_Trivial_Member_Access(async); + + AssertSql( + """ +SELECT "g"."Nickname" +FROM "Gears" AS "g" +LEFT JOIN "Cities" AS "c" ON "g"."AssignedCityName" = "c"."Name" +INNER JOIN "Cities" AS "c0" ON "g"."CityOfBirthName" = "c0"."Name" +WHERE CASE + WHEN "c"."Name" IS NOT NULL THEN "c"."Name" + ELSE "c0"."Name" +END <> 'Ephyra' +"""); + } + + public override async Task Conditional_Navigation_With_Member_Access_On_Same_Type(bool async) + { + await base.Conditional_Navigation_With_Member_Access_On_Same_Type(async); + + AssertSql( + """ +SELECT "g"."Nickname", "g"."FullName" +FROM "Gears" AS "g" +LEFT JOIN "Cities" AS "c" ON "g"."AssignedCityName" = "c"."Name" +INNER JOIN "Cities" AS "c0" ON "g"."CityOfBirthName" = "c0"."Name" +WHERE CASE + WHEN "c"."Name" IS NOT NULL THEN "c"."Nation" + ELSE "c0"."Nation" +END = 'Tyrus' +"""); + } + + public override async Task Conditional_Navigation_With_Member_Access_On_Related_Types(bool async) + { + await base.Conditional_Navigation_With_Member_Access_On_Related_Types(async); + + AssertSql( + """ +SELECT "f"."Name" +FROM "Factions" AS "f" +LEFT JOIN "LocustLeaders" AS "l" ON "f"."DeputyCommanderName" = "l"."Name" +LEFT JOIN ( + SELECT "l0"."Name", "l0"."ThreatLevel" + FROM "LocustLeaders" AS "l0" + WHERE "l0"."Discriminator" = 'LocustCommander' +) AS "l1" ON "f"."CommanderName" = "l1"."Name" +WHERE CASE + WHEN "l"."Name" IS NOT NULL THEN "l"."ThreatLevel" + ELSE "l1"."ThreatLevel" +END = 4 +"""); + } + public override async Task Complex_GroupBy_after_set_operator_using_result_selector(bool async) { await base.Complex_GroupBy_after_set_operator_using_result_selector(async); diff --git a/src/emsdk/eng/Version.Details.xml b/src/emsdk/eng/Version.Details.xml index c0fbc51d81c..6872ce23518 100644 --- a/src/emsdk/eng/Version.Details.xml +++ b/src/emsdk/eng/Version.Details.xml @@ -1,6 +1,6 @@ - + https://github.com/dotnet/binaryen @@ -236,33 +236,33 @@ https://github.com/dotnet/llvm-project 06dc649fc031114f675b184dc579d7c02d3d1f40 - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb - + https://github.com/dotnet/dotnet - 5e6dacd4d3debda3266224b2a434811c6fa94987 + 85778473549347b3e4bad3ea009e9438df7b11bb diff --git a/src/emsdk/eng/Versions.props b/src/emsdk/eng/Versions.props index 035d62ac7cf..40dcaa68910 100644 --- a/src/emsdk/eng/Versions.props +++ b/src/emsdk/eng/Versions.props @@ -57,11 +57,11 @@ release - 10.0.0-beta.25257.101 - 10.0.0-beta.25257.101 - 10.0.0-beta.25257.101 - 10.0.0-beta.25257.101 - 10.0.0-beta.25257.101 + 10.0.0-beta.25260.104 + 10.0.0-beta.25260.104 + 10.0.0-beta.25260.104 + 10.0.0-beta.25260.104 + 10.0.0-beta.25260.104 1.1.87-gba258badda diff --git a/src/emsdk/eng/common/core-templates/steps/source-build.yml b/src/emsdk/eng/common/core-templates/steps/source-build.yml index 325231215d5..f2a0f347fdd 100644 --- a/src/emsdk/eng/common/core-templates/steps/source-build.yml +++ b/src/emsdk/eng/common/core-templates/steps/source-build.yml @@ -38,14 +38,9 @@ steps: targetRidArgs='/p:TargetRid=${{ parameters.platform.targetRID }}' fi - runtimeOsArgs= - if [ '${{ parameters.platform.runtimeOS }}' != '' ]; then - runtimeOsArgs='/p:RuntimeOS=${{ parameters.platform.runtimeOS }}' - fi - - baseOsArgs= - if [ '${{ parameters.platform.baseOS }}' != '' ]; then - baseOsArgs='/p:BaseOS=${{ parameters.platform.baseOS }}' + baseRidArgs= + if [ '${{ parameters.platform.baseRID }}' != '' ]; then + baseRidArgs='/p:BaseRid=${{ parameters.platform.baseRID }}' fi portableBuildArgs= @@ -59,8 +54,7 @@ steps: ${{ parameters.platform.buildArguments }} \ $internalRuntimeDownloadArgs \ $targetRidArgs \ - $runtimeOsArgs \ - $baseOsArgs \ + $baseRidArgs \ $portableBuildArgs \ /p:DotNetBuildSourceOnly=true \ /p:DotNetBuildRepo=true \ @@ -71,7 +65,7 @@ steps: is1ESPipeline: ${{ parameters.is1ESPipeline }} args: displayName: Publish BuildLogs - targetPath: artifacts/log/$[ coalesce(variables._BuildConfig, 'Release') ]/ + targetPath: artifacts/log/${{ coalesce(variables._BuildConfig, 'Release') }} artifactName: BuildLogs_SourceBuild_${{ parameters.platform.name }}_Attempt$(System.JobAttempt) continueOnError: true condition: succeededOrFailed() diff --git a/src/emsdk/eng/common/tools.sh b/src/emsdk/eng/common/tools.sh index d51f300c772..cc007b1f15a 100755 --- a/src/emsdk/eng/common/tools.sh +++ b/src/emsdk/eng/common/tools.sh @@ -5,6 +5,9 @@ # CI mode - set to true on CI server for PR validation build or official build. ci=${ci:-false} +# Build mode +source_build=${source_build:-false} + # Set to true to use the pipelines logger which will enable Azure logging output. # https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md # This flag is meant as a temporary opt-opt for the feature while validate it across @@ -58,7 +61,8 @@ use_installed_dotnet_cli=${use_installed_dotnet_cli:-true} dotnetInstallScriptVersion=${dotnetInstallScriptVersion:-'v1'} # True to use global NuGet cache instead of restoring packages to repository-local directory. -if [[ "$ci" == true ]]; then +# Keep in sync with NuGetPackageroot in Arcade SDK's RepositoryLayout.props. +if [[ "$ci" == true || "$source_build" == true ]]; then use_global_nuget_cache=${use_global_nuget_cache:-false} else use_global_nuget_cache=${use_global_nuget_cache:-true} diff --git a/src/emsdk/global.json b/src/emsdk/global.json index c9c4a3504a4..ad29ae30d6f 100644 --- a/src/emsdk/global.json +++ b/src/emsdk/global.json @@ -3,8 +3,8 @@ "dotnet": "10.0.100-preview.3.25201.16" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25257.101", - "Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25257.101", + "Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25260.104", + "Microsoft.DotNet.Helix.Sdk": "10.0.0-beta.25260.104", "Microsoft.Build.Traversal": "3.4.0" } } diff --git a/src/nuget-client/.github/copilot-instructions.md b/src/nuget-client/.github/copilot-instructions.md index 7ffb5a06e5b..6fee8ecdeaa 100644 --- a/src/nuget-client/.github/copilot-instructions.md +++ b/src/nuget-client/.github/copilot-instructions.md @@ -1 +1 @@ -For both new and existing code, help enforce a maximum line length of 120 characters. \ No newline at end of file +Use the following coding guidelines: https://github.com/NuGet/NuGet.Client/blob/dev/docs/coding-guidelines.md \ No newline at end of file diff --git a/src/nuget-client/build/config.props b/src/nuget-client/build/config.props index e0b06a92349..a43a7111238 100644 --- a/src/nuget-client/build/config.props +++ b/src/nuget-client/build/config.props @@ -22,22 +22,22 @@ preview.1 - false + false - $([MSBuild]::Add(11, $(MajorNuGetVersion))) - main - int.$(VsTargetBranch) - int.$(VsTargetBranch) + $([MSBuild]::Add(11, $(MajorNuGetVersion))) + main + int.$(VsTargetBranch) + int.$(VsTargetBranch) - $(VsTargetMajorVersion).$(MinorNuGetVersion).$(PatchNuGetVersion) + $([MSBuild]::Add(11, $(MajorNuGetVersion))).$(MinorNuGetVersion).$(PatchNuGetVersion) - rel/d$(VsTargetMajorVersion).$(MinorNuGetVersion) - int.d$(VsTargetMajorVersion).$(MinorNuGetVersion) + rel/d$(VsTargetMajorVersion).$(MinorNuGetVersion) + int.d$(VsTargetMajorVersion).$(MinorNuGetVersion) - $(VsTargetChannel) + $(VsTargetChannel) diff --git a/src/nuget-client/build/runsettings.proj b/src/nuget-client/build/runsettings.proj index aa506b38130..46f4d2bb0c5 100644 --- a/src/nuget-client/build/runsettings.proj +++ b/src/nuget-client/build/runsettings.proj @@ -12,7 +12,7 @@ TestCaseFilter=TestCategory=OptProf; OptProfCollector=enabled; IncludeProfilingInputs=true; - VsConfigPath=tests.optprof.dev$(VsTargetMajorVersion).vsconfig;" /> + VsConfigPath=tests.optprof.vsconfig;" /> enabled enabled enabled - tests.dev$(VsTargetMajorVersion).vsconfig + tests.vsconfig diff --git a/src/nuget-client/build/tests.optprof.dev17.vsconfig b/src/nuget-client/build/tests.optprof.vsconfig similarity index 100% rename from src/nuget-client/build/tests.optprof.dev17.vsconfig rename to src/nuget-client/build/tests.optprof.vsconfig diff --git a/src/nuget-client/build/tests.dev17.vsconfig b/src/nuget-client/build/tests.vsconfig similarity index 100% rename from src/nuget-client/build/tests.dev17.vsconfig rename to src/nuget-client/build/tests.vsconfig diff --git a/src/nuget-client/docs/coding-guidelines.md b/src/nuget-client/docs/coding-guidelines.md index 0fc2cc69fff..e85eba46a7d 100644 --- a/src/nuget-client/docs/coding-guidelines.md +++ b/src/nuget-client/docs/coding-guidelines.md @@ -44,6 +44,8 @@ The general rule we follow is "use Visual Studio defaults". 1. Avoid more than one empty line at any time. For example, do not have two blank lines between members of a type. +1. Avoid lines of code longer than 120 characters. + 1. Avoid spurious free spaces. For example avoid `if (someVar == 0)...`, where the dots mark the spurious free spaces. Consider enabling "View White Space (Ctrl+R, Ctrl+W)" or "Edit -> Advanced -> View White Space" if using Visual Studio to aid detection. 1. If a file happens to differ in style from these guidelines (e.g. private members are named `m_member` rather than `_member`), the existing style in that file takes precedence. Changes/refactorings are possible, but depending on the complexity, change frequency of the file, might need to be considered on their own merits in a separate pull request. diff --git a/src/nuget-client/eng/pipelines/templates/Initialize_Build.yml b/src/nuget-client/eng/pipelines/templates/Initialize_Build.yml index c0d4be381f4..ce7b878bf66 100644 --- a/src/nuget-client/eng/pipelines/templates/Initialize_Build.yml +++ b/src/nuget-client/eng/pipelines/templates/Initialize_Build.yml @@ -17,7 +17,12 @@ steps: } else { $targetChannelForTests = ((& dotnet msbuild $env:BUILD_REPOSITORY_LOCALPATH\build\config.props /restore:false "/ConsoleLoggerParameters:Verbosity=Minimal;NoSummary;ForceNoAlign" /nologo /target:GetVsTargetChannelForTests) | Out-String).Trim() } - $targetMajorVersion = ((& dotnet msbuild $env:BUILD_REPOSITORY_LOCALPATH\build\config.props /restore:false "/ConsoleLoggerParameters:Verbosity=Minimal;NoSummary;ForceNoAlign" /nologo /target:GetVsTargetMajorVersion) | Out-String).Trim() + if ([System.String]::IsNullOrEmpty($env:VsTargetMajorVersion) -eq $false) { + $targetMajorVersion = $env:VsTargetMajorVersion + } else { + $targetMajorVersion = ((& dotnet msbuild $env:BUILD_REPOSITORY_LOCALPATH\build\config.props /restore:false "/ConsoleLoggerParameters:Verbosity=Minimal;NoSummary;ForceNoAlign" /nologo /target:GetVsTargetMajorVersion) | Out-String).Trim() + } + Write-Host "##vso[task.setvariable variable=VsTargetChannel;isOutput=true]$targetChannel" Write-Host "##vso[task.setvariable variable=VsTargetChannelForTests;isOutput=true]$targetChannelForTests" Write-Host "##vso[task.setvariable variable=VsTargetMajorVersion;isOutput=true]$targetMajorVersion" diff --git a/src/nuget-client/scripts/e2etests/README.md b/src/nuget-client/scripts/e2etests/README.md index fb170efb3e6..18e8d56c49a 100644 --- a/src/nuget-client/scripts/e2etests/README.md +++ b/src/nuget-client/scripts/e2etests/README.md @@ -8,7 +8,7 @@ The [CreateEndToEndTestPackage.ps1](./../cibuild/CreateEndToEndTestPackage.ps1) This zip file can also be generated by the [build.ps1](./../../build.ps1) script. Note that the scripts assume certain relative paths that are correct within the zip, but may not work if you attempt to use the scripts from the repo location. -***NOTE:*** To ensure that all tests are runnable, you may need to update Visual Studio with [tests vs config](build\tests.dev17.vsconfig). +***NOTE:*** To ensure that all tests are runnable, you may need to update Visual Studio with [tests vs config](build\tests.vsconfig). ## Running the tests diff --git a/src/nuget-client/src/NuGet.Core/NuGet.Commands/RestoreCommand/DependencyGraphResolver.DependencyGraphItem.cs b/src/nuget-client/src/NuGet.Core/NuGet.Commands/RestoreCommand/DependencyGraphResolver.DependencyGraphItem.cs index c17cf1b150f..757d7ca21e3 100644 --- a/src/nuget-client/src/NuGet.Core/NuGet.Commands/RestoreCommand/DependencyGraphResolver.DependencyGraphItem.cs +++ b/src/nuget-client/src/NuGet.Core/NuGet.Commands/RestoreCommand/DependencyGraphResolver.DependencyGraphItem.cs @@ -86,6 +86,7 @@ public async Task> GetGraphItemAsync( IReadOnlyDictionary? packagesToPrune, bool enablePruningWarnings, bool isRootProject, + string targetGraphName, ILogger logger) { // Call the task to get the library, this may returned a cached result @@ -106,7 +107,7 @@ public async Task> GetGraphItemAsync( LibraryDependency dependency = item.Data.Dependencies[i]; // Skip any packages that should be pruned or will be replaced with a runtime dependency - if (ShouldPrunePackage(projectRestoreMetadata, packagesToPrune, enablePruningWarnings, dependency, item.Key, isRootProject, logger) + if (ShouldPrunePackage(projectRestoreMetadata, packagesToPrune, enablePruningWarnings, dependency, item.Key, isRootProject, targetGraphName, logger) || RuntimeDependencies?.Contains(dependency) == true) { continue; @@ -120,7 +121,7 @@ public async Task> GetGraphItemAsync( // Add any runtime dependencies unless they should be pruned foreach (LibraryDependency runtimeDependency in RuntimeDependencies) { - if (ShouldPrunePackage(projectRestoreMetadata, packagesToPrune, enablePruningWarnings, runtimeDependency, item.Key, isRootProject, logger) == true) + if (ShouldPrunePackage(projectRestoreMetadata, packagesToPrune, enablePruningWarnings, runtimeDependency, item.Key, isRootProject, targetGraphName, logger) == true) { continue; } @@ -160,6 +161,7 @@ private static bool ShouldPrunePackage( LibraryDependency dependency, LibraryIdentity parentLibrary, bool isRootProject, + string targetGraphName, ILogger logger) { if (packagesToPrune?.TryGetValue(dependency.Name, out PrunePackageReference? packageToPrune) != true @@ -178,7 +180,8 @@ private static bool ShouldPrunePackage( projectRestoreMetadata.UsingMicrosoftNETSdk, SdkAnalysisLevelMinimums.PruningWarnings)) { - logger.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1511, string.Format(CultureInfo.CurrentCulture, Strings.Error_RestorePruningProjectReference, dependency.Name))); + logger.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1511, string.Format(CultureInfo.CurrentCulture, Strings.Error_RestorePruningProjectReference, dependency.Name), dependency.Name, + targetGraphName)); } return false; @@ -191,7 +194,9 @@ private static bool ShouldPrunePackage( projectRestoreMetadata.UsingMicrosoftNETSdk, SdkAnalysisLevelMinimums.PruningWarnings)) { - logger.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1510, string.Format(CultureInfo.CurrentCulture, Strings.Error_RestorePruningDirectPackageReference, dependency.Name))); + logger.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1510, string.Format(CultureInfo.CurrentCulture, Strings.Error_RestorePruningDirectPackageReference, dependency.Name), + dependency.Name, + targetGraphName)); } return false; diff --git a/src/nuget-client/src/NuGet.Core/NuGet.Commands/RestoreCommand/DependencyGraphResolver.cs b/src/nuget-client/src/NuGet.Core/NuGet.Commands/RestoreCommand/DependencyGraphResolver.cs index 985d12f20b3..90afa5309a9 100644 --- a/src/nuget-client/src/NuGet.Core/NuGet.Commands/RestoreCommand/DependencyGraphResolver.cs +++ b/src/nuget-client/src/NuGet.Core/NuGet.Commands/RestoreCommand/DependencyGraphResolver.cs @@ -935,6 +935,9 @@ private async Task currentGraphItem = await currentDependencyGraphItem.GetGraphItemAsync(_request.Project.RestoreMetadata, projectTargetFramework.PackagesToPrune, IsNewerThanNET10(projectTargetFramework.FrameworkName), isRootProject, _logger); + GraphItem currentGraphItem = await currentDependencyGraphItem.GetGraphItemAsync(_request.Project.RestoreMetadata, projectTargetFramework.PackagesToPrune, IsNewerThanNET10(projectTargetFramework.FrameworkName), isRootProject, targetGraphName, _logger); LibraryDependencyTarget typeConstraint = currentDependencyGraphItem.LibraryDependency.LibraryRange.TypeConstraint; if (evictions.TryGetValue(currentDependencyGraphItem.LibraryRangeIndex, out (LibraryRangeIndex[], LibraryDependencyIndex, LibraryDependencyTarget) eviction)) diff --git a/src/nuget-client/src/NuGet.Core/NuGet.Commands/RestoreCommand/Diagnostics/UnexpectedDependencyMessages.cs b/src/nuget-client/src/NuGet.Core/NuGet.Commands/RestoreCommand/Diagnostics/UnexpectedDependencyMessages.cs index c4012371375..b3159622010 100644 --- a/src/nuget-client/src/NuGet.Core/NuGet.Commands/RestoreCommand/Diagnostics/UnexpectedDependencyMessages.cs +++ b/src/nuget-client/src/NuGet.Core/NuGet.Commands/RestoreCommand/Diagnostics/UnexpectedDependencyMessages.cs @@ -328,7 +328,7 @@ private static string[] GetDependencyTargetGraphs(PackageSpec spec, LibraryDepen } // Convert framework to target graph name. - return infos.Select(e => e.FrameworkName.DotNetFrameworkName).ToArray(); + return infos.Select(e => e.FrameworkName.ToString()).ToArray(); } } diff --git a/src/nuget-client/src/NuGet.Core/NuGet.Commands/RestoreCommand/SourceRepositoryDependencyProvider.cs b/src/nuget-client/src/NuGet.Core/NuGet.Commands/RestoreCommand/SourceRepositoryDependencyProvider.cs index c1e0a23c1ac..7660df08fbd 100644 --- a/src/nuget-client/src/NuGet.Core/NuGet.Commands/RestoreCommand/SourceRepositoryDependencyProvider.cs +++ b/src/nuget-client/src/NuGet.Core/NuGet.Commands/RestoreCommand/SourceRepositoryDependencyProvider.cs @@ -664,7 +664,7 @@ private async Task LogWarningAsync(ILogger logger, string id, FatalProtocolExcep { if (!_ignoreWarning) { - await logger.LogAsync(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1801, e.Message, id)); + await logger.LogAsync(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1801, e.Message)); } } @@ -681,7 +681,7 @@ private async Task LogErrorAsync(ILogger logger, string id, FatalProtocolExcepti } else { - await logger.LogAsync(RestoreLogMessage.CreateError(NuGetLogCode.NU1301, ExceptionUtilities.DisplayMessage(e), id)); + await logger.LogAsync(RestoreLogMessage.CreateError(NuGetLogCode.NU1301, ExceptionUtilities.DisplayMessage(e))); } } diff --git a/src/nuget-client/src/NuGet.Core/NuGet.Common/Errors/RestoreLogMessage.cs b/src/nuget-client/src/NuGet.Core/NuGet.Common/Errors/RestoreLogMessage.cs index b4ef4dc29ac..b02612c9fbb 100644 --- a/src/nuget-client/src/NuGet.Core/NuGet.Common/Errors/RestoreLogMessage.cs +++ b/src/nuget-client/src/NuGet.Core/NuGet.Common/Errors/RestoreLogMessage.cs @@ -79,6 +79,34 @@ public static RestoreLogMessage CreateWarning( }; } +#if DEBUG + [Obsolete("An argument for 'targetGraphs' must be provided. " + + "If the argument is not provided, the solution explorer will not add the surface the warning on the package node.", error: true)] + +#pragma warning disable RS0016 // Add public types and members to the declared API + public static RestoreLogMessage CreateWarning( +#pragma warning restore RS0016 // Add public types and members to the declared API + NuGetLogCode code, + string message, + string? libraryId) + { + throw new NotImplementedException(); + } + + [Obsolete("An argument for 'targetGraphs' must be provided. " + + "If the argument is not provided, the solution explorer will not add the surface the warning on the package node.", error: true)] + +#pragma warning disable RS0016 // Add public types and members to the declared API + public static RestoreLogMessage CreateError( +#pragma warning restore RS0016 // Add public types and members to the declared API + NuGetLogCode code, + string message, + string? libraryId) + { + throw new NotImplementedException(); + } +#endif + /// /// Create a warning log message. /// diff --git a/src/nuget-client/src/NuGet.Core/NuGet.PackageManagement/Utility/PackagesConfigLockFileUtility.cs b/src/nuget-client/src/NuGet.Core/NuGet.PackageManagement/Utility/PackagesConfigLockFileUtility.cs index c86c7bc59c6..ad93d4dcdf9 100644 --- a/src/nuget-client/src/NuGet.Core/NuGet.PackageManagement/Utility/PackagesConfigLockFileUtility.cs +++ b/src/nuget-client/src/NuGet.Core/NuGet.PackageManagement/Utility/PackagesConfigLockFileUtility.cs @@ -99,7 +99,7 @@ public static IReadOnlyList ValidatePackagesConfigLockFiles( { var message = string.Format(CultureInfo.CurrentCulture, Strings.Error_InvalidLockFileInput, lockFilePath); var errors = new List(); - var log = RestoreLogMessage.CreateError(NuGetLogCode.NU1005, message, packagesConfigFile); + var log = RestoreLogMessage.CreateError(NuGetLogCode.NU1005, message); log.ProjectPath = projectFile ?? packagesConfigFile; errors.Add(log); return errors; @@ -135,7 +135,7 @@ public static IReadOnlyList ValidatePackagesConfigLockFiles( foreach (var difference in comparisonResult.MatchedDependencies.Where(kvp => kvp.Key.ContentHash != kvp.Value.ContentHash)) { var message = string.Format(CultureInfo.CurrentCulture, Strings.Error_PackageValidationFailed, difference.Key.Id + "." + difference.Key.ResolvedVersion); - var log = RestoreLogMessage.CreateError(NuGetLogCode.NU1403, message, packagesConfigFile); + var log = RestoreLogMessage.CreateError(NuGetLogCode.NU1403, message); log.ProjectPath = projectFile ?? packagesConfigFile; errors.Add(log); } @@ -147,7 +147,7 @@ public static IReadOnlyList ValidatePackagesConfigLockFiles( if (restoreLockedMode) { var errors = new List(); - var log = RestoreLogMessage.CreateError(NuGetLogCode.NU1004, Strings.Error_RestoreInLockedModePackagesConfig, packagesConfigFile); + var log = RestoreLogMessage.CreateError(NuGetLogCode.NU1004, Strings.Error_RestoreInLockedModePackagesConfig); log.ProjectPath = projectFile ?? packagesConfigFile; errors.Add(log); return errors; diff --git a/src/nuget-client/test/NuGet.Core.FuncTests/NuGet.Commands.FuncTest/RestoreCommandTests.cs b/src/nuget-client/test/NuGet.Core.FuncTests/NuGet.Commands.FuncTest/RestoreCommandTests.cs index e3442377df3..7246d250ffe 100644 --- a/src/nuget-client/test/NuGet.Core.FuncTests/NuGet.Commands.FuncTest/RestoreCommandTests.cs +++ b/src/nuget-client/test/NuGet.Core.FuncTests/NuGet.Commands.FuncTest/RestoreCommandTests.cs @@ -3895,7 +3895,8 @@ public async Task Restore_WhenSourceDoesNotExist_ReportsNU1301InAssetsFile() result.Success.Should().BeFalse(because: logger.ShowMessages()); result.LockFile.Libraries.Should().HaveCount(0); result.LockFile.LogMessages.Should().HaveCount(1); - result.LockFile.LogMessages.Select(e => e.Code).Should().AllBeEquivalentTo(NuGetLogCode.NU1301); + result.LockFile.LogMessages[0].Code.Should().Be(NuGetLogCode.NU1301); + result.LockFile.LogMessages[0].LibraryId.Should().BeNull(); result.LockFile.Targets.Should().HaveCount(1); } @@ -3927,8 +3928,8 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async( // Assert result.Success.Should().BeTrue(because: logger.ShowMessages()); result.LockFile.Libraries.Should().HaveCount(1); - result.LockFile.LogMessages.Select(e => e.Code).Should().AllBeEquivalentTo(NuGetLogCode.NU1801); - + result.LockFile.LogMessages[0].Code.Should().Be(NuGetLogCode.NU1801); + result.LockFile.LogMessages[0].LibraryId.Should().BeNull(); static TestRestoreRequest CreateRestoreRequest(PackageSpec spec, string userPackagesFolder, List sources, ILogger logger) { return new TestRestoreRequest(spec, sources, userPackagesFolder, new TestSourceCacheContext { IgnoreFailedSources = true }, logger) @@ -4351,9 +4352,14 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async( // P -> A 1.0.0 -> B 1.0.0 // P -> C 1.0.0 - // Prune C 1.0.0 - [Fact] - public async Task RestoreCommand_WithPrunePackageReferences_DoesNotPruneDirectDependenciesAndWarns() + // Do not Prune C 1.0.0 + [Theory] + [InlineData("net10.0", "10.0.100", true, true)] + [InlineData("net10.0", "9.0.100", true, false)] + [InlineData("net10.0", "", false, true)] + [InlineData("net472", "", false, false)] + [InlineData("net472", "10.0.100", false, false)] + public async Task RestoreCommand_WithPrunePackageReferences_DoesNotPruneDirectDependencies(string framework, string sdkAnalysisLevel, bool usingMicrosoftNETSdk, bool shouldWarn) { using var pathContext = new SimpleTestPathContext(); @@ -4374,7 +4380,7 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async( var rootProject = @" { ""frameworks"": { - ""net10.0"": { + ""FRAMEWORK"": { ""dependencies"": { ""A"": { ""version"": ""[1.0.0,)"", @@ -4390,10 +4396,12 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async( } } } - }"; + }".Replace("FRAMEWORK", framework); // Setup project var projectSpec = ProjectTestHelpers.GetPackageSpecWithProjectNameAndSpec("Project1", pathContext.SolutionRoot, rootProject); + projectSpec.RestoreMetadata.SdkAnalysisLevel = !string.IsNullOrEmpty(sdkAnalysisLevel) ? NuGetVersion.Parse(sdkAnalysisLevel) : null; + projectSpec.RestoreMetadata.UsingMicrosoftNETSdk = usingMicrosoftNETSdk; // Act & Assert var result = await RunRestoreAsync(pathContext, projectSpec); @@ -4406,8 +4414,14 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async( result.LockFile.Targets[0].Libraries[1].Dependencies.Should().HaveCount(0); result.LockFile.Targets[0].Libraries[2].Name.Should().Be("C"); result.LockFile.Targets[0].Libraries[2].Dependencies.Should().HaveCount(0); - result.LockFile.LogMessages.Should().HaveCount(1); - result.LockFile.LogMessages[0].Code.Should().Be(NuGetLogCode.NU1510); + if (shouldWarn) + { + result.LockFile.LogMessages.Should().HaveCount(1); + result.LockFile.LogMessages[0].Code.Should().Be(NuGetLogCode.NU1510); + result.LockFile.LogMessages[0].LibraryId.Should().Be("C"); + result.LockFile.LogMessages[0].TargetGraphs.Should().HaveCount(1); + result.LockFile.LogMessages[0].TargetGraphs[0].Should().Be(framework); + } ISet installedPackages = result.GetAllInstalled(); installedPackages.Should().HaveCount(3); } @@ -4722,6 +4736,9 @@ await SimpleTestPackageUtility.CreateFolderFeedV3Async( { result.LockFile.LogMessages.Should().HaveCount(1); result.LockFile.LogMessages[0].Code.Should().Be(NuGetLogCode.NU1511); + result.LockFile.LogMessages[0].LibraryId.Should().Be("Project2"); + result.LockFile.LogMessages[0].TargetGraphs.Should().HaveCount(1); + result.LockFile.LogMessages[0].TargetGraphs[0].Should().Be(framework); } ISet installedPackages = result.GetAllInstalled(); installedPackages.Should().HaveCount(1); diff --git a/src/nuget-client/test/NuGet.Core.Tests/NuGet.Commands.Test/CollectorLoggerTests.cs b/src/nuget-client/test/NuGet.Core.Tests/NuGet.Commands.Test/CollectorLoggerTests.cs index 0aa20a8a709..669414ab491 100644 --- a/src/nuget-client/test/NuGet.Core.Tests/NuGet.Commands.Test/CollectorLoggerTests.cs +++ b/src/nuget-client/test/NuGet.Core.Tests/NuGet.Commands.Test/CollectorLoggerTests.cs @@ -727,7 +727,7 @@ public void CollectorLogger_DoesNotLogsWarningsForPackageSpecificNoWarnSetForGlo collector.Log(new RestoreLogMessage(LogLevel.Debug, "Debug") { ShouldDisplay = true }); collector.Log(new RestoreLogMessage(LogLevel.Verbose, "Verbose") { ShouldDisplay = true }); collector.Log(new RestoreLogMessage(LogLevel.Information, "Information") { ShouldDisplay = true }); - collector.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId)); + collector.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId, frameworkString)); collector.Log(new RestoreLogMessage(LogLevel.Error, NuGetLogCode.NU1000, "Error") { ShouldDisplay = true }); // Assert @@ -768,7 +768,7 @@ public void CollectorLogger_DoesNotLogsWarningsForPackageSpecificNoWarnSetForGlo collector.Log(new RestoreLogMessage(LogLevel.Debug, "Debug") { ShouldDisplay = true }); collector.Log(new RestoreLogMessage(LogLevel.Verbose, "Verbose") { ShouldDisplay = true }); collector.Log(new RestoreLogMessage(LogLevel.Information, "Information") { ShouldDisplay = true }); - collector.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId)); + collector.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId, frameworkString, netcoreFrameworkString)); collector.Log(new RestoreLogMessage(LogLevel.Error, NuGetLogCode.NU1000, "Error") { ShouldDisplay = true }); // Assert @@ -809,9 +809,9 @@ public void CollectorLogger_DoesNotLogsWarningsForPackageSpecificNoWarnSetWithMu collector.Log(new RestoreLogMessage(LogLevel.Debug, "Debug") { ShouldDisplay = true }); collector.Log(new RestoreLogMessage(LogLevel.Verbose, "Verbose") { ShouldDisplay = true }); collector.Log(new RestoreLogMessage(LogLevel.Information, "Information") { ShouldDisplay = true }); - collector.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId)); - collector.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1601, "Warning", libraryId)); - collector.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1605, "Warning", libraryId)); + collector.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId, frameworkString)); + collector.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1601, "Warning", libraryId, frameworkString)); + collector.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1605, "Warning", libraryId, frameworkString)); collector.Log(new RestoreLogMessage(LogLevel.Error, NuGetLogCode.NU1000, "Error") { ShouldDisplay = true }); // Assert @@ -854,9 +854,9 @@ public void CollectorLogger_DoesNotLogsWarningsForPackageSpecificNoWarnSetWithMu collector.Log(new RestoreLogMessage(LogLevel.Debug, "Debug") { ShouldDisplay = true }); collector.Log(new RestoreLogMessage(LogLevel.Verbose, "Verbose") { ShouldDisplay = true }); collector.Log(new RestoreLogMessage(LogLevel.Information, "Information") { ShouldDisplay = true }); - collector.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId)); - collector.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1601, "Warning", libraryId)); - collector.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1605, "Warning", libraryId)); + collector.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId, frameworkString, netcoreFrameworkString)); + collector.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1601, "Warning", libraryId, frameworkString, netcoreFrameworkString)); + collector.Log(RestoreLogMessage.CreateWarning(NuGetLogCode.NU1605, "Warning", libraryId, frameworkString, netcoreFrameworkString)); collector.Log(new RestoreLogMessage(LogLevel.Error, NuGetLogCode.NU1000, "Error") { ShouldDisplay = true }); // Assert diff --git a/src/nuget-client/test/NuGet.Core.Tests/NuGet.Commands.Test/UnexpectedDependencyMessagesTests.cs b/src/nuget-client/test/NuGet.Core.Tests/NuGet.Commands.Test/UnexpectedDependencyMessagesTests.cs index 0654d222d79..827e8fa2920 100644 --- a/src/nuget-client/test/NuGet.Core.Tests/NuGet.Commands.Test/UnexpectedDependencyMessagesTests.cs +++ b/src/nuget-client/test/NuGet.Core.Tests/NuGet.Commands.Test/UnexpectedDependencyMessagesTests.cs @@ -580,7 +580,7 @@ public void GivenAProjectWithAFrameworkSpecificDependencyVerifySingleTargetGraph [Fact] public void GivenAProjectWithADependencyOnAPackageWithANullRangeVerifyWarningMessage() { - var tfi = GetTFI(NuGetFramework.Parse("net46"), new LibraryRange("x", null, LibraryDependencyTarget.Package)); + var tfi = GetTFI(NuGetFramework.Parse("net9.0"), new LibraryRange("x", null, LibraryDependencyTarget.Package)); var project = new PackageSpec(tfi) { Name = "proj" @@ -589,6 +589,8 @@ public void GivenAProjectWithADependencyOnAPackageWithANullRangeVerifyWarningMes var log = UnexpectedDependencyMessages.GetProjectDependenciesMissingVersion(project).Single(); log.Code.Should().Be(NuGetLogCode.NU1604); + log.TargetGraphs.Should().HaveCount(1); + log.TargetGraphs[0].Should().Be("net9.0"); log.Message.Should().Be("Project dependency 'x' does not specify a version. Include a version for the dependency to ensure consistent restore results."); } @@ -596,7 +598,7 @@ public void GivenAProjectWithADependencyOnAPackageWithANullRangeVerifyWarningMes public void GivenAProjectWithADependencyOnAPackageWithNoLowerBoundVerifyWarningMessage() { var range = VersionRange.Parse("(, 2.0.0)"); - var tfi = GetTFI(NuGetFramework.Parse("net46"), new LibraryRange("x", range, LibraryDependencyTarget.Package)); + var tfi = GetTFI(NuGetFramework.Parse("net9.0"), new LibraryRange("x", range, LibraryDependencyTarget.Package)); var project = new PackageSpec(tfi) { Name = "proj" @@ -605,6 +607,8 @@ public void GivenAProjectWithADependencyOnAPackageWithNoLowerBoundVerifyWarningM var log = UnexpectedDependencyMessages.GetProjectDependenciesMissingLowerBounds(project).Single(); log.Code.Should().Be(NuGetLogCode.NU1604); + log.TargetGraphs.Should().HaveCount(1); + log.TargetGraphs[0].Should().Be("net9.0"); log.Message.Should().Be("Project dependency x (< 2.0.0) does not contain an inclusive lower bound. Include a lower bound in the dependency version to ensure consistent restore results."); } diff --git a/src/nuget-client/test/NuGet.Core.Tests/NuGet.Commands.Test/WarningPropertiesCollectionTests.cs b/src/nuget-client/test/NuGet.Core.Tests/NuGet.Commands.Test/WarningPropertiesCollectionTests.cs index 4499ca6b8be..d29e386d7b5 100644 --- a/src/nuget-client/test/NuGet.Core.Tests/NuGet.Commands.Test/WarningPropertiesCollectionTests.cs +++ b/src/nuget-client/test/NuGet.Core.Tests/NuGet.Commands.Test/WarningPropertiesCollectionTests.cs @@ -260,7 +260,7 @@ public void WarningPropertiesCollection_PackagePropertiesWithoutFrameworkAndWarn var warningPropertiesCollection = new WarningPropertiesCollection(null, packageSpecificWarningProperties, new List { targetFramework }); - var suppressedMessage = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId); + var suppressedMessage = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId, frameworkString); // Act && Assert Assert.True(warningPropertiesCollection.ApplyWarningProperties(suppressedMessage)); @@ -344,7 +344,7 @@ public void WarningPropertiesCollection_PackagePropertiesAndProjectPropertiesWit packageSpecificWarningProperties, null); - var suppressedMessage = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId); + var suppressedMessage = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId, frameworkString); // Act && Assert Assert.True(warningPropertiesCollection.ApplyWarningProperties(suppressedMessage)); @@ -376,7 +376,7 @@ public void WarningPropertiesCollection_PackagePropertiesWithNoWarnAndProjectPro new List { targetFramework }); var suppressedMessage = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId, frameworkString); - var suppressedMessage2 = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId); + var suppressedMessage2 = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId, frameworkString); var unaffectedMessage = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1601, "Warning", libraryId, frameworkString); // Act && Assert @@ -412,7 +412,7 @@ public void WarningPropertiesCollection_PackagePropertiesWithNoWarnAndProjectPro new List { targetFramework }); var suppressedMessage = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId, frameworkString); - var suppressedMessage2 = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId); + var suppressedMessage2 = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId, frameworkString); var upgradedMessage = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1601, "Warning", libraryId, frameworkString); // Act && Assert @@ -449,9 +449,12 @@ public void WarningPropertiesCollection_PackagePropertiesWithNoWarnAndProjectPro packageSpecificWarningProperties, new List { targetFramework }); - var suppressedMessage = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId, frameworkString); - var suppressedMessage2 = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId); - var unaffectedMessage = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1601, "Warning", libraryId); + var suppressedMessage = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning"); + suppressedMessage.LibraryId = libraryId; + var suppressedMessage2 = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning"); + suppressedMessage2.LibraryId = libraryId; + var unaffectedMessage = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1601, "Warning"); + unaffectedMessage.LibraryId = libraryId; // Act && Assert Assert.True(warningPropertiesCollection.ApplyWarningProperties(suppressedMessage)); @@ -490,7 +493,8 @@ public void WarningPropertiesCollection_MessageWithNoTargetGraphAndDependencyWit packageSpecificWarningProperties, new List { firstTargetFramework, secondTargetFramework }); - var nonSuppressedMessage = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId); + var nonSuppressedMessage = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning"); + nonSuppressedMessage.LibraryId = libraryId; var suppressedMessage = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId, firstFrameworkString); // Act && Assert @@ -529,7 +533,7 @@ public void WarningPropertiesCollection_MessageWithNoTargetGraphAndDependencyWit packageSpecificWarningProperties, new List { firstTargetFramework, secondTargetFramework }); - var suppressedMessage = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId); + var suppressedMessage = RestoreLogMessage.CreateWarning(NuGetLogCode.NU1500, "Warning", libraryId, firstFrameworkString, secondFrameworkString); // Act && Assert Assert.True(warningPropertiesCollection.ApplyWarningProperties(suppressedMessage)); diff --git a/src/razor/eng/Version.Details.xml b/src/razor/eng/Version.Details.xml index 77986faf489..0fabe455dc6 100644 --- a/src/razor/eng/Version.Details.xml +++ b/src/razor/eng/Version.Details.xml @@ -1,6 +1,6 @@ - + https://github.com/dotnet/roslyn diff --git a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.cs.xlf b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.cs.xlf index 1b5f8ac33af..98658e741fc 100644 --- a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.cs.xlf +++ b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.cs.xlf @@ -4,17 +4,17 @@ Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. - Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. + Metody v rozhraních dědících z IRemoteJsonService by neměly mít parametry typu RazorPinnedSolutionInfoWrapper nebo DocumentId, protože nejsou serializovatelné do formátu JSON. '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service - '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service + Parametr {0} v {1}.{2} má parametr typu {3}, který není ve službě JSON povolen. Invalid parameter type in IRemoteJsonService method - Invalid parameter type in IRemoteJsonService method + Neplatný typ parametru v metodě IRemoteJsonService diff --git a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.de.xlf b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.de.xlf index abb6cc29121..7cfe04c1c41 100644 --- a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.de.xlf +++ b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.de.xlf @@ -4,17 +4,17 @@ Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. - Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. + Methoden in Schnittstellen, die von "IRemoteJsonService" erben, dürfen keine Parameter vom Typ "RazorPinnedSolutionInfoWrapper" oder "DocumentId" aufweisen, da diese nicht mit JSON serialisierbar sind. '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service - '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service + Der Parameter "{0}" in "{1}.{2}" hat einen Parameter vom Typ "{3}", der in einem JSON-Dienst nicht zulässig ist. Invalid parameter type in IRemoteJsonService method - Invalid parameter type in IRemoteJsonService method + Ungültiger Parametertyp in der IRemoteJsonService-Methode. diff --git a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.es.xlf b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.es.xlf index f7b07ad79e0..ac0c45506f0 100644 --- a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.es.xlf +++ b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.es.xlf @@ -4,17 +4,17 @@ Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. - Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. + Los métodos de las interfaces que heredan de IRemoteJsonService no deben tener parámetros de tipo RazorPinnedSolutionInfoWrapper o DocumentId, ya que no son serializables en JSON. '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service - '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service + El parámetro "{0}" de "{1}.{2}" tiene un parámetro de tipo "{3}" que no se permite en un servicio JSON Invalid parameter type in IRemoteJsonService method - Invalid parameter type in IRemoteJsonService method + Tipo de parámetro no válido en el método IRemoteJsonService diff --git a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.fr.xlf b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.fr.xlf index feaa2763671..c27845611fc 100644 --- a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.fr.xlf +++ b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.fr.xlf @@ -4,17 +4,17 @@ Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. - Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. + Les méthodes dans les interfaces héritant du service IRemoteJsonService ne doivent pas avoir de paramètres de type RazorPinnedSolutionInfoWrapper ou DocumentId, car ils ne sont pas sérialisables au format JSON. '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service - '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service + Le paramètre « {0} » dans « {1}.{2} » contient un paramètre de type « {3} » non autorisé dans un service JSON Invalid parameter type in IRemoteJsonService method - Invalid parameter type in IRemoteJsonService method + Type de paramètre non valide dans la méthode IRemoteJsonService diff --git a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.it.xlf b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.it.xlf index ae16576a920..cac69f10ac7 100644 --- a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.it.xlf +++ b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.it.xlf @@ -4,17 +4,17 @@ Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. - Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. + I metodi nelle interfacce che ereditano da IRemoteJsonService non devono avere parametri di tipo RazorPinnedSolutionInfoWrapper o DocumentId, poiché non sono serializzabili in Json. '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service - '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service + Il parametro '{0}' in '{1}.{2}' ha un parametro di tipo '{3}' che non è consentito in un servizio Json Invalid parameter type in IRemoteJsonService method - Invalid parameter type in IRemoteJsonService method + Tipo di parametro non valido nel metodo IRemoteJsonService diff --git a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.ja.xlf b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.ja.xlf index 46b4fd04fa5..6e71db75442 100644 --- a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.ja.xlf +++ b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.ja.xlf @@ -4,17 +4,17 @@ Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. - Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. + IRemoteJsonService から継承するインターフェイス内のメソッドは、Json シリアル化できないため、RazorPinnedSolutionInfoWrapper または DocumentId 型のパラメーターを持つべきではありません。 '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service - '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service + '{1}.{2}' の '{0}' パラメーターには型 '{3}' のパラメーターがあり、Json サービスでは使用できません Invalid parameter type in IRemoteJsonService method - Invalid parameter type in IRemoteJsonService method + IRemoteJsonService メソッドのパラメーターの型が無効です diff --git a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.ko.xlf b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.ko.xlf index 86a9cbc3ef3..d0437b0814f 100644 --- a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.ko.xlf +++ b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.ko.xlf @@ -4,17 +4,17 @@ Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. - Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. + IRemoteJsonService에서 상속되는 인터페이스의 메서드는 Json 직렬화가 불가능하므로 RazorPinnedSolutionInfoWrapper 또는 DocumentId 형식의 매개 변수를 사용할 수 없습니다. '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service - '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service + '{0}' 매개 변수는 '{1}.{2}'에서 Json 서비스에서 허용되지 않는 '{3}' 형식의 매개 변수를 가지고 있습니다. Invalid parameter type in IRemoteJsonService method - Invalid parameter type in IRemoteJsonService method + IRemoteJsonService 메서드의 매개 변수 형식이 잘못되었습니다. diff --git a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.pl.xlf b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.pl.xlf index b7a92fb3bf5..7d9e614e933 100644 --- a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.pl.xlf +++ b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.pl.xlf @@ -4,17 +4,17 @@ Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. - Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. + Metody w interfejsach dziedziczących po IRemoteJsonService nie powinny mieć parametrów typu RazorPinnedSolutionInfoWrapper ani DocumentId, ponieważ nie są one serializowalne w formacie JSON. '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service - '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service + Parametr „{0}” w „{1}.{2}” ma typ „{3}”, co jest niedozwolone w usłudze JSON Invalid parameter type in IRemoteJsonService method - Invalid parameter type in IRemoteJsonService method + Nieprawidłowy typ parametru w metodzie IRemoteJsonService diff --git a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.pt-BR.xlf b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.pt-BR.xlf index 2ac506dfd68..77cc290e754 100644 --- a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.pt-BR.xlf +++ b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.pt-BR.xlf @@ -4,17 +4,17 @@ Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. - Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. + Métodos em interfaces que herdam de IRemoteJsonService não devem ter parâmetros do tipo RazorPinnedSolutionInfoWrapper ou DocumentId, pois eles não são serializáveis em Json. '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service - '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service + O parâmetro '{0}' em '{1}.{2}' tem um parâmetro do tipo '{3}', o que não é permitido em um serviço Json Invalid parameter type in IRemoteJsonService method - Invalid parameter type in IRemoteJsonService method + Tipo de parâmetro inválido no método IRemoteJsonService diff --git a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.ru.xlf b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.ru.xlf index 98be70b8043..8e46174837d 100644 --- a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.ru.xlf +++ b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.ru.xlf @@ -4,17 +4,17 @@ Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. - Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. + Методы в интерфейсах, наследуемых от IRemoteJsonService, не должны иметь параметров типа RazorPinnedSolutionInfoWrapper или DocumentId, поскольку они не являются Json-сериализуемыми. '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service - '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service + Параметр «{0}» в «{1}.{2}» имеет параметр тип «{3}», который недопустим в службе JSON Invalid parameter type in IRemoteJsonService method - Invalid parameter type in IRemoteJsonService method + Недопустимый тип параметра в методе IRemoteJsonService diff --git a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.tr.xlf b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.tr.xlf index 6d2ded04391..8b3c307e8ea 100644 --- a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.tr.xlf +++ b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.tr.xlf @@ -4,17 +4,17 @@ Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. - Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. + IRemoteJsonService'ten devralan arabirimlerde RazorPinnedSolutionInfoWrapper veya DocumentId türünde parametreler bulunmamalıdır, çünkü bunlar Json seri hale getirilebilir değildir. '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service - '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service + '{1}.{2}' içindeki '{0}' parametresi, Json hizmetlerinde izin verilmeyen '{3}' türünde bir parametre içeriyor. Invalid parameter type in IRemoteJsonService method - Invalid parameter type in IRemoteJsonService method + IRemoteJsonService yönteminde geçersiz parametre türü diff --git a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.zh-Hans.xlf b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.zh-Hans.xlf index 5b4f0e1f423..46bc8dfefe7 100644 --- a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.zh-Hans.xlf +++ b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.zh-Hans.xlf @@ -4,17 +4,17 @@ Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. - Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. + 从 IRemoteJsonService 继承的接口中的方法不应具有类型为 RazorPinnedSolutionInfoWrapper 或 DocumentId 的参数,因为它们无法实现 Json 序列化。 '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service - '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service + "{1}.{2}" 中的 "{0}" 参数具有类型为 "{3}" 的参数,而该类型在 Json 服务中是不允许的 Invalid parameter type in IRemoteJsonService method - Invalid parameter type in IRemoteJsonService method + IRemoteJsonService 方法中的参数类型无效 diff --git a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.zh-Hant.xlf b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.zh-Hant.xlf index f5434b402c9..6a4e20d547b 100644 --- a/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.zh-Hant.xlf +++ b/src/razor/src/Analyzers/Razor.Diagnostics.Analyzers/xlf/Resources.zh-Hant.xlf @@ -4,17 +4,17 @@ Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. - Methods in interfaces inheriting from IRemoteJsonService should not have parameters of type RazorPinnedSolutionInfoWrapper or DocumentId as they are not Json serializable. + 介面中繼承自 IRemoteJsonService 的方法不得具有 RazorPinnedSolutionInfoWrapper 或 DocumentId 類型的參數,因為它們不是 Json 可序列化的。 '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service - '{0}' parameter in '{1}.{2}' has a parameter of type '{3}' which is not allowed in a Json service + '{1}.{2}' 中的 '{0}' 參數具有 '{3}' 類型的參數,而 Json 服務不允許此參數 Invalid parameter type in IRemoteJsonService method - Invalid parameter type in IRemoteJsonService method + IRemoteJsonService 方法中無效的參數類型 diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/DirectiveTokenEditHandlerTest.cs b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/DirectiveTokenEditHandlerTest.cs index c06b2d354b3..9286710aeb1 100644 --- a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/DirectiveTokenEditHandlerTest.cs +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/DirectiveTokenEditHandlerTest.cs @@ -7,6 +7,7 @@ using System.Linq; using Microsoft.AspNetCore.Razor.Language.Legacy; using Microsoft.AspNetCore.Razor.Language.Syntax; +using Microsoft.AspNetCore.Razor.PooledObjects; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.Test; @@ -63,13 +64,14 @@ public void CanAcceptChange_RejectsWhitespaceChanges(int index, int length, stri private static CSharpStatementLiteralSyntax GetSyntaxNode(DirectiveTokenEditHandler editHandler, string content) { - using var _ = SyntaxListBuilderPool.GetPooledBuilder(out var builder); + using PooledArrayBuilder builder = []; var tokens = NativeCSharpLanguageCharacteristics.Instance.TokenizeString(content).ToArray(); foreach (var token in tokens) { builder.Add((SyntaxToken)token.CreateRed()); } + var node = SyntaxFactory.CSharpStatementLiteral(builder.ToList(), SpanChunkGenerator.Null); return node.WithEditHandler(editHandler); diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs index aac19e0cefe..6552d391309 100644 --- a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/IntegrationTests/ComponentCodeGenerationTestBase.cs @@ -9339,6 +9339,150 @@ public class MyComponent : ComponentBase where T : IMyInterface CompileToAssembly(generated); } + [IntegrationTestFact, WorkItem("https://github.com/dotnet/razor/issues/11552")] + public void GenericComponentTypeUsage() + { + // Act + var generated = CompileToCSharp(""" + @typeparam TItem + @code { + [Parameter] + public TItem MyItem { get; set; } + } + + + """); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + + [IntegrationTestFact, WorkItem("https://github.com/dotnet/razor/issues/11552")] + public void GenericComponentTypeUsageWithInference() + { + // Act + var generated = CompileToCSharp(""" + @typeparam TItem + @code { + [Parameter] + public TItem MyItem { get; set; } + } + + + """); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + + [IntegrationTestFact, WorkItem("https://github.com/dotnet/razor/issues/11552")] + public void GenericComponentMultipleTypeParamUsage() + { + // Act + var generated = CompileToCSharp(""" + @typeparam TItem + @typeparam TItem2 + @code { + [Parameter] + public TItem MyItem { get; set; } + + [Parameter] + public TItem2 MyItem2 { get; set; } + } + + + """); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + + [IntegrationTestFact, WorkItem("https://github.com/dotnet/razor/issues/11552")] + public void GenericComponentTypeParamUsageWithImplicitExpression() + { + // Act + var generated = CompileToCSharp(""" + @typeparam TItem + @code { + [Parameter] + public TItem MyItem { get; set; } + } + + + """); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + + [IntegrationTestFact, WorkItem("https://github.com/dotnet/razor/issues/11552")] + public void GenericComponentTypeParamUsageWithImplicitExpression2() + { + // Act + var generated = CompileToCSharp(""" + @typeparam TItem + @code { + [Parameter] + public TItem MyItem { get; set; } + } + + + """); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + + [IntegrationTestFact, WorkItem("https://github.com/dotnet/razor/issues/11552")] + public void GenericComponentTypeUsageWhitespace() + { + // Act + var generated = CompileToCSharp(""" + @typeparam TItem + @code { + [Parameter] + public TItem MyItem { get; set; } + } + + + """); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + + [IntegrationTestFact, WorkItem("https://github.com/dotnet/razor/issues/11552")] + public void GenericComponentTypeUsageWithGenericType() + { + // Act + var generated = CompileToCSharp(""" + @typeparam TItem + @code { + [Parameter] + public TItem MyItem { get; set; } + } + + + """); + + // Assert + AssertDocumentNodeMatchesBaseline(generated.CodeDocument); + AssertCSharpDocumentMatchesBaseline(generated.CodeDocument); + CompileToAssembly(generated); + } + #endregion #region Key diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/Legacy/CodeBlockEditHandlerTest.cs b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/Legacy/CodeBlockEditHandlerTest.cs index 4e9f7392d21..7bb8db71ab6 100644 --- a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/Legacy/CodeBlockEditHandlerTest.cs +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/Legacy/CodeBlockEditHandlerTest.cs @@ -6,6 +6,7 @@ using System.Linq; using Microsoft.AspNetCore.Razor.Language.Legacy; using Microsoft.AspNetCore.Razor.Language.Syntax; +using Microsoft.AspNetCore.Razor.PooledObjects; using Xunit; namespace Microsoft.AspNetCore.Razor.Language.Test.Legacy; @@ -281,7 +282,7 @@ public void ContainsInvalidContent_ValidContent_ReturnsFalse(string content) private static SyntaxNode GetSpan(SourceLocation start, string content) { - using var _ = SyntaxListBuilderPool.GetPooledBuilder(out var builder); + using PooledArrayBuilder builder = []; var tokens = NativeCSharpLanguageCharacteristics.Instance.TokenizeString(content).ToArray(); foreach (var token in tokens) diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_AtSpecifiedInRazorFileForTypeParameter/TestComponent.ir.txt b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_AtSpecifiedInRazorFileForTypeParameter/TestComponent.ir.txt index e314add09ef..243880045e8 100644 --- a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_AtSpecifiedInRazorFileForTypeParameter/TestComponent.ir.txt +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/ChildComponent_AtSpecifiedInRazorFileForTypeParameter/TestComponent.ir.txt @@ -16,7 +16,6 @@ MethodDeclaration - - protected override - void - BuildRenderTree Component - (0:0,0 [26] x:\dir\subdir\Test\TestComponent.cshtml) - C ComponentTypeArgument - (6:0,6 [7] x:\dir\subdir\Test\TestComponent.cshtml) - T - CSharpExpression - (7:0,7 [6] x:\dir\subdir\Test\TestComponent.cshtml) - LazyIntermediateToken - (7:0,7 [6] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - string + LazyIntermediateToken - (7:0,7 [6] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - string ComponentAttribute - (21:0,21 [1] x:\dir\subdir\Test\TestComponent.cshtml) - Item - Item - AttributeStructure.DoubleQuotes LazyIntermediateToken - (21:0,21 [1] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - 1 diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentMultipleTypeParamUsage/TestComponent.codegen.cs b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentMultipleTypeParamUsage/TestComponent.codegen.cs new file mode 100644 index 00000000000..a9005f9b71d --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentMultipleTypeParamUsage/TestComponent.codegen.cs @@ -0,0 +1,93 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + #nullable restore + public partial class TestComponent< +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" +TItem + +#line default +#line hidden +#nullable disable + , +#nullable restore +#line 2 "x:\dir\subdir\Test\TestComponent.cshtml" +TItem2 + +#line default +#line hidden +#nullable disable + > : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + ((global::System.Action)(() => { + } + ))(); + ((global::System.Action)(() => { + } + ))(); + } + #pragma warning restore 219 + #pragma warning disable 0414 + private static object __o = null; + #pragma warning restore 0414 + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + __o = typeof( +#nullable restore +#line 11 "x:\dir\subdir\Test\TestComponent.cshtml" + int + +#line default +#line hidden +#nullable disable + ); + __o = typeof( +#nullable restore +#line 11 "x:\dir\subdir\Test\TestComponent.cshtml" + string + +#line default +#line hidden +#nullable disable + ); + __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { + } + )); +#nullable restore +#line 11 "x:\dir\subdir\Test\TestComponent.cshtml" +__o = typeof(global::Test.TestComponent<,>); + +#line default +#line hidden +#nullable disable + } + #pragma warning restore 1998 +#nullable restore +#line 3 "x:\dir\subdir\Test\TestComponent.cshtml" + + [Parameter] + public TItem MyItem { get; set; } + + [Parameter] + public TItem2 MyItem2 { get; set; } + +#line default +#line hidden +#nullable disable + } +} +#pragma warning restore 1591 diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentMultipleTypeParamUsage/TestComponent.ir.txt b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentMultipleTypeParamUsage/TestComponent.ir.txt new file mode 100644 index 00000000000..3ace9255615 --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentMultipleTypeParamUsage/TestComponent.ir.txt @@ -0,0 +1,27 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TItem, TItem2 + DesignTimeDirective - + DirectiveToken - (11:0,11 [5] x:\dir\subdir\Test\TestComponent.cshtml) - TItem + DirectiveToken - (29:1,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) - TItem2 + CSharpCode - + IntermediateToken - - CSharp - #pragma warning disable 0414 + CSharpCode - + IntermediateToken - - CSharp - private static object __o = null; + CSharpCode - + IntermediateToken - - CSharp - #pragma warning restore 0414 + MethodDeclaration - - protected override - void - BuildRenderTree + HtmlContent - (163:8,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (163:8,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n + Component - (167:10,0 [45] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent + ComponentTypeArgument - (190:10,23 [3] x:\dir\subdir\Test\TestComponent.cshtml) - TItem2 + LazyIntermediateToken - (190:10,23 [3] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - int + ComponentTypeArgument - (202:10,35 [6] x:\dir\subdir\Test\TestComponent.cshtml) - TItem + LazyIntermediateToken - (202:10,35 [6] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - string + CSharpCode - (44:2,7 [118] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (44:2,7 [118] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n [Parameter]\n public TItem MyItem { get; set; }\n\n [Parameter]\n public TItem2 MyItem2 { get; set; }\n diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentMultipleTypeParamUsage/TestComponent.mappings.txt b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentMultipleTypeParamUsage/TestComponent.mappings.txt new file mode 100644 index 00000000000..e69d8e6c540 --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentMultipleTypeParamUsage/TestComponent.mappings.txt @@ -0,0 +1,37 @@ +Source Location: (11:0,11 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|TItem| +Generated Location: (462:16,0 [5] ) +|TItem| + +Source Location: (29:1,11 [6] x:\dir\subdir\Test\TestComponent.cshtml) +|TItem2| +Generated Location: (596:24,0 [6] ) +|TItem2| + +Source Location: (190:10,23 [3] x:\dir\subdir\Test\TestComponent.cshtml) +|int| +Generated Location: (1442:51,23 [3] ) +|int| + +Source Location: (202:10,35 [6] x:\dir\subdir\Test\TestComponent.cshtml) +|string| +Generated Location: (1646:60,35 [6] ) +|string| + +Source Location: (44:2,7 [118] x:\dir\subdir\Test\TestComponent.cshtml) +| + [Parameter] + public TItem MyItem { get; set; } + + [Parameter] + public TItem2 MyItem2 { get; set; } +| +Generated Location: (2176:80,7 [118] ) +| + [Parameter] + public TItem MyItem { get; set; } + + [Parameter] + public TItem2 MyItem2 { get; set; } +| + diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression/TestComponent.codegen.cs b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression/TestComponent.codegen.cs new file mode 100644 index 00000000000..4929a21cbbb --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression/TestComponent.codegen.cs @@ -0,0 +1,70 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + #nullable restore + public partial class TestComponent< +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" +TItem + +#line default +#line hidden +#nullable disable + > : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + ((global::System.Action)(() => { + } + ))(); + } + #pragma warning restore 219 + #pragma warning disable 0414 + private static object __o = null; + #pragma warning restore 0414 + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + __o = typeof( +#nullable restore +#line 7 "x:\dir\subdir\Test\TestComponent.cshtml" + string + +#line default +#line hidden +#nullable disable + ); + __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { + } + )); +#nullable restore +#line 7 "x:\dir\subdir\Test\TestComponent.cshtml" +__o = typeof(global::Test.TestComponent<>); + +#line default +#line hidden +#nullable disable + } + #pragma warning restore 1998 +#nullable restore +#line 2 "x:\dir\subdir\Test\TestComponent.cshtml" + + [Parameter] + public TItem MyItem { get; set; } + +#line default +#line hidden +#nullable disable + } +} +#pragma warning restore 1591 diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression/TestComponent.ir.txt b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression/TestComponent.ir.txt new file mode 100644 index 00000000000..dd648495fd8 --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression/TestComponent.ir.txt @@ -0,0 +1,24 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TItem + DesignTimeDirective - + DirectiveToken - (11:0,11 [5] x:\dir\subdir\Test\TestComponent.cshtml) - TItem + CSharpCode - + IntermediateToken - - CSharp - #pragma warning disable 0414 + CSharpCode - + IntermediateToken - - CSharp - private static object __o = null; + CSharpCode - + IntermediateToken - - CSharp - #pragma warning restore 0414 + MethodDeclaration - - protected override - void - BuildRenderTree + HtmlContent - (84:4,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (84:4,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n + Component - (88:6,0 [33] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent + ComponentTypeArgument - (110:6,22 [7] x:\dir\subdir\Test\TestComponent.cshtml) - TItem + LazyIntermediateToken - (111:6,23 [6] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - string + CSharpCode - (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n [Parameter]\n public TItem MyItem { get; set; }\n diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression/TestComponent.mappings.txt b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression/TestComponent.mappings.txt new file mode 100644 index 00000000000..dd02cc0b7e7 --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression/TestComponent.mappings.txt @@ -0,0 +1,21 @@ +Source Location: (11:0,11 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|TItem| +Generated Location: (462:16,0 [5] ) +|TItem| + +Source Location: (111:6,23 [6] x:\dir\subdir\Test\TestComponent.cshtml) +|string| +Generated Location: (1238:40,23 [6] ) +|string| + +Source Location: (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) +| + [Parameter] + public TItem MyItem { get; set; } +| +Generated Location: (1766:60,7 [58] ) +| + [Parameter] + public TItem MyItem { get; set; } +| + diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression2/TestComponent.codegen.cs b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression2/TestComponent.codegen.cs new file mode 100644 index 00000000000..ec7c1c46786 --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression2/TestComponent.codegen.cs @@ -0,0 +1,70 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + #nullable restore + public partial class TestComponent< +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" +TItem + +#line default +#line hidden +#nullable disable + > : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + ((global::System.Action)(() => { + } + ))(); + } + #pragma warning restore 219 + #pragma warning disable 0414 + private static object __o = null; + #pragma warning restore 0414 + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + __o = typeof( +#nullable restore +#line 7 "x:\dir\subdir\Test\TestComponent.cshtml" + string + +#line default +#line hidden +#nullable disable + ); + __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { + } + )); +#nullable restore +#line 7 "x:\dir\subdir\Test\TestComponent.cshtml" +__o = typeof(global::Test.TestComponent<>); + +#line default +#line hidden +#nullable disable + } + #pragma warning restore 1998 +#nullable restore +#line 2 "x:\dir\subdir\Test\TestComponent.cshtml" + + [Parameter] + public TItem MyItem { get; set; } + +#line default +#line hidden +#nullable disable + } +} +#pragma warning restore 1591 diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression2/TestComponent.ir.txt b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression2/TestComponent.ir.txt new file mode 100644 index 00000000000..fae50c6b495 --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression2/TestComponent.ir.txt @@ -0,0 +1,24 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TItem + DesignTimeDirective - + DirectiveToken - (11:0,11 [5] x:\dir\subdir\Test\TestComponent.cshtml) - TItem + CSharpCode - + IntermediateToken - - CSharp - #pragma warning disable 0414 + CSharpCode - + IntermediateToken - - CSharp - private static object __o = null; + CSharpCode - + IntermediateToken - - CSharp - #pragma warning restore 0414 + MethodDeclaration - - protected override - void - BuildRenderTree + HtmlContent - (84:4,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (84:4,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n + Component - (88:6,0 [35] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent + ComponentTypeArgument - (110:6,22 [9] x:\dir\subdir\Test\TestComponent.cshtml) - TItem + LazyIntermediateToken - (112:6,24 [6] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - string + CSharpCode - (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n [Parameter]\n public TItem MyItem { get; set; }\n diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression2/TestComponent.mappings.txt b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression2/TestComponent.mappings.txt new file mode 100644 index 00000000000..f15a96017d8 --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeParamUsageWithImplicitExpression2/TestComponent.mappings.txt @@ -0,0 +1,21 @@ +Source Location: (11:0,11 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|TItem| +Generated Location: (462:16,0 [5] ) +|TItem| + +Source Location: (112:6,24 [6] x:\dir\subdir\Test\TestComponent.cshtml) +|string| +Generated Location: (1239:40,24 [6] ) +|string| + +Source Location: (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) +| + [Parameter] + public TItem MyItem { get; set; } +| +Generated Location: (1767:60,7 [58] ) +| + [Parameter] + public TItem MyItem { get; set; } +| + diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsage/TestComponent.codegen.cs b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsage/TestComponent.codegen.cs new file mode 100644 index 00000000000..de248f96cc5 --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsage/TestComponent.codegen.cs @@ -0,0 +1,70 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + #nullable restore + public partial class TestComponent< +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" +TItem + +#line default +#line hidden +#nullable disable + > : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + ((global::System.Action)(() => { + } + ))(); + } + #pragma warning restore 219 + #pragma warning disable 0414 + private static object __o = null; + #pragma warning restore 0414 + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + __o = typeof( +#nullable restore +#line 7 "x:\dir\subdir\Test\TestComponent.cshtml" + string + +#line default +#line hidden +#nullable disable + ); + __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { + } + )); +#nullable restore +#line 7 "x:\dir\subdir\Test\TestComponent.cshtml" +__o = typeof(global::Test.TestComponent<>); + +#line default +#line hidden +#nullable disable + } + #pragma warning restore 1998 +#nullable restore +#line 2 "x:\dir\subdir\Test\TestComponent.cshtml" + + [Parameter] + public TItem MyItem { get; set; } + +#line default +#line hidden +#nullable disable + } +} +#pragma warning restore 1591 diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsage/TestComponent.ir.txt b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsage/TestComponent.ir.txt new file mode 100644 index 00000000000..dea31c376c0 --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsage/TestComponent.ir.txt @@ -0,0 +1,24 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TItem + DesignTimeDirective - + DirectiveToken - (11:0,11 [5] x:\dir\subdir\Test\TestComponent.cshtml) - TItem + CSharpCode - + IntermediateToken - - CSharp - #pragma warning disable 0414 + CSharpCode - + IntermediateToken - - CSharp - private static object __o = null; + CSharpCode - + IntermediateToken - - CSharp - #pragma warning restore 0414 + MethodDeclaration - - protected override - void - BuildRenderTree + HtmlContent - (84:4,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (84:4,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n + Component - (88:6,0 [32] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent + ComponentTypeArgument - (110:6,22 [6] x:\dir\subdir\Test\TestComponent.cshtml) - TItem + LazyIntermediateToken - (110:6,22 [6] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - string + CSharpCode - (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n [Parameter]\n public TItem MyItem { get; set; }\n diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsage/TestComponent.mappings.txt b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsage/TestComponent.mappings.txt new file mode 100644 index 00000000000..a1a0c53fcc2 --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsage/TestComponent.mappings.txt @@ -0,0 +1,21 @@ +Source Location: (11:0,11 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|TItem| +Generated Location: (462:16,0 [5] ) +|TItem| + +Source Location: (110:6,22 [6] x:\dir\subdir\Test\TestComponent.cshtml) +|string| +Generated Location: (1237:40,22 [6] ) +|string| + +Source Location: (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) +| + [Parameter] + public TItem MyItem { get; set; } +| +Generated Location: (1765:60,7 [58] ) +| + [Parameter] + public TItem MyItem { get; set; } +| + diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWhitespace/TestComponent.codegen.cs b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWhitespace/TestComponent.codegen.cs new file mode 100644 index 00000000000..023528f8450 --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWhitespace/TestComponent.codegen.cs @@ -0,0 +1,70 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + #nullable restore + public partial class TestComponent< +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" +TItem + +#line default +#line hidden +#nullable disable + > : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + ((global::System.Action)(() => { + } + ))(); + } + #pragma warning restore 219 + #pragma warning disable 0414 + private static object __o = null; + #pragma warning restore 0414 + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + __o = typeof( +#nullable restore +#line 7 "x:\dir\subdir\Test\TestComponent.cshtml" + string + +#line default +#line hidden +#nullable disable + ); + __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { + } + )); +#nullable restore +#line 7 "x:\dir\subdir\Test\TestComponent.cshtml" +__o = typeof(global::Test.TestComponent<>); + +#line default +#line hidden +#nullable disable + } + #pragma warning restore 1998 +#nullable restore +#line 2 "x:\dir\subdir\Test\TestComponent.cshtml" + + [Parameter] + public TItem MyItem { get; set; } + +#line default +#line hidden +#nullable disable + } +} +#pragma warning restore 1591 diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWhitespace/TestComponent.ir.txt b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWhitespace/TestComponent.ir.txt new file mode 100644 index 00000000000..8fe91441092 --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWhitespace/TestComponent.ir.txt @@ -0,0 +1,24 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TItem + DesignTimeDirective - + DirectiveToken - (11:0,11 [5] x:\dir\subdir\Test\TestComponent.cshtml) - TItem + CSharpCode - + IntermediateToken - - CSharp - #pragma warning disable 0414 + CSharpCode - + IntermediateToken - - CSharp - private static object __o = null; + CSharpCode - + IntermediateToken - - CSharp - #pragma warning restore 0414 + MethodDeclaration - - protected override - void - BuildRenderTree + HtmlContent - (84:4,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (84:4,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n + Component - (88:6,0 [36] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent + ComponentTypeArgument - (110:6,22 [10] x:\dir\subdir\Test\TestComponent.cshtml) - TItem + LazyIntermediateToken - (110:6,22 [10] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - string + CSharpCode - (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n [Parameter]\n public TItem MyItem { get; set; }\n diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWhitespace/TestComponent.mappings.txt b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWhitespace/TestComponent.mappings.txt new file mode 100644 index 00000000000..46719e0dca1 --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWhitespace/TestComponent.mappings.txt @@ -0,0 +1,21 @@ +Source Location: (11:0,11 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|TItem| +Generated Location: (462:16,0 [5] ) +|TItem| + +Source Location: (110:6,22 [10] x:\dir\subdir\Test\TestComponent.cshtml) +| string | +Generated Location: (1237:40,22 [10] ) +| string | + +Source Location: (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) +| + [Parameter] + public TItem MyItem { get; set; } +| +Generated Location: (1769:60,7 [58] ) +| + [Parameter] + public TItem MyItem { get; set; } +| + diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithGenericType/TestComponent.codegen.cs b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithGenericType/TestComponent.codegen.cs new file mode 100644 index 00000000000..62e51f5ed6d --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithGenericType/TestComponent.codegen.cs @@ -0,0 +1,70 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + #nullable restore + public partial class TestComponent< +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" +TItem + +#line default +#line hidden +#nullable disable + > : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + ((global::System.Action)(() => { + } + ))(); + } + #pragma warning restore 219 + #pragma warning disable 0414 + private static object __o = null; + #pragma warning restore 0414 + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + __o = typeof( +#nullable restore +#line 7 "x:\dir\subdir\Test\TestComponent.cshtml" + TestComponent + +#line default +#line hidden +#nullable disable + ); + __builder.AddAttribute(-1, "ChildContent", (global::Microsoft.AspNetCore.Components.RenderFragment)((__builder2) => { + } + )); +#nullable restore +#line 7 "x:\dir\subdir\Test\TestComponent.cshtml" +__o = typeof(global::Test.TestComponent<>); + +#line default +#line hidden +#nullable disable + } + #pragma warning restore 1998 +#nullable restore +#line 2 "x:\dir\subdir\Test\TestComponent.cshtml" + + [Parameter] + public TItem MyItem { get; set; } + +#line default +#line hidden +#nullable disable + } +} +#pragma warning restore 1591 diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithGenericType/TestComponent.ir.txt b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithGenericType/TestComponent.ir.txt new file mode 100644 index 00000000000..c6f596faa5e --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithGenericType/TestComponent.ir.txt @@ -0,0 +1,24 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TItem + DesignTimeDirective - + DirectiveToken - (11:0,11 [5] x:\dir\subdir\Test\TestComponent.cshtml) - TItem + CSharpCode - + IntermediateToken - - CSharp - #pragma warning disable 0414 + CSharpCode - + IntermediateToken - - CSharp - private static object __o = null; + CSharpCode - + IntermediateToken - - CSharp - #pragma warning restore 0414 + MethodDeclaration - - protected override - void - BuildRenderTree + HtmlContent - (84:4,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (84:4,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n + Component - (88:6,0 [47] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent + ComponentTypeArgument - (110:6,22 [21] x:\dir\subdir\Test\TestComponent.cshtml) - TItem + LazyIntermediateToken - (110:6,22 [21] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - TestComponent + CSharpCode - (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n [Parameter]\n public TItem MyItem { get; set; }\n diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithGenericType/TestComponent.mappings.txt b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithGenericType/TestComponent.mappings.txt new file mode 100644 index 00000000000..1358f89cd24 --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithGenericType/TestComponent.mappings.txt @@ -0,0 +1,21 @@ +Source Location: (11:0,11 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|TItem| +Generated Location: (462:16,0 [5] ) +|TItem| + +Source Location: (110:6,22 [21] x:\dir\subdir\Test\TestComponent.cshtml) +|TestComponent| +Generated Location: (1237:40,22 [21] ) +|TestComponent| + +Source Location: (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) +| + [Parameter] + public TItem MyItem { get; set; } +| +Generated Location: (1780:60,7 [58] ) +| + [Parameter] + public TItem MyItem { get; set; } +| + diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithInference/TestComponent.codegen.cs b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithInference/TestComponent.codegen.cs new file mode 100644 index 00000000000..1846e6159af --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithInference/TestComponent.codegen.cs @@ -0,0 +1,92 @@ +// +#pragma warning disable 1591 +namespace Test +{ + #line default + using global::System; + using global::System.Collections.Generic; + using global::System.Linq; + using global::System.Threading.Tasks; + using global::Microsoft.AspNetCore.Components; + #line default + #line hidden + #nullable restore + public partial class TestComponent< +#nullable restore +#line 1 "x:\dir\subdir\Test\TestComponent.cshtml" +TItem + +#line default +#line hidden +#nullable disable + > : global::Microsoft.AspNetCore.Components.ComponentBase + #nullable disable + { + #pragma warning disable 219 + private void __RazorDirectiveTokenHelpers__() { + ((global::System.Action)(() => { + } + ))(); + } + #pragma warning restore 219 + #pragma warning disable 0414 + private static object __o = null; + #pragma warning restore 0414 + #pragma warning disable 1998 + protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) + { + var __typeInference_CreateTestComponent_0 = global::__Blazor.Test.TestComponent.TypeInference.CreateTestComponent_0(__builder, -1, -1, +#nullable restore +#line 7 "x:\dir\subdir\Test\TestComponent.cshtml" + 1 + +#line default +#line hidden +#nullable disable + ); + #pragma warning disable BL0005 + __typeInference_CreateTestComponent_0. +#nullable restore +#line 7 "x:\dir\subdir\Test\TestComponent.cshtml" + MyItem + +#line default +#line hidden +#nullable disable + = default; + #pragma warning restore BL0005 +#nullable restore +#line 7 "x:\dir\subdir\Test\TestComponent.cshtml" +__o = typeof(global::Test.TestComponent<>); + +#line default +#line hidden +#nullable disable + } + #pragma warning restore 1998 +#nullable restore +#line 2 "x:\dir\subdir\Test\TestComponent.cshtml" + + [Parameter] + public TItem MyItem { get; set; } + +#line default +#line hidden +#nullable disable + } +} +namespace __Blazor.Test.TestComponent +{ + #line hidden + internal static class TypeInference + { + public static global::Test.TestComponent CreateTestComponent_0(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder, int seq, int __seq0, TItem __arg0) + { + __builder.OpenComponent>(seq); + __builder.AddAttribute(__seq0, "MyItem", (object)__arg0); + __builder.CloseComponent(); + return default; + } + } +} +#pragma warning restore 1591 diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithInference/TestComponent.ir.txt b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithInference/TestComponent.ir.txt new file mode 100644 index 00000000000..10c17dcf1df --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithInference/TestComponent.ir.txt @@ -0,0 +1,27 @@ +Document - + NamespaceDeclaration - - Test + UsingDirective - (3:1,1 [20] ) - global::System + UsingDirective - (26:2,1 [40] ) - global::System.Collections.Generic + UsingDirective - (69:3,1 [25] ) - global::System.Linq + UsingDirective - (97:4,1 [36] ) - global::System.Threading.Tasks + UsingDirective - (136:5,1 [45] ) - global::Microsoft.AspNetCore.Components + ClassDeclaration - - public partial - TestComponent - global::Microsoft.AspNetCore.Components.ComponentBase - - TItem + DesignTimeDirective - + DirectiveToken - (11:0,11 [5] x:\dir\subdir\Test\TestComponent.cshtml) - TItem + CSharpCode - + IntermediateToken - - CSharp - #pragma warning disable 0414 + CSharpCode - + IntermediateToken - - CSharp - private static object __o = null; + CSharpCode - + IntermediateToken - - CSharp - #pragma warning restore 0414 + MethodDeclaration - - protected override - void - BuildRenderTree + HtmlContent - (84:4,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (84:4,1 [4] x:\dir\subdir\Test\TestComponent.cshtml) - Html - \n\n + Component - (88:6,0 [28] x:\dir\subdir\Test\TestComponent.cshtml) - TestComponent + ComponentAttribute - (111:6,23 [1] x:\dir\subdir\Test\TestComponent.cshtml) - MyItem - MyItem - AttributeStructure.DoubleQuotes + LazyIntermediateToken - (111:6,23 [1] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - 1 + CSharpCode - (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) + LazyIntermediateToken - (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) - CSharp - \n [Parameter]\n public TItem MyItem { get; set; }\n + NamespaceDeclaration - - __Blazor.Test.TestComponent + ClassDeclaration - - internal static - TypeInference - - + ComponentTypeInferenceMethod - - __Blazor.Test.TestComponent.TypeInference - CreateTestComponent_0 diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithInference/TestComponent.mappings.txt b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithInference/TestComponent.mappings.txt new file mode 100644 index 00000000000..737f49fb41a --- /dev/null +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentDesignTimeCodeGenerationTest/GenericComponentTypeUsageWithInference/TestComponent.mappings.txt @@ -0,0 +1,26 @@ +Source Location: (11:0,11 [5] x:\dir\subdir\Test\TestComponent.cshtml) +|TItem| +Generated Location: (462:16,0 [5] ) +|TItem| + +Source Location: (111:6,23 [1] x:\dir\subdir\Test\TestComponent.cshtml) +|1| +Generated Location: (1360:40,23 [1] ) +|1| + +Source Location: (103:6,15 [6] x:\dir\subdir\Test\TestComponent.cshtml) +|MyItem| +Generated Location: (1610:50,15 [6] ) +|MyItem| + +Source Location: (25:1,7 [58] x:\dir\subdir\Test\TestComponent.cshtml) +| + [Parameter] + public TItem MyItem { get; set; } +| +Generated Location: (2028:68,7 [58] ) +| + [Parameter] + public TItem MyItem { get; set; } +| + diff --git a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.codegen.cs b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.codegen.cs index ab08e5ff407..4d080a4798e 100644 --- a/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.codegen.cs +++ b/src/razor/src/Compiler/Microsoft.AspNetCore.Razor.Language/test/TestFiles/IntegrationTests/ComponentRuntimeCodeGenerationTest/BindToGenericComponent_ExplicitType_WithAfter_Action/TestComponent.codegen.cs @@ -17,7 +17,15 @@ public partial class TestComponent : global::Microsoft.AspNetCore.Components.Com #pragma warning disable 1998 protected override void BuildRenderTree(global::Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder __builder) { - __builder.OpenComponent>(0); + __builder.OpenComponent