diff --git a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj
index 2f709d5d27..88a43fd1c1 100644
--- a/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj
+++ b/src/Umbraco.Infrastructure/Umbraco.Infrastructure.csproj
@@ -46,7 +46,6 @@
-
diff --git a/src/Umbraco.PublishedCache.NuCache/DataSource/BTree.cs b/src/Umbraco.PublishedCache.NuCache/DataSource/BTree.cs
index c813e428d2..2d276fbaf4 100644
--- a/src/Umbraco.PublishedCache.NuCache/DataSource/BTree.cs
+++ b/src/Umbraco.PublishedCache.NuCache/DataSource/BTree.cs
@@ -1,7 +1,7 @@
-using System.Configuration;
using CSharpTest.Net.Collections;
using CSharpTest.Net.Serialization;
using Umbraco.Cms.Core.Configuration.Models;
+using Umbraco.Cms.Core.Exceptions;
namespace Umbraco.Cms.Infrastructure.PublishedCache.DataSource
{
@@ -54,9 +54,9 @@ namespace Umbraco.Cms.Infrastructure.PublishedCache.DataSource
for (var i = blockSize; i != 1; i >>= 1)
bit++;
if (1 << bit != blockSize)
- throw new ConfigurationErrorsException($"Invalid block size value \"{blockSize}\": must be a power of two.");
+ throw new ConfigurationException($"Invalid block size value \"{blockSize}\": must be a power of two.");
if (blockSize < 512 || blockSize > 65536)
- throw new ConfigurationErrorsException($"Invalid block size value \"{blockSize}\": must be >= 512 and <= 65536.");
+ throw new ConfigurationException($"Invalid block size value \"{blockSize}\": must be >= 512 and <= 65536.");
return blockSize;
}
diff --git a/src/Umbraco.TestData/LoadTestController.cs b/src/Umbraco.TestData/LoadTestController.cs
index 3033d2febb..c245aae816 100644
--- a/src/Umbraco.TestData/LoadTestController.cs
+++ b/src/Umbraco.TestData/LoadTestController.cs
@@ -44,7 +44,7 @@ namespace Umbraco.TestData
-
" + System.Configuration.ConfigurationManager.AppSettings["umbracoConfigurationStatus"] + @"
+
@_umbracoVersion.SemanticVersion.ToSemanticStringWithoutBuild()
";
@@ -53,13 +53,14 @@ namespace Umbraco.TestData
private static readonly string s_containerTemplateText = @"
@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage
+@inject Umbraco.Cms.Core.Configuration.IUmbracoVersion _umbracoVersion
@{
Layout = null;
var container = Umbraco.ContentAtRoot().OfTypes(""" + ContainerAlias + @""").FirstOrDefault();
var contents = container.Children().ToArray();
var groups = contents.GroupBy(x => x.Value(""origin""));
var id = contents.Length > 0 ? contents[0].Id : -1;
- var wurl = Request.QueryString[""u""] == ""1"";
+ var wurl = Context.Request.Query[""u""] == ""1"";
var missing = contents.Length > 0 && contents[contents.Length - 1].Id - contents[0].Id >= contents.Length;
}
" + s_headHtml + @"
@@ -81,7 +82,7 @@ namespace Umbraco.TestData
}
if (wurl)
{
- @content.Id :: @content.Name :: @content.Url
+ @content.Id :: @content.Name :: @content.Url()
}
else
{
@@ -178,7 +179,7 @@ namespace Umbraco.TestData
}
}
- private IActionResult ContentHtml(string s) => Content(s_headHtml + s + FootHtml);
+ private IActionResult ContentHtml(string s) => Content(s_headHtml + s + FootHtml, "text/html");
public IActionResult Install()
{
diff --git a/src/Umbraco.TestData/SegmentTestController.cs b/src/Umbraco.TestData/SegmentTestController.cs
index 8eabd65288..92c01bcf7f 100644
--- a/src/Umbraco.TestData/SegmentTestController.cs
+++ b/src/Umbraco.TestData/SegmentTestController.cs
@@ -1,7 +1,7 @@
using System;
-using System.Configuration;
using System.Linq;
using Microsoft.AspNetCore.Mvc;
+using Microsoft.Extensions.Options;
using Umbraco.Cms.Core.Cache;
using Umbraco.Cms.Core.Logging;
using Umbraco.Cms.Core.Models;
@@ -11,25 +11,30 @@ using Umbraco.Cms.Core.Web;
using Umbraco.Cms.Infrastructure.Persistence;
using Umbraco.Cms.Web.Website.Controllers;
using Umbraco.Extensions;
+using Umbraco.TestData.Configuration;
namespace Umbraco.TestData
{
public class SegmentTestController : SurfaceController
{
+ private IOptions _testDataSettings;
+
public SegmentTestController(
IUmbracoContextAccessor umbracoContextAccessor,
IUmbracoDatabaseFactory databaseFactory,
ServiceContext services,
AppCaches appCaches,
IProfilingLogger profilingLogger,
- IPublishedUrlProvider publishedUrlProvider)
+ IPublishedUrlProvider publishedUrlProvider,
+ IOptions testDataSettings)
: base(umbracoContextAccessor, databaseFactory, services, appCaches, profilingLogger, publishedUrlProvider)
{
+ _testDataSettings = testDataSettings;
}
public IActionResult EnableDocTypeSegments(string alias, string propertyTypeAlias)
{
- if (ConfigurationManager.AppSettings["Umbraco.TestData.Enabled"] != "true")
+ if(_testDataSettings.Value.Enabled != true)
{
return HttpNotFound();
}
@@ -62,7 +67,7 @@ namespace Umbraco.TestData
public IActionResult DisableDocTypeSegments(string alias)
{
- if (ConfigurationManager.AppSettings["Umbraco.TestData.Enabled"] != "true")
+ if (_testDataSettings.Value.Enabled != true)
{
return HttpNotFound();
}
diff --git a/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeFinderTests.cs b/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeFinderTests.cs
index c55b577845..cbdb2ac5b8 100644
--- a/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeFinderTests.cs
+++ b/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeFinderTests.cs
@@ -33,7 +33,6 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Composing
typeof(System.Guid).Assembly,
typeof(NUnit.Framework.Assert).Assembly,
typeof(System.Xml.NameTable).Assembly,
- typeof(System.Configuration.GenericEnumConverter).Assembly,
typeof(TypeFinder).Assembly,
};
diff --git a/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeLoaderTests.cs b/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeLoaderTests.cs
index cea18c5176..c71d89856e 100644
--- a/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeLoaderTests.cs
+++ b/src/Umbraco.Tests.UnitTests/Umbraco.Core/Composing/TypeLoaderTests.cs
@@ -40,7 +40,6 @@ namespace Umbraco.Cms.Tests.UnitTests.Umbraco.Core.Composing
typeof(Guid).Assembly,
typeof(Assert).Assembly,
typeof(System.Xml.NameTable).Assembly,
- typeof(System.Configuration.GenericEnumConverter).Assembly,
////typeof(TabPage).Assembly,
typeof(TypeFinder).Assembly,
typeof(UmbracoContext).Assembly,