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 <mail@bergmania.dk>
This commit is contained in:
Elitsa Marinovska
2021-11-18 15:35:42 +01:00
committed by GitHub
parent 14e1f7f7fc
commit 61f459670c
34 changed files with 134 additions and 132 deletions

View File

@@ -16,7 +16,7 @@
<tags>umbraco</tags> <tags>umbraco</tags>
<repository type="git" url="https://github.com/umbraco/umbraco-cms" /> <repository type="git" url="https://github.com/umbraco/umbraco-cms" />
<dependencies> <dependencies>
<group targetFramework="net5.0"> <group targetFramework="net6.0">
<dependency id="Umbraco.Cms.Web.Website" version="[$version$]" /> <dependency id="Umbraco.Cms.Web.Website" version="[$version$]" />
<dependency id="Umbraco.Cms.Web.BackOffice" version="[$version$]" /> <dependency id="Umbraco.Cms.Web.BackOffice" version="[$version$]" />
<dependency id="Umbraco.Cms.StaticAssets" version="[$version$]" /> <dependency id="Umbraco.Cms.StaticAssets" version="[$version$]" />

View File

@@ -49,9 +49,9 @@ stages:
vmImage: ubuntu-latest vmImage: ubuntu-latest
steps: steps:
- task: UseDotNet@2 - task: UseDotNet@2
displayName: Use .Net 5.x displayName: Use .Net 6.x
inputs: inputs:
version: 5.x version: 6.x
- task: DotNetCoreCLI@2 - task: DotNetCoreCLI@2
displayName: dotnet build displayName: dotnet build
inputs: inputs:
@@ -69,9 +69,9 @@ stages:
vmImage: macOS-latest vmImage: macOS-latest
steps: steps:
- task: UseDotNet@2 - task: UseDotNet@2
displayName: Use .Net 5.x displayName: Use .Net 6.x
inputs: inputs:
version: 5.x version: 6.x
- task: DotNetCoreCLI@2 - task: DotNetCoreCLI@2
displayName: dotnet build displayName: dotnet build
inputs: inputs:
@@ -89,9 +89,9 @@ stages:
vmImage: windows-latest vmImage: windows-latest
steps: steps:
- task: UseDotNet@2 - task: UseDotNet@2
displayName: Use .Net 5.x displayName: Use .Net 6.x
inputs: inputs:
version: 5.x version: 6.x
- task: DotNetCoreCLI@2 - task: DotNetCoreCLI@2
displayName: dotnet build displayName: dotnet build
inputs: inputs:
@@ -116,9 +116,9 @@ stages:
vmImage: ubuntu-latest vmImage: ubuntu-latest
steps: steps:
- task: UseDotNet@2 - task: UseDotNet@2
displayName: Use .Net 5.x displayName: Use .Net 6.x
inputs: inputs:
version: 5.x version: 6.x
- task: DotNetCoreCLI@2 - task: DotNetCoreCLI@2
displayName: dotnet build displayName: dotnet build
inputs: inputs:
@@ -139,9 +139,9 @@ stages:
vmImage: windows-latest vmImage: windows-latest
steps: steps:
- task: UseDotNet@2 - task: UseDotNet@2
displayName: Use .Net 5.x displayName: Use .Net 6.x
inputs: inputs:
version: 5.x version: 6.x
- powershell: sqllocaldb start mssqllocaldb - powershell: sqllocaldb start mssqllocaldb
displayName: Start MSSQL LocalDb displayName: Start MSSQL LocalDb
- task: DotNetCoreCLI@2 - task: DotNetCoreCLI@2
@@ -181,9 +181,9 @@ stages:
vmImage: windows-latest vmImage: windows-latest
steps: steps:
- task: UseDotNet@2 - task: UseDotNet@2
displayName: Use .Net 5.x displayName: Use .Net 6.x
inputs: inputs:
version: 5.x version: 6.x
- powershell: sqllocaldb start mssqllocaldb - powershell: sqllocaldb start mssqllocaldb
displayName: Start MSSQL LocalDb displayName: Start MSSQL LocalDb
@@ -278,9 +278,9 @@ stages:
vmImage: ubuntu-latest vmImage: ubuntu-latest
steps: steps:
- task: UseDotNet@2 - task: UseDotNet@2
displayName: Use .Net 5.x displayName: Use .Net 6.x
inputs: inputs:
version: 5.x version: 6.x
- task: Bash@3 - task: Bash@3
displayName: Create database displayName: Create database
inputs: inputs:
@@ -380,9 +380,9 @@ stages:
vmImage: windows-latest vmImage: windows-latest
steps: steps:
- task: UseDotNet@2 - task: UseDotNet@2
displayName: Use .Net 5.x displayName: Use .Net 6.x
inputs: inputs:
version: 5.x version: 6.x
- task: NuGetToolInstaller@1 - task: NuGetToolInstaller@1
displayName: Use NuGet Latest displayName: Use NuGet Latest
- task: NuGetCommand@2 - task: NuGetCommand@2
@@ -533,9 +533,9 @@ stages:
vmImage: windows-latest vmImage: windows-latest
steps: steps:
- task: UseDotNet@2 - task: UseDotNet@2
displayName: Use .Net 5.x displayName: Use .Net 6.x
inputs: inputs:
version: 5.x version: 6.x
- task: PowerShell@2 - task: PowerShell@2
displayName: 'Prep build tool - C# Docs' displayName: 'Prep build tool - C# Docs'
inputs: inputs:

View File

@@ -83,17 +83,13 @@
"description": "The target framework for the project.", "description": "The target framework for the project.",
"datatype": "choice", "datatype": "choice",
"choices": [ "choices": [
{
"choice": "net5.0",
"description": "Target net5.0"
},
{ {
"choice": "net6.0", "choice": "net6.0",
"description": "Target net6.0" "description": "Target net6.0"
} }
], ],
"replaces": "net5.0", "replaces": "net6.0",
"defaultValue": "net5.0" "defaultValue": "net6.0"
} }
} }
} }

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<ContentTargetFolders>.</ContentTargetFolders> <ContentTargetFolders>.</ContentTargetFolders>
<Product>UmbracoPackage</Product> <Product>UmbracoPackage</Product>
<PackageId>UmbracoPackage</PackageId> <PackageId>UmbracoPackage</PackageId>

View File

@@ -79,17 +79,13 @@
"description": "The target framework for the project", "description": "The target framework for the project",
"datatype": "choice", "datatype": "choice",
"choices": [ "choices": [
{
"choice": "net5.0",
"description": "Target net5.0"
},
{ {
"choice": "net6.0", "choice": "net6.0",
"description": "Target net6.0" "description": "Target net6.0"
} }
], ],
"replaces": "net5.0", "replaces": "net6.0",
"defaultValue": "net5.0" "defaultValue": "net6.0"
}, },
"SkipRestore": { "SkipRestore": {
"type": "parameter", "type": "parameter",

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Umbraco.Cms.Web.UI</RootNamespace> <RootNamespace Condition="'$(name)' != '$(name{-VALUE-FORMS-}safe_namespace)'">Umbraco.Cms.Web.UI</RootNamespace>
<DefaultItemExcludes>$(DefaultItemExcludes);App_Plugins/**;</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);App_Plugins/**;</DefaultItemExcludes>
<DefaultItemExcludes>$(DefaultItemExcludes);umbraco/**;</DefaultItemExcludes> <DefaultItemExcludes>$(DefaultItemExcludes);umbraco/**;</DefaultItemExcludes>

View File

@@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<GenerateDocumentationFile>true</GenerateDocumentationFile> <GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup> </PropertyGroup>
@@ -10,7 +10,7 @@
<PackageReference Include="CommandLineParser" Version="2.8.0" /> <PackageReference Include="CommandLineParser" Version="2.8.0" />
<PackageReference Include="NJsonSchema" Version="10.5.2" /> <PackageReference Include="NJsonSchema" Version="10.5.2" />
<PackageReference Include="System.Xml.XPath.XmlDocument" Version="4.3.0" /> <PackageReference Include="System.Xml.XPath.XmlDocument" Version="4.3.0" />
<PackageReference Include="Umbraco.Forms.Core" Version="9.0.0-preview20210624.66481" /> <PackageReference Include="Umbraco.Forms.Core" Version="9.1.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -1,4 +1,4 @@
// Copyright (c) Umbraco. // Copyright (c) Umbraco.
// See LICENSE for more details. // See LICENSE for more details.
using System; using System;
@@ -75,13 +75,13 @@ namespace Umbraco.Extensions
yield return result; yield return result;
} }
/// <summary>The distinct by.</summary> /// <summary>The legacy distinct by.</summary>
/// <param name="source">The source.</param> /// <param name="source">The source.</param>
/// <param name="keySelector">The key selector.</param> /// <param name="keySelector">The key selector.</param>
/// <typeparam name="TSource">Source type</typeparam> /// <typeparam name="TSource">Source type</typeparam>
/// <typeparam name="TKey">Key type</typeparam> /// <typeparam name="TKey">Key type</typeparam>
/// <returns>the unique list</returns> /// <returns>the unique list</returns>
public static IEnumerable<TSource> DistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector) public static IEnumerable<TSource> LegacyDistinctBy<TSource, TKey>(this IEnumerable<TSource> source, Func<TSource, TKey> keySelector)
where TKey : IEquatable<TKey> where TKey : IEquatable<TKey>
{ {
return source.Distinct(DelegateEqualityComparer<TSource>.CompareMember(keySelector)); return source.Distinct(DelegateEqualityComparer<TSource>.CompareMember(keySelector));

View File

@@ -578,7 +578,7 @@ namespace Umbraco.Cms.Core.Packaging
////Now, we have all property Ids/Aliases and their referenced document Ids and tags ////Now, we have all property Ids/Aliases and their referenced document Ids and tags
//var allExportedTaggedEntities = allTaggedEntities.Where(x => allExportedIds.Contains(x.EntityId)) //var allExportedTaggedEntities = allTaggedEntities.Where(x => allExportedIds.Contains(x.EntityId))
// .DistinctBy(x => x.EntityId) // .LegacyDistinctBy(x => x.EntityId)
// .OrderBy(x => x.EntityId); // .OrderBy(x => x.EntityId);
//foreach (var taggedEntity in allExportedTaggedEntities) //foreach (var taggedEntity in allExportedTaggedEntities)

View File

@@ -79,7 +79,7 @@ namespace Umbraco.Extensions
// in some cases there will be the same URL for multiple cultures: // in some cases there will be the same URL for multiple cultures:
// * The entire branch is invariant // * The entire branch is invariant
// * If there are less domain/cultures assigned to the branch than the number of cultures/languages installed // * 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); result.Add(dUrl);
} }

View File

@@ -15,21 +15,21 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="5.0.10" /> <PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Options" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="6.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0"> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" /> <PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" /> <PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
<PackageReference Include="System.Runtime.Caching" Version="5.0.0" /> <PackageReference Include="System.Runtime.Caching" Version="6.0.0" />
<PackageReference Include="Umbraco.Code" Version="1.2.0"> <PackageReference Include="Umbraco.Code" Version="2.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>

View File

@@ -21,12 +21,12 @@
<None Remove="obj\**" /> <None Remove="obj\**" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Examine" Version="2.0.0" /> <PackageReference Include="Examine" Version="2.0.1" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0"> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Umbraco.Code" Version="1.2.0"> <PackageReference Include="Umbraco.Code" Version="2.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>

View File

@@ -169,7 +169,7 @@ namespace Umbraco.Cms.Core.Manifest
if (manifest.GridEditors != null) gridEditors.AddRange(manifest.GridEditors); if (manifest.GridEditors != null) gridEditors.AddRange(manifest.GridEditors);
if (manifest.ContentApps != null) contentApps.AddRange(manifest.ContentApps); if (manifest.ContentApps != null) contentApps.AddRange(manifest.ContentApps);
if (manifest.Dashboards != null) dashboards.AddRange(manifest.Dashboards); 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( return new CompositePackageManifest(

View File

@@ -29,10 +29,10 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Expressions.Delete.KeysAndIndexe
_context.BuildingExpression = false; _context.BuildingExpression = false;
//get a list of all constraints - this will include all PK, FK and unique constraints //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 //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 uniqueConstraintNames = tableConstraints.Where(x => !x.Item2.InvariantStartsWith("PK_") && !x.Item2.InvariantStartsWith("FK_")).Select(x => x.Item2);
var indexNames = indexes.Select(x => x.IndexName).ToList(); var indexNames = indexes.Select(x => x.IndexName).ToList();

View File

@@ -189,7 +189,7 @@ namespace Umbraco.Cms.Infrastructure.Migrations.Install
private void ValidateDbConstraints(DatabaseSchemaResult result) private void ValidateDbConstraints(DatabaseSchemaResult result)
{ {
//Check constraints in configured database against constraints in schema //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 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(); var primaryKeysInDatabase = constraintsInDatabase.Where(x => x.Item3.InvariantStartsWith("PK_")).Select(x => x.Item3).ToList();

View File

@@ -37,7 +37,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement
.ForUpdate(); .ForUpdate();
// deduplicate the logins // 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<int, IExternalLogin>(); var toUpdate = new Dictionary<int, IExternalLogin>();
var toDelete = new List<int>(); var toDelete = new List<int>();
@@ -225,7 +225,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement
.ToDictionary(x => x.LoginProvider, x => x.Id); .ToDictionary(x => x.LoginProvider, x => x.Id);
// deduplicate the tokens // 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(); var providers = tokens.Select(x => x.LoginProvider).Distinct().ToList();

View File

@@ -182,7 +182,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement
.Where<Member2MemberGroupDto>(x => x.Member == memberId); .Where<Member2MemberGroupDto>(x => x.Member == memberId);
return Database.Fetch<NodeDto>(sql) return Database.Fetch<NodeDto>(sql)
.DistinctBy(dto => dto.NodeId) .LegacyDistinctBy(dto => dto.NodeId)
.Select(x => MemberGroupFactory.BuildEntity(x)); .Select(x => MemberGroupFactory.BuildEntity(x));
} }
@@ -199,7 +199,7 @@ namespace Umbraco.Cms.Infrastructure.Persistence.Repositories.Implement
.Where("cmsMember.LoginName=@loginName", new { loginName = username }); .Where("cmsMember.LoginName=@loginName", new { loginName = username });
return Database.Fetch<NodeDto>(sql) return Database.Fetch<NodeDto>(sql)
.DistinctBy(dto => dto.NodeId) .LegacyDistinctBy(dto => dto.NodeId)
.Select(x => MemberGroupFactory.BuildEntity(x)); .Select(x => MemberGroupFactory.BuildEntity(x));
} }

View File

@@ -284,7 +284,7 @@ SELECT 4 AS [Key], COUNT(id) AS [Value] FROM umbracoUser WHERE userDisabled = 0
protected override IEnumerable<IUser> PerformGetByQuery(IQuery<IUser> query) protected override IEnumerable<IUser> PerformGetByQuery(IQuery<IUser> query)
{ {
var dtos = GetDtosWith(sql => new SqlTranslator<IUser>(sql, query).Translate(), true) var dtos = GetDtosWith(sql => new SqlTranslator<IUser>(sql, query).Translate(), true)
.DistinctBy(x => x.Id) .LegacyDistinctBy(x => x.Id)
.ToList(); .ToList();
var users = new IUser[dtos.Count]; var users = new IUser[dtos.Count];

View File

@@ -598,7 +598,7 @@ namespace Umbraco.Cms.Core.Services.Implement
scope.Notifications.Publish(GetContentTypeChangedNotification(changes, eventMessages)); scope.Notifications.Publish(GetContentTypeChangedNotification(changes, eventMessages));
DeletedNotification<TItem> deletedNotification = GetDeletedNotification(deleted.DistinctBy(x => x.Id), eventMessages); DeletedNotification<TItem> deletedNotification = GetDeletedNotification(deleted.LegacyDistinctBy(x => x.Id), eventMessages);
deletedNotification.WithStateFrom(deletingNotification); deletedNotification.WithStateFrom(deletingNotification);
scope.Notifications.Publish(deletedNotification); scope.Notifications.Publish(deletedNotification);
@@ -625,7 +625,7 @@ namespace Umbraco.Cms.Core.Services.Implement
// all descendants are going to be deleted // all descendants are going to be deleted
TItem[] allDescendantsAndSelf = itemsA.SelectMany(xx => GetDescendants(xx.Id, true)) TItem[] allDescendantsAndSelf = itemsA.SelectMany(xx => GetDescendants(xx.Id, true))
.DistinctBy(x => x.Id) .LegacyDistinctBy(x => x.Id)
.ToArray(); .ToArray();
TItem[] deleted = allDescendantsAndSelf; TItem[] deleted = allDescendantsAndSelf;
@@ -656,7 +656,7 @@ namespace Umbraco.Cms.Core.Services.Implement
scope.Notifications.Publish(GetContentTypeChangedNotification(changes, eventMessages)); scope.Notifications.Publish(GetContentTypeChangedNotification(changes, eventMessages));
DeletedNotification<TItem> deletedNotification = GetDeletedNotification(deleted.DistinctBy(x => x.Id), eventMessages); DeletedNotification<TItem> deletedNotification = GetDeletedNotification(deleted.LegacyDistinctBy(x => x.Id), eventMessages);
deletedNotification.WithStateFrom(deletingNotification); deletedNotification.WithStateFrom(deletingNotification);
scope.Notifications.Publish(deletedNotification); scope.Notifications.Publish(deletedNotification);

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework> <TargetFramework>netstandard2.0</TargetFramework>
@@ -18,18 +18,21 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="HtmlAgilityPack" Version="1.11.36" /> <PackageReference Include="HtmlAgilityPack" Version="1.11.38" />
<PackageReference Include="MailKit" Version="2.15.0" /> <PackageReference Include="MailKit" Version="2.15.0" />
<PackageReference Include="IPNetwork2" Version="2.5.353" /> <PackageReference Include="IPNetwork2" Version="2.5.366" />
<PackageReference Include="Markdown" Version="2.2.1" /> <PackageReference Include="Markdown" Version="2.2.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.11.0" /> <PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" />
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" /> <PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.2" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0" /> <PackageReference Include="Microsoft.Extensions.Http" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="5.0.10" /> <PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="6.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" /> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MiniProfiler.Shared" Version="4.2.22" /> <PackageReference Include="MiniProfiler.Shared" Version="4.2.22" />
<PackageReference Include="ncrontab" Version="3.3.1" /> <PackageReference Include="ncrontab" Version="3.3.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
@@ -37,21 +40,21 @@
<PackageReference Include="Serilog" Version="2.10.0" /> <PackageReference Include="Serilog" Version="2.10.0" />
<PackageReference Include="Serilog.Enrichers.Process" Version="2.0.2" /> <PackageReference Include="Serilog.Enrichers.Process" Version="2.0.2" />
<PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" /> <PackageReference Include="Serilog.Enrichers.Thread" Version="3.1.0" />
<PackageReference Include="Serilog.Extensions.Hosting" Version="4.1.2" /> <PackageReference Include="Serilog.Extensions.Hosting" Version="4.2.0" />
<PackageReference Include="Serilog.Filters.Expressions" Version="2.1.0" /> <PackageReference Include="Serilog.Filters.Expressions" Version="2.1.0" />
<PackageReference Include="Serilog.Formatting.Compact" Version="1.1.0" /> <PackageReference Include="Serilog.Formatting.Compact" Version="1.1.0" />
<PackageReference Include="Serilog.Formatting.Compact.Reader" Version="1.0.5" /> <PackageReference Include="Serilog.Formatting.Compact.Reader" Version="1.0.5" />
<PackageReference Include="Serilog.Settings.Configuration" Version="3.2.0" /> <PackageReference Include="Serilog.Settings.Configuration" Version="3.3.0" />
<PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" /> <PackageReference Include="Serilog.Sinks.Async" Version="1.5.0" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" /> <PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Map" Version="1.0.2" /> <PackageReference Include="Serilog.Sinks.Map" Version="1.0.2" />
<PackageReference Include="SixLabors.ImageSharp" Version="1.0.3" /> <PackageReference Include="SixLabors.ImageSharp" Version="1.0.4" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.3" /> <PackageReference Include="System.Data.SqlClient" Version="4.8.3" />
<PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" /> <PackageReference Include="System.IO.FileSystem.AccessControl" Version="5.0.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="5.0.1" /> <!-- Explicit updated this nested dependency due to this https://github.com/dotnet/announcements/issues/178--> <PackageReference Include="System.Text.Encodings.Web" Version="6.0.0" /> <!-- Explicit updated this nested dependency due to this https://github.com/dotnet/announcements/issues/178-->
<PackageReference Include="System.Threading.Tasks.Dataflow" Version="5.0.0" /> <PackageReference Include="System.Threading.Tasks.Dataflow" Version="6.0.0" />
<PackageReference Include="Examine.Core" Version="2.0.0" /> <PackageReference Include="Examine.Core" Version="2.0.1" />
<PackageReference Include="Umbraco.Code" Version="1.2.0"> <PackageReference Include="Umbraco.Code" Version="2.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>

View File

@@ -14,12 +14,12 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0"> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Umbraco.SqlServerCE" Version="4.0.0.1" /> <PackageReference Include="Umbraco.SqlServerCE" Version="4.0.0.1" />
<PackageReference Include="Umbraco.Code" Version="1.2.0"> <PackageReference Include="Umbraco.Code" Version="2.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>

View File

@@ -15,14 +15,14 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="CSharpTest.Net.Collections-NetStd2" Version="14.906.1403.1084" /> <PackageReference Include="CSharpTest.Net.Collections-NetStd2" Version="14.906.1403.1084" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0"> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="MessagePack" Version="2.3.75" /> <PackageReference Include="MessagePack" Version="2.3.85" />
<PackageReference Include="K4os.Compression.LZ4" Version="1.2.12" /> <PackageReference Include="K4os.Compression.LZ4" Version="1.2.15" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Umbraco.Code" Version="1.2.0"> <PackageReference Include="Umbraco.Code" Version="2.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<RootNamespace>Umbraco.Cms.Web.BackOffice</RootNamespace> <RootNamespace>Umbraco.Cms.Web.BackOffice</RootNamespace>
<PackageId>Umbraco.Cms.Web.BackOffice</PackageId> <PackageId>Umbraco.Cms.Web.BackOffice</PackageId>
@@ -19,13 +19,13 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0"> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" /> <PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="Umbraco.Code" Version="1.2.0"> <PackageReference Include="Umbraco.Code" Version="2.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<RootNamespace>Umbraco.Cms.Web.Common</RootNamespace> <RootNamespace>Umbraco.Cms.Web.Common</RootNamespace>
<PackageId>Umbraco.Cms.Web.Common</PackageId> <PackageId>Umbraco.Cms.Web.Common</PackageId>
@@ -25,20 +25,20 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.10" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="5.0.10" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0"> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.2.22" /> <PackageReference Include="MiniProfiler.AspNetCore.Mvc" Version="4.2.22" />
<PackageReference Include="NETStandard.Library" Version="2.0.3" /> <PackageReference Include="NETStandard.Library" Version="2.0.3" />
<PackageReference Include="Serilog.AspNetCore" Version="4.1.0" /> <PackageReference Include="Serilog.AspNetCore" Version="4.1.0" />
<PackageReference Include="SixLabors.ImageSharp.Web" Version="1.0.3" /> <PackageReference Include="SixLabors.ImageSharp.Web" Version="1.0.4" />
<PackageReference Include="Smidge.Nuglify" Version="4.0.0" /> <PackageReference Include="Smidge.Nuglify" Version="4.0.2" />
<PackageReference Include="Smidge.InMemory" Version="4.0.0" /> <PackageReference Include="Smidge.InMemory" Version="4.0.2" />
<PackageReference Include="Dazinator.Extensions.FileProviders" Version="2.0.0" /> <PackageReference Include="Dazinator.Extensions.FileProviders" Version="2.0.0" />
<PackageReference Include="Umbraco.Code" Version="1.2.0"> <PackageReference Include="Umbraco.Code" Version="2.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web"> <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<RootNamespace>Umbraco.Cms.Web.UI</RootNamespace> <RootNamespace>Umbraco.Cms.Web.UI</RootNamespace>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' "> <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
@@ -66,12 +66,12 @@
<!-- We don't want to include the generated files, they will throw a lot of errors --> <!-- We don't want to include the generated files, they will throw a lot of errors -->
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="5.0.10" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.NewtonsoftJson" Version="6.0.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0"> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Umbraco.Code" Version="1.2.0"> <PackageReference Include="Umbraco.Code" Version="2.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>
@@ -79,6 +79,7 @@
<PropertyGroup> <PropertyGroup>
<RazorCompileOnBuild>false</RazorCompileOnBuild> <RazorCompileOnBuild>false</RazorCompileOnBuild>
<RazorCompileOnPublish>false</RazorCompileOnPublish> <RazorCompileOnPublish>false</RazorCompileOnPublish>
<UseRazorSourceGenerator>false</UseRazorSourceGenerator> <!-- Disabling the Razor source generators in .NET 6 -->
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<OutputType>Library</OutputType> <OutputType>Library</OutputType>
<RootNamespace>Umbraco.Cms.Web.Website</RootNamespace> <RootNamespace>Umbraco.Cms.Web.Website</RootNamespace>
<PackageId>Umbraco.Cms.Web.Website</PackageId> <PackageId>Umbraco.Cms.Web.Website</PackageId>
@@ -28,11 +28,11 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0"> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Umbraco.Code" Version="1.2.0"> <PackageReference Include="Umbraco.Code" Version="2.0.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>
</ItemGroup> </ItemGroup>

View File

@@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<RootNamespace>Umbraco.TestData</RootNamespace> <RootNamespace>Umbraco.TestData</RootNamespace>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View File

@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo> <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup> </PropertyGroup>
@@ -20,7 +20,7 @@
<Version>0.13.1</Version> <Version>0.13.1</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.Extensions.Logging.Debug"> <PackageReference Include="Microsoft.Extensions.Logging.Debug">
<Version>5.0.0</Version> <Version>6.0.0</Version>
</PackageReference> </PackageReference>
<PackageReference Include="Moq"> <PackageReference Include="Moq">
<Version>4.16.1</Version> <Version>4.16.1</Version>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<RootNamespace>Umbraco.Cms.Tests.Common</RootNamespace> <RootNamespace>Umbraco.Cms.Tests.Common</RootNamespace>
<PackageId>Umbraco.Cms.Tests</PackageId> <PackageId>Umbraco.Cms.Tests</PackageId>
<Title>Umbraco CMS Test Tools</Title> <Title>Umbraco CMS Test Tools</Title>
@@ -10,7 +10,7 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="AutoFixture.AutoMoq" Version="4.17.0" /> <PackageReference Include="AutoFixture.AutoMoq" Version="4.17.0" />
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0"> <PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

View File

@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Examine.Lucene" Version="2.0.0" /> <PackageReference Include="Examine.Lucene" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.7" /> <PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.10" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Moq" Version="4.16.1" /> <PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="NUnit" Version="3.13.2" /> <PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0"> <PackageReference Include="NUnit3TestAdapter" Version="4.1.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<RootNamespace>Umbraco.Cms.Tests.Integration</RootNamespace> <RootNamespace>Umbraco.Cms.Tests.Integration</RootNamespace>
<PackageId>Umbraco.Cms.Tests.Integration</PackageId> <PackageId>Umbraco.Cms.Tests.Integration</PackageId>
<Title>Umbraco CMS Integration Tests</Title> <Title>Umbraco CMS Integration Tests</Title>
@@ -10,7 +10,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(OS)' == 'Windows_NT'"> <ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.6" /> <PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.9" />
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2" /> <RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2" />
</ItemGroup> </ItemGroup>
@@ -79,13 +79,13 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Examine.Lucene" Version="2.0.0" /> <PackageReference Include="Examine.Lucene" Version="2.0.1" />
<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.7" /> <PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="5.2.7" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="5.0.10" /> <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="6.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="Moq" Version="4.16.1" /> <PackageReference Include="Moq" Version="4.16.1" />
<PackageReference Include="NUnit" Version="3.13.2" /> <PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0"> <PackageReference Include="NUnit3TestAdapter" Version="4.1.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>

View File

@@ -44,7 +44,7 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Published
Assert.AreEqual("System.Int32[]", type.MakeArrayType().FullName); Assert.AreEqual("System.Int32[]", type.MakeArrayType().FullName);
// Note the inner assembly qualified name // 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] [Test]

View File

@@ -2,13 +2,13 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<RootNamespace>Umbraco.Cms.Tests.UnitTests</RootNamespace> <RootNamespace>Umbraco.Cms.Tests.UnitTests</RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition="'$(OS)' == 'Windows_NT'"> <ItemGroup Condition="'$(OS)' == 'Windows_NT'">
<PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.6" /> <PackageReference Include="Microsoft.ICU.ICU4C.Runtime" Version="68.2.0.9" />
<RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2" /> <RuntimeHostConfigurationOption Include="System.Globalization.AppLocalIcu" Value="68.2" />
</ItemGroup> </ItemGroup>
@@ -20,12 +20,12 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="AngleSharp" Version="0.16.0" /> <PackageReference Include="AngleSharp" Version="0.16.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.0.0" />
<PackageReference Include="NUnit" Version="3.13.2" /> <PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0" /> <PackageReference Include="NUnit3TestAdapter" Version="4.1.0" />
<PackageReference Include="System.Data.Odbc" Version="5.0.0" /> <PackageReference Include="System.Data.Odbc" Version="6.0.0" />
<PackageReference Include="System.Data.OleDb" Version="5.0.0" /> <PackageReference Include="System.Data.OleDb" Version="6.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -3,6 +3,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing;
@@ -21,6 +22,11 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Web.Common.Routing
public TestRouteBuilder() public TestRouteBuilder()
{ {
var services = new ServiceCollection(); var services = new ServiceCollection();
var diagnosticListener = new DiagnosticListener("UnitTests");
services.AddSingleton<DiagnosticSource>(diagnosticListener);
services.AddSingleton<DiagnosticListener>(diagnosticListener);
services.AddLogging(); services.AddLogging();
services.AddMvc(); services.AddMvc();
services.AddSingleton<IHostApplicationLifetime>(x => new ApplicationLifetime(x.GetRequiredService<ILogger<ApplicationLifetime>>())); services.AddSingleton<IHostApplicationLifetime>(x => new ApplicationLifetime(x.GetRequiredService<ILogger<ApplicationLifetime>>()));