From 61f459670cc1694c67e09c1f0a370306bafafdf8 Mon Sep 17 00:00:00 2001 From: Elitsa Marinovska <21998037+elit0451@users.noreply.github.com> Date: Thu, 18 Nov 2021 15:35:42 +0100 Subject: [PATCH] Update to .NET6 and ASP.NET Core 6 (#11652) * Changed targetFramework in nuspec file & project files + updated NuGet dependencies * Updated .net version in pipelines * Updated .net version in templates * Update more dependencies * Fixed ambiguous call to DistinctBy() - part of Umbraco.Extensions and System.Linq * Disabling the Razor source generators in .NET 6 due to error: "Cannot find the fallback endpoint specified by route values..." * Fixed unit tests Co-authored-by: Bjarke Berg --- build/NuSpecs/UmbracoCms.nuspec | 2 +- build/azure-pipelines.yml | 36 +++++++++--------- .../.template.config/template.json | 8 +--- .../UmbracoPackage/UmbracoPackage.csproj | 4 +- .../.template.config/template.json | 8 +--- .../UmbracoProject/UmbracoProject.csproj | 2 +- src/JsonSchema/JsonSchema.csproj | 4 +- .../Extensions/EnumerableExtensions.cs | 6 +-- .../Packaging/PackagesRepository.cs | 2 +- .../Routing/UrlProviderExtensions.cs | 2 +- src/Umbraco.Core/Umbraco.Core.csproj | 20 +++++----- .../Umbraco.Examine.Lucene.csproj | 6 +-- .../Manifest/ManifestParser.cs | 2 +- .../DeleteKeysAndIndexesBuilder.cs | 4 +- .../Install/DatabaseSchemaCreator.cs | 2 +- .../Implement/ExternalLoginRepository.cs | 4 +- .../Implement/MemberGroupRepository.cs | 4 +- .../Repositories/Implement/UserRepository.cs | 2 +- ...peServiceBaseOfTRepositoryTItemTService.cs | 6 +-- .../Umbraco.Infrastructure.csproj | 37 ++++++++++--------- .../Umbraco.Persistence.SqlCe.csproj | 4 +- .../Umbraco.PublishedCache.NuCache.csproj | 8 ++-- .../Umbraco.Web.BackOffice.csproj | 6 +-- .../Umbraco.Web.Common.csproj | 16 ++++---- src/Umbraco.Web.UI/Umbraco.Web.UI.csproj | 9 +++-- .../Umbraco.Web.Website.csproj | 6 +-- .../Umbraco.TestData/Umbraco.TestData.csproj | 2 +- .../Umbraco.Tests.Benchmarks.csproj | 4 +- .../Umbraco.Tests.Common.csproj | 6 +-- .../Umbraco.Tests.Integration.SqlCe.csproj | 10 ++--- .../Umbraco.Tests.Integration.csproj | 12 +++--- .../Umbraco.Core/Published/ModelTypeTests.cs | 2 +- .../Umbraco.Tests.UnitTests.csproj | 14 +++---- .../Routing/TestRouteBuilder.cs | 6 +++ 34 files changed, 134 insertions(+), 132 deletions(-) diff --git a/build/NuSpecs/UmbracoCms.nuspec b/build/NuSpecs/UmbracoCms.nuspec index 0c9c914d6c..00515660fe 100644 --- a/build/NuSpecs/UmbracoCms.nuspec +++ b/build/NuSpecs/UmbracoCms.nuspec @@ -16,7 +16,7 @@ umbraco - + diff --git a/build/azure-pipelines.yml b/build/azure-pipelines.yml index 988265eb5d..f7d94f1b8b 100644 --- a/build/azure-pipelines.yml +++ b/build/azure-pipelines.yml @@ -49,9 +49,9 @@ stages: vmImage: ubuntu-latest steps: - task: UseDotNet@2 - displayName: Use .Net 5.x + displayName: Use .Net 6.x inputs: - version: 5.x + version: 6.x - task: DotNetCoreCLI@2 displayName: dotnet build inputs: @@ -69,9 +69,9 @@ stages: vmImage: macOS-latest steps: - task: UseDotNet@2 - displayName: Use .Net 5.x + displayName: Use .Net 6.x inputs: - version: 5.x + version: 6.x - task: DotNetCoreCLI@2 displayName: dotnet build inputs: @@ -89,9 +89,9 @@ stages: vmImage: windows-latest steps: - task: UseDotNet@2 - displayName: Use .Net 5.x + displayName: Use .Net 6.x inputs: - version: 5.x + version: 6.x - task: DotNetCoreCLI@2 displayName: dotnet build inputs: @@ -116,9 +116,9 @@ stages: vmImage: ubuntu-latest steps: - task: UseDotNet@2 - displayName: Use .Net 5.x + displayName: Use .Net 6.x inputs: - version: 5.x + version: 6.x - task: DotNetCoreCLI@2 displayName: dotnet build inputs: @@ -139,9 +139,9 @@ stages: vmImage: windows-latest steps: - task: UseDotNet@2 - displayName: Use .Net 5.x + displayName: Use .Net 6.x inputs: - version: 5.x + version: 6.x - powershell: sqllocaldb start mssqllocaldb displayName: Start MSSQL LocalDb - task: DotNetCoreCLI@2 @@ -181,9 +181,9 @@ stages: vmImage: windows-latest steps: - task: UseDotNet@2 - displayName: Use .Net 5.x + displayName: Use .Net 6.x inputs: - version: 5.x + version: 6.x - powershell: sqllocaldb start mssqllocaldb displayName: Start MSSQL LocalDb @@ -278,9 +278,9 @@ stages: vmImage: ubuntu-latest steps: - task: UseDotNet@2 - displayName: Use .Net 5.x + displayName: Use .Net 6.x inputs: - version: 5.x + version: 6.x - task: Bash@3 displayName: Create database inputs: @@ -380,9 +380,9 @@ stages: vmImage: windows-latest steps: - task: UseDotNet@2 - displayName: Use .Net 5.x + displayName: Use .Net 6.x inputs: - version: 5.x + version: 6.x - task: NuGetToolInstaller@1 displayName: Use NuGet Latest - task: NuGetCommand@2 @@ -533,9 +533,9 @@ stages: vmImage: windows-latest steps: - task: UseDotNet@2 - displayName: Use .Net 5.x + displayName: Use .Net 6.x inputs: - version: 5.x + version: 6.x - task: PowerShell@2 displayName: 'Prep build tool - C# Docs' inputs: diff --git a/build/templates/UmbracoPackage/.template.config/template.json b/build/templates/UmbracoPackage/.template.config/template.json index 64785c0f59..247dda7d72 100644 --- a/build/templates/UmbracoPackage/.template.config/template.json +++ b/build/templates/UmbracoPackage/.template.config/template.json @@ -83,17 +83,13 @@ "description": "The target framework for the project.", "datatype": "choice", "choices": [ - { - "choice": "net5.0", - "description": "Target net5.0" - }, { "choice": "net6.0", "description": "Target net6.0" } ], - "replaces": "net5.0", - "defaultValue": "net5.0" + "replaces": "net6.0", + "defaultValue": "net6.0" } } } diff --git a/build/templates/UmbracoPackage/UmbracoPackage.csproj b/build/templates/UmbracoPackage/UmbracoPackage.csproj index a1ec4fa23d..a26c959092 100644 --- a/build/templates/UmbracoPackage/UmbracoPackage.csproj +++ b/build/templates/UmbracoPackage/UmbracoPackage.csproj @@ -1,6 +1,6 @@ - + - net5.0 + net6.0 . UmbracoPackage UmbracoPackage diff --git a/build/templates/UmbracoProject/.template.config/template.json b/build/templates/UmbracoProject/.template.config/template.json index 7e4e8afb27..397f751676 100644 --- a/build/templates/UmbracoProject/.template.config/template.json +++ b/build/templates/UmbracoProject/.template.config/template.json @@ -79,17 +79,13 @@ "description": "The target framework for the project", "datatype": "choice", "choices": [ - { - "choice": "net5.0", - "description": "Target net5.0" - }, { "choice": "net6.0", "description": "Target net6.0" } ], - "replaces": "net5.0", - "defaultValue": "net5.0" + "replaces": "net6.0", + "defaultValue": "net6.0" }, "SkipRestore": { "type": "parameter", diff --git a/build/templates/UmbracoProject/UmbracoProject.csproj b/build/templates/UmbracoProject/UmbracoProject.csproj index 99e72bae0f..088cfab554 100644 --- a/build/templates/UmbracoProject/UmbracoProject.csproj +++ b/build/templates/UmbracoProject/UmbracoProject.csproj @@ -1,7 +1,7 @@  - net5.0 + net6.0 Umbraco.Cms.Web.UI $(DefaultItemExcludes);App_Plugins/**; $(DefaultItemExcludes);umbraco/**; diff --git a/src/JsonSchema/JsonSchema.csproj b/src/JsonSchema/JsonSchema.csproj index 3b64612b62..441abba8ba 100644 --- a/src/JsonSchema/JsonSchema.csproj +++ b/src/JsonSchema/JsonSchema.csproj @@ -2,7 +2,7 @@ Exe - net5.0 + net6.0 true @@ -10,7 +10,7 @@ - + diff --git a/src/Umbraco.Core/Extensions/EnumerableExtensions.cs b/src/Umbraco.Core/Extensions/EnumerableExtensions.cs index 895a423ea2..1833a59b1e 100644 --- a/src/Umbraco.Core/Extensions/EnumerableExtensions.cs +++ b/src/Umbraco.Core/Extensions/EnumerableExtensions.cs @@ -1,4 +1,4 @@ -// Copyright (c) Umbraco. +// Copyright (c) Umbraco. // See LICENSE for more details. using System; @@ -75,13 +75,13 @@ namespace Umbraco.Extensions yield return result; } - /// The distinct by. + /// The legacy distinct by. /// The source. /// The key selector. /// Source type /// Key type /// the unique list - public static IEnumerable DistinctBy(this IEnumerable source, Func keySelector) + public static IEnumerable LegacyDistinctBy(this IEnumerable source, Func keySelector) where TKey : IEquatable { return source.Distinct(DelegateEqualityComparer.CompareMember(keySelector)); diff --git a/src/Umbraco.Core/Packaging/PackagesRepository.cs b/src/Umbraco.Core/Packaging/PackagesRepository.cs index 2ab24fa593..2b169f3603 100644 --- a/src/Umbraco.Core/Packaging/PackagesRepository.cs +++ b/src/Umbraco.Core/Packaging/PackagesRepository.cs @@ -578,7 +578,7 @@ namespace Umbraco.Cms.Core.Packaging ////Now, we have all property Ids/Aliases and their referenced document Ids and tags //var allExportedTaggedEntities = allTaggedEntities.Where(x => allExportedIds.Contains(x.EntityId)) - // .DistinctBy(x => x.EntityId) + // .LegacyDistinctBy(x => x.EntityId) // .OrderBy(x => x.EntityId); //foreach (var taggedEntity in allExportedTaggedEntities) diff --git a/src/Umbraco.Core/Routing/UrlProviderExtensions.cs b/src/Umbraco.Core/Routing/UrlProviderExtensions.cs index c3e2bdee77..085629eac8 100644 --- a/src/Umbraco.Core/Routing/UrlProviderExtensions.cs +++ b/src/Umbraco.Core/Routing/UrlProviderExtensions.cs @@ -79,7 +79,7 @@ namespace Umbraco.Extensions // in some cases there will be the same URL for multiple cultures: // * The entire branch is invariant // * If there are less domain/cultures assigned to the branch than the number of cultures/languages installed - foreach (UrlInfo dUrl in urlGroup.DistinctBy(x => x.Text.ToUpperInvariant()).OrderBy(x => x.Text).ThenBy(x => x.Culture)) + foreach (UrlInfo dUrl in urlGroup.LegacyDistinctBy(x => x.Text.ToUpperInvariant()).OrderBy(x => x.Text).ThenBy(x => x.Culture)) { result.Add(dUrl); } diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index 734ed2261d..5996d238bb 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -15,21 +15,21 @@ - - - - - - - - + + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all diff --git a/src/Umbraco.Examine.Lucene/Umbraco.Examine.Lucene.csproj b/src/Umbraco.Examine.Lucene/Umbraco.Examine.Lucene.csproj index 118a895073..8d36b990c4 100644 --- a/src/Umbraco.Examine.Lucene/Umbraco.Examine.Lucene.csproj +++ b/src/Umbraco.Examine.Lucene/Umbraco.Examine.Lucene.csproj @@ -21,12 +21,12 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/src/Umbraco.Infrastructure/Manifest/ManifestParser.cs b/src/Umbraco.Infrastructure/Manifest/ManifestParser.cs index 529a148093..cf74bda50a 100644 --- a/src/Umbraco.Infrastructure/Manifest/ManifestParser.cs +++ b/src/Umbraco.Infrastructure/Manifest/ManifestParser.cs @@ -169,7 +169,7 @@ namespace Umbraco.Cms.Core.Manifest if (manifest.GridEditors != null) gridEditors.AddRange(manifest.GridEditors); if (manifest.ContentApps != null) contentApps.AddRange(manifest.ContentApps); if (manifest.Dashboards != null) dashboards.AddRange(manifest.Dashboards); - if (manifest.Sections != null) sections.AddRange(manifest.Sections.DistinctBy(x => x.Alias.ToLowerInvariant())); + if (manifest.Sections != null) sections.AddRange(manifest.Sections.LegacyDistinctBy(x => x.Alias.ToLowerInvariant())); } return new CompositePackageManifest( diff --git a/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/KeysAndIndexes/DeleteKeysAndIndexesBuilder.cs b/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/KeysAndIndexes/DeleteKeysAndIndexesBuilder.cs index 5a669e182a..1cef9e4851 100644 --- a/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/KeysAndIndexes/DeleteKeysAndIndexesBuilder.cs +++ b/src/Umbraco.Infrastructure/Migrations/Expressions/Delete/KeysAndIndexes/DeleteKeysAndIndexesBuilder.cs @@ -29,10 +29,10 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Expressions.Delete.KeysAndIndexe _context.BuildingExpression = false; //get a list of all constraints - this will include all PK, FK and unique constraints - var tableConstraints = _context.SqlContext.SqlSyntax.GetConstraintsPerTable(_context.Database).DistinctBy(x => x.Item2).ToList(); + var tableConstraints = _context.SqlContext.SqlSyntax.GetConstraintsPerTable(_context.Database).LegacyDistinctBy(x => x.Item2).ToList(); //get a list of defined indexes - this will include all indexes, unique indexes and unique constraint indexes - var indexes = _context.SqlContext.SqlSyntax.GetDefinedIndexesDefinitions(_context.Database).DistinctBy(x => x.IndexName).ToList(); + var indexes = _context.SqlContext.SqlSyntax.GetDefinedIndexesDefinitions(_context.Database).LegacyDistinctBy(x => x.IndexName).ToList(); var uniqueConstraintNames = tableConstraints.Where(x => !x.Item2.InvariantStartsWith("PK_") && !x.Item2.InvariantStartsWith("FK_")).Select(x => x.Item2); var indexNames = indexes.Select(x => x.IndexName).ToList(); diff --git a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs index 4052a8ae56..b36a21b95b 100644 --- a/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs +++ b/src/Umbraco.Infrastructure/Migrations/Install/DatabaseSchemaCreator.cs @@ -189,7 +189,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Install private void ValidateDbConstraints(DatabaseSchemaResult result) { //Check constraints in configured database against constraints in schema - var constraintsInDatabase = SqlSyntax.GetConstraintsPerColumn(_database).DistinctBy(x => x.Item3).ToList(); + var constraintsInDatabase = SqlSyntax.GetConstraintsPerColumn(_database).LegacyDistinctBy(x => x.Item3).ToList(); var foreignKeysInDatabase = constraintsInDatabase.Where(x => x.Item3.InvariantStartsWith("FK_")).Select(x => x.Item3).ToList(); var primaryKeysInDatabase = constraintsInDatabase.Where(x => x.Item3.InvariantStartsWith("PK_")).Select(x => x.Item3).ToList(); diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ExternalLoginRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ExternalLoginRepository.cs index 64200d3bbe..814bfefc88 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ExternalLoginRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/ExternalLoginRepository.cs @@ -37,7 +37,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement .ForUpdate(); // deduplicate the logins - logins = logins.DistinctBy(x => x.ProviderKey + x.LoginProvider).ToList(); + logins = logins.LegacyDistinctBy(x => x.ProviderKey + x.LoginProvider).ToList(); var toUpdate = new Dictionary(); var toDelete = new List(); @@ -225,7 +225,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement .ToDictionary(x => x.LoginProvider, x => x.Id); // deduplicate the tokens - tokens = tokens.DistinctBy(x => x.LoginProvider + x.Name).ToList(); + tokens = tokens.LegacyDistinctBy(x => x.LoginProvider + x.Name).ToList(); var providers = tokens.Select(x => x.LoginProvider).Distinct().ToList(); diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MemberGroupRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MemberGroupRepository.cs index 6563bbde97..82d9255bb5 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MemberGroupRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/MemberGroupRepository.cs @@ -182,7 +182,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement .Where(x => x.Member == memberId); return Database.Fetch(sql) - .DistinctBy(dto => dto.NodeId) + .LegacyDistinctBy(dto => dto.NodeId) .Select(x => MemberGroupFactory.BuildEntity(x)); } @@ -199,7 +199,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement .Where("cmsMember.LoginName=@loginName", new { loginName = username }); return Database.Fetch(sql) - .DistinctBy(dto => dto.NodeId) + .LegacyDistinctBy(dto => dto.NodeId) .Select(x => MemberGroupFactory.BuildEntity(x)); } diff --git a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/UserRepository.cs b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/UserRepository.cs index 855beac27e..b94daf5d83 100644 --- a/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/UserRepository.cs +++ b/src/Umbraco.Infrastructure/Persistence/Repositories/Implement/UserRepository.cs @@ -284,7 +284,7 @@ SELECT 4 AS [Key], COUNT(id) AS [Value] FROM umbracoUser WHERE userDisabled = 0 protected override IEnumerable PerformGetByQuery(IQuery query) { var dtos = GetDtosWith(sql => new SqlTranslator(sql, query).Translate(), true) - .DistinctBy(x => x.Id) + .LegacyDistinctBy(x => x.Id) .ToList(); var users = new IUser[dtos.Count]; diff --git a/src/Umbraco.Infrastructure/Services/Implement/ContentTypeServiceBaseOfTRepositoryTItemTService.cs b/src/Umbraco.Infrastructure/Services/Implement/ContentTypeServiceBaseOfTRepositoryTItemTService.cs index c1c22d0b89..9dca6ca650 100644 --- a/src/Umbraco.Infrastructure/Services/Implement/ContentTypeServiceBaseOfTRepositoryTItemTService.cs +++ b/src/Umbraco.Infrastructure/Services/Implement/ContentTypeServiceBaseOfTRepositoryTItemTService.cs @@ -598,7 +598,7 @@ namespace Umbraco.Cms.Core.Services.Implement scope.Notifications.Publish(GetContentTypeChangedNotification(changes, eventMessages)); - DeletedNotification deletedNotification = GetDeletedNotification(deleted.DistinctBy(x => x.Id), eventMessages); + DeletedNotification deletedNotification = GetDeletedNotification(deleted.LegacyDistinctBy(x => x.Id), eventMessages); deletedNotification.WithStateFrom(deletingNotification); scope.Notifications.Publish(deletedNotification); @@ -625,7 +625,7 @@ namespace Umbraco.Cms.Core.Services.Implement // all descendants are going to be deleted TItem[] allDescendantsAndSelf = itemsA.SelectMany(xx => GetDescendants(xx.Id, true)) - .DistinctBy(x => x.Id) + .LegacyDistinctBy(x => x.Id) .ToArray(); TItem[] deleted = allDescendantsAndSelf; @@ -656,7 +656,7 @@ namespace Umbraco.Cms.Core.Services.Implement scope.Notifications.Publish(GetContentTypeChangedNotification(changes, eventMessages)); - DeletedNotification deletedNotification = GetDeletedNotification(deleted.DistinctBy(x => x.Id), eventMessages); + DeletedNotification deletedNotification = GetDeletedNotification(deleted.LegacyDistinctBy(x => x.Id), eventMessages); deletedNotification.WithStateFrom(deletingNotification); scope.Notifications.Publish(deletedNotification); diff --git a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj index 1d2f8bc505..806fe0853d 100644 --- a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj +++ b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj @@ -1,4 +1,4 @@ - + netstandard2.0 @@ -18,18 +18,21 @@ - + - + - + - - - - - - + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + @@ -37,21 +40,21 @@ - + - + - + - - - - + + + + all diff --git a/src/Umbraco.Persistence.SqlCe/Umbraco.Persistence.SqlCe.csproj b/src/Umbraco.Persistence.SqlCe/Umbraco.Persistence.SqlCe.csproj index 70366707e7..86aaafa5ec 100644 --- a/src/Umbraco.Persistence.SqlCe/Umbraco.Persistence.SqlCe.csproj +++ b/src/Umbraco.Persistence.SqlCe/Umbraco.Persistence.SqlCe.csproj @@ -14,12 +14,12 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj b/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj index 2115eab398..061f5b3d23 100644 --- a/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj +++ b/src/Umbraco.PublishedCache.NuCache/Umbraco.PublishedCache.NuCache.csproj @@ -15,14 +15,14 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + - + all diff --git a/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj b/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj index 56c1eb5492..7172a94291 100644 --- a/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj +++ b/src/Umbraco.Web.BackOffice/Umbraco.Web.BackOffice.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 Library Umbraco.Cms.Web.BackOffice Umbraco.Cms.Web.BackOffice @@ -19,13 +19,13 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj b/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj index 537df5aab4..aa7314b388 100644 --- a/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj +++ b/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 Library Umbraco.Cms.Web.Common Umbraco.Cms.Web.Common @@ -25,20 +25,20 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + - + all diff --git a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj index bae39162f4..2a4fe7f940 100644 --- a/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj +++ b/src/Umbraco.Web.UI/Umbraco.Web.UI.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 Umbraco.Cms.Web.UI @@ -66,12 +66,12 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all @@ -79,6 +79,7 @@ false false + false diff --git a/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj b/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj index 7dab73b100..0bb0b6c0ad 100644 --- a/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj +++ b/src/Umbraco.Web.Website/Umbraco.Web.Website.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 Library Umbraco.Cms.Web.Website Umbraco.Cms.Web.Website @@ -28,11 +28,11 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all diff --git a/tests/Umbraco.TestData/Umbraco.TestData.csproj b/tests/Umbraco.TestData/Umbraco.TestData.csproj index c54dedf06f..6343a92def 100644 --- a/tests/Umbraco.TestData/Umbraco.TestData.csproj +++ b/tests/Umbraco.TestData/Umbraco.TestData.csproj @@ -3,7 +3,7 @@ false Umbraco.TestData - net5.0 + net6.0 diff --git a/tests/Umbraco.Tests.Benchmarks/Umbraco.Tests.Benchmarks.csproj b/tests/Umbraco.Tests.Benchmarks/Umbraco.Tests.Benchmarks.csproj index 55a2b609a9..52ba3c6a37 100644 --- a/tests/Umbraco.Tests.Benchmarks/Umbraco.Tests.Benchmarks.csproj +++ b/tests/Umbraco.Tests.Benchmarks/Umbraco.Tests.Benchmarks.csproj @@ -1,6 +1,6 @@ - net5.0 + net6.0 Exe false @@ -20,7 +20,7 @@ 0.13.1 - 5.0.0 + 6.0.0 4.16.1 diff --git a/tests/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj b/tests/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj index 3e1723f59e..fffcad5a32 100644 --- a/tests/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj +++ b/tests/Umbraco.Tests.Common/Umbraco.Tests.Common.csproj @@ -1,7 +1,7 @@ - + - net5.0 + net6.0 Umbraco.Cms.Tests.Common Umbraco.Cms.Tests Umbraco CMS Test Tools @@ -10,7 +10,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/Umbraco.Tests.Integration.SqlCe/Umbraco.Tests.Integration.SqlCe.csproj b/tests/Umbraco.Tests.Integration.SqlCe/Umbraco.Tests.Integration.SqlCe.csproj index b4631e56dc..e8472258bd 100644 --- a/tests/Umbraco.Tests.Integration.SqlCe/Umbraco.Tests.Integration.SqlCe.csproj +++ b/tests/Umbraco.Tests.Integration.SqlCe/Umbraco.Tests.Integration.SqlCe.csproj @@ -1,18 +1,18 @@ - net5.0 + net6.0 false - + - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj b/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj index 8ef12b2925..f123a003d9 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj +++ b/tests/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj @@ -1,7 +1,7 @@ - net5.0 + net6.0 Umbraco.Cms.Tests.Integration Umbraco.Cms.Tests.Integration Umbraco CMS Integration Tests @@ -10,7 +10,7 @@ - + @@ -79,13 +79,13 @@ - + - - + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/ModelTypeTests.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/ModelTypeTests.cs index 1ae968301d..eca6efce18 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/ModelTypeTests.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Core/Published/ModelTypeTests.cs @@ -44,7 +44,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Published Assert.AreEqual("System.Int32[]", type.MakeArrayType().FullName); // Note the inner assembly qualified name - Assert.AreEqual("System.Collections.Generic.IEnumerable`1[[System.Int32[], System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]", typeof(IEnumerable<>).MakeGenericType(type.MakeArrayType()).FullName); + Assert.AreEqual("System.Collections.Generic.IEnumerable`1[[System.Int32[], System.Private.CoreLib, Version=6.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]", typeof(IEnumerable<>).MakeGenericType(type.MakeArrayType()).FullName); } [Test] diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj index eee8083425..57ab22640a 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Tests.UnitTests.csproj @@ -2,13 +2,13 @@ Exe - net5.0 + net6.0 false Umbraco.Cms.Tests.UnitTests - + @@ -20,12 +20,12 @@ - - + + - - - + + + diff --git a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Routing/TestRouteBuilder.cs b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Routing/TestRouteBuilder.cs index e2a916dd7d..05650d5fed 100644 --- a/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Routing/TestRouteBuilder.cs +++ b/tests/Umbraco.Tests.UnitTests/Umbraco.Web.Common/Routing/TestRouteBuilder.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Threading.Tasks; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Routing; @@ -21,6 +22,11 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Web.Common.Routing public TestRouteBuilder() { var services = new ServiceCollection(); + + var diagnosticListener = new DiagnosticListener("UnitTests"); + services.AddSingleton(diagnosticListener); + services.AddSingleton(diagnosticListener); + services.AddLogging(); services.AddMvc(); services.AddSingleton(x => new ApplicationLifetime(x.GetRequiredService>()));