diff --git a/build/templates/UmbracoPackage/.template.config/template.json b/build/templates/UmbracoPackage/.template.config/template.json
index 83d36238e2..3758621968 100644
--- a/build/templates/UmbracoPackage/.template.config/template.json
+++ b/build/templates/UmbracoPackage/.template.config/template.json
@@ -30,13 +30,53 @@
},
"namespaceReplacer": {
"type": "generated",
- "generator": "coalesce",
+ "generator": "regex",
+ "dataType": "string",
+ "replaces": "UmbracoPackage",
"parameters": {
- "sourceVariableName": "name",
- "defaultValue": "UmbracoPackage",
- "fallbackVariableName": "name"
- },
- "replaces":"UmbracoPackage"
+ "source": "name",
+ "steps": [
+ {
+ "regex": "\\s",
+ "replacement": "_"
+ },
+ {
+ "regex": "-",
+ "replacement": "_"
+ },
+ {
+ "regex": "^[^a-zA-Z_]+",
+ "replacement": "_"
+ }
+ ]
+ }
+ },
+ "msbuildReplacer": {
+ "type": "generated",
+ "generator": "regex",
+ "dataType": "string",
+ "replaces": "UmbracoPackageMsBuild",
+ "parameters": {
+ "source": "name",
+ "steps": [
+ {
+ "regex": "\\s",
+ "replacement": ""
+ },
+ {
+ "regex": "\\.",
+ "replacement": ""
+ },
+ {
+ "regex": "-",
+ "replacement": ""
+ },
+ {
+ "regex": "^[^a-zA-Z_]+",
+ "replacement": ""
+ }
+ ]
+ }
},
"Framework": {
"type": "parameter",
diff --git a/build/templates/UmbracoPackage/UmbracoPackage.csproj b/build/templates/UmbracoPackage/UmbracoPackage.csproj
index 43e0365e9c..a1ec4fa23d 100644
--- a/build/templates/UmbracoPackage/UmbracoPackage.csproj
+++ b/build/templates/UmbracoPackage/UmbracoPackage.csproj
@@ -8,6 +8,7 @@
...
...
umbraco plugin package
+ UmbracoPackage
diff --git a/build/templates/UmbracoPackage/build/UmbracoPackage.targets b/build/templates/UmbracoPackage/build/UmbracoPackage.targets
index 7a0dc0338a..5e3abf6ae1 100644
--- a/build/templates/UmbracoPackage/build/UmbracoPackage.targets
+++ b/build/templates/UmbracoPackage/build/UmbracoPackage.targets
@@ -1,27 +1,27 @@
- $(MSBuildThisFileDirectory)..\App_Plugins\UmbracoPackage\**\*.*
+ $(MSBuildThisFileDirectory)..\App_Plugins\UmbracoPackage\**\*.*
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/src/Umbraco.Examine.Lucene/LuceneIndexDiagnostics.cs b/src/Umbraco.Examine.Lucene/LuceneIndexDiagnostics.cs
index ebc7d13b58..ba3945c6e5 100644
--- a/src/Umbraco.Examine.Lucene/LuceneIndexDiagnostics.cs
+++ b/src/Umbraco.Examine.Lucene/LuceneIndexDiagnostics.cs
@@ -24,7 +24,7 @@ namespace Umbraco.Cms.Infrastructure.Examine
LuceneIndex index,
ILogger logger,
IHostingEnvironment hostingEnvironment,
- IOptionsSnapshot indexOptions)
+ IOptionsMonitor indexOptions)
{
_hostingEnvironment = hostingEnvironment;
_indexOptions = indexOptions.Get(index.Name);
@@ -63,7 +63,7 @@ namespace Umbraco.Cms.Infrastructure.Examine
{
var rootDir = _hostingEnvironment.ApplicationPhysicalPath;
- d[nameof(UmbracoExamineIndex.LuceneIndexFolder)] = fsDir.Directory.ToString().ToLowerInvariant().TrimStart(rootDir.ToLowerInvariant()).Replace("\\", "/").EnsureStartsWith('/');
+ d["LuceneIndexFolder"] = fsDir.Directory.ToString().ToLowerInvariant().TrimStart(rootDir.ToLowerInvariant()).Replace("\\", " /").EnsureStartsWith('/');
}
if (_indexOptions != null)
diff --git a/src/Umbraco.Examine.Lucene/Umbraco.Examine.Lucene.csproj b/src/Umbraco.Examine.Lucene/Umbraco.Examine.Lucene.csproj
index 5de38bb5f2..baa843247d 100644
--- a/src/Umbraco.Examine.Lucene/Umbraco.Examine.Lucene.csproj
+++ b/src/Umbraco.Examine.Lucene/Umbraco.Examine.Lucene.csproj
@@ -21,7 +21,7 @@
-
+
all
runtime; build; native; contentfiles; analyzers; buildtransitive
diff --git a/src/Umbraco.Examine.Lucene/UmbracoContentIndex.cs b/src/Umbraco.Examine.Lucene/UmbracoContentIndex.cs
index 56d987830a..3bb3eb006c 100644
--- a/src/Umbraco.Examine.Lucene/UmbracoContentIndex.cs
+++ b/src/Umbraco.Examine.Lucene/UmbracoContentIndex.cs
@@ -23,7 +23,7 @@ namespace Umbraco.Cms.Infrastructure.Examine
public UmbracoContentIndex(
ILoggerFactory loggerFactory,
string name,
- IOptionsSnapshot indexOptions,
+ IOptionsMonitor indexOptions,
IHostingEnvironment hostingEnvironment,
IRuntimeState runtimeState,
ILocalizationService languageService = null)
diff --git a/src/Umbraco.Examine.Lucene/UmbracoExamineIndex.cs b/src/Umbraco.Examine.Lucene/UmbracoExamineIndex.cs
index c8dfdd756a..2f7cb646a2 100644
--- a/src/Umbraco.Examine.Lucene/UmbracoExamineIndex.cs
+++ b/src/Umbraco.Examine.Lucene/UmbracoExamineIndex.cs
@@ -32,7 +32,7 @@ namespace Umbraco.Cms.Infrastructure.Examine
protected UmbracoExamineIndex(
ILoggerFactory loggerFactory,
string name,
- IOptionsSnapshot indexOptions,
+ IOptionsMonitor indexOptions,
IHostingEnvironment hostingEnvironment,
IRuntimeState runtimeState)
: base(loggerFactory, name, indexOptions)
diff --git a/src/Umbraco.Examine.Lucene/UmbracoExamineIndexDiagnostics.cs b/src/Umbraco.Examine.Lucene/UmbracoExamineIndexDiagnostics.cs
index 08b9cd27d3..877b9b97f0 100644
--- a/src/Umbraco.Examine.Lucene/UmbracoExamineIndexDiagnostics.cs
+++ b/src/Umbraco.Examine.Lucene/UmbracoExamineIndexDiagnostics.cs
@@ -18,7 +18,7 @@ namespace Umbraco.Cms.Infrastructure.Examine
UmbracoExamineIndex index,
ILogger logger,
IHostingEnvironment hostingEnvironment,
- IOptionsSnapshot indexOptions)
+ IOptionsMonitor indexOptions)
: base(index, logger, hostingEnvironment, indexOptions)
{
_index = index;
diff --git a/src/Umbraco.Examine.Lucene/UmbracoMemberIndex.cs b/src/Umbraco.Examine.Lucene/UmbracoMemberIndex.cs
index 0792dd8a6f..a6e000ff43 100644
--- a/src/Umbraco.Examine.Lucene/UmbracoMemberIndex.cs
+++ b/src/Umbraco.Examine.Lucene/UmbracoMemberIndex.cs
@@ -17,7 +17,7 @@ namespace Umbraco.Cms.Infrastructure.Examine
public UmbracoMemberIndex(
ILoggerFactory loggerFactory,
string name,
- IOptionsSnapshot indexOptions,
+ IOptionsMonitor indexOptions,
IHostingEnvironment hostingEnvironment,
IRuntimeState runtimeState)
: base(loggerFactory, name, indexOptions, hostingEnvironment, runtimeState)
diff --git a/src/Umbraco.Tests.Integration.SqlCe/Umbraco.Tests.Integration.SqlCe.csproj b/src/Umbraco.Tests.Integration.SqlCe/Umbraco.Tests.Integration.SqlCe.csproj
index 89f2711db5..2eff2802a4 100644
--- a/src/Umbraco.Tests.Integration.SqlCe/Umbraco.Tests.Integration.SqlCe.csproj
+++ b/src/Umbraco.Tests.Integration.SqlCe/Umbraco.Tests.Integration.SqlCe.csproj
@@ -6,7 +6,7 @@
-
+
diff --git a/src/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexInitializer.cs b/src/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexInitializer.cs
index 987ba90070..25e4c262ef 100644
--- a/src/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexInitializer.cs
+++ b/src/Umbraco.Tests.Integration/Umbraco.Examine.Lucene/UmbracoExamine/IndexInitializer.cs
@@ -241,8 +241,8 @@ namespace Umbraco.Cms.Tests.Integration.Umbraco.Examine.Lucene.UmbracoExamine
// return i;
//}
- public static IOptionsSnapshot GetOptions(string indexName, LuceneDirectoryIndexOptions options)
- => Mock.Of>(x => x.Get(indexName) == options);
+ public static IOptionsMonitor GetOptions(string indexName, LuceneDirectoryIndexOptions options)
+ => Mock.Of>(x => x.Get(indexName) == options);
internal void IndexingError(object sender, IndexingErrorEventArgs e) => throw new ApplicationException(e.Message, e.Exception);
diff --git a/src/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj b/src/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj
index 9ce4f53988..1bd0fbd7f2 100644
--- a/src/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj
+++ b/src/Umbraco.Tests.Integration/Umbraco.Tests.Integration.csproj
@@ -1,4 +1,4 @@
-
+
net5.0
@@ -74,7 +74,7 @@
-
+
diff --git a/src/Umbraco.Web.BackOffice/Security/BackOfficeAuthenticationBuilder.cs b/src/Umbraco.Web.BackOffice/Security/BackOfficeAuthenticationBuilder.cs
index bc9f64129f..80a9d920a1 100644
--- a/src/Umbraco.Web.BackOffice/Security/BackOfficeAuthenticationBuilder.cs
+++ b/src/Umbraco.Web.BackOffice/Security/BackOfficeAuthenticationBuilder.cs
@@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Authentication;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using Microsoft.Extensions.Options;
+using Umbraco.Extensions;
using Constants = Umbraco.Cms.Core.Constants;
namespace Umbraco.Cms.Web.BackOffice.Security
@@ -22,7 +23,7 @@ namespace Umbraco.Cms.Web.BackOffice.Security
=> _loginProviderOptions = loginProviderOptions ?? (x => { });
public string SchemeForBackOffice(string scheme)
- => Constants.Security.BackOfficeExternalAuthenticationTypePrefix + scheme;
+ => scheme?.EnsureStartsWith(Constants.Security.BackOfficeExternalAuthenticationTypePrefix);
///
/// Overridden to track the final authenticationScheme being registered for the external login
diff --git a/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj b/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj
index 7fca2faa5f..3a04ed1b22 100644
--- a/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj
+++ b/src/Umbraco.Web.Common/Umbraco.Web.Common.csproj
@@ -35,8 +35,8 @@
-
-
+
+
all