Do not reference System.Configuration.ConfigurationManager just because of an exception. And moved the reference to lucene to be safe

This commit is contained in:
Bjarke Berg
2021-03-11 13:14:28 +01:00
parent 8d743cbe2c
commit 9ce475afa5
7 changed files with 48 additions and 162 deletions

View File

@@ -1,96 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="4.1.0">
<id>Umbraco.Cms.Core</id>
<version>9.0.0</version>
<title>Umbraco Cms Core Binaries</title>
<authors>Umbraco HQ</authors>
<owners>Umbraco HQ</owners>
<license type="expression">MIT</license>
<projectUrl>https://umbraco.com/</projectUrl>
<iconUrl>https://umbraco.com/dist/nuget/logo-small.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Contains the core assemblies needed to run Umbraco Cms. This package only contains assemblies and can be used for package development. Use the UmbracoCms package to setup Umbraco in Visual Studio as an ASP.NET Core project.</description>
<summary>Contains the core assemblies needed to run Umbraco Cms</summary>
<language>en-US</language>
<tags>umbraco</tags>
<repository type="git" url="https://github.com/umbraco/umbraco-cms" />
<dependencies>
<group targetFramework="netstandard2.0">
<!--
note: dependencies are specified as [x.y.z,x.999999) eg [2.1.0,2.999999) and NOT [2.1.0,3.0.0) because
the latter would pick anything below 3.0.0 and that includes prereleases such as 3.0.0-alpha, and we do
not want this to happen as the alpha of the next major is, really, the next major already.
-->
<dependency id="Microsoft.Extensions.Configuration.Abstractions" version="[5.0.0,5.999999)" />
<dependency id="Microsoft.Extensions.Hosting.Abstractions" version="[5.0.0,5.999999)" />
<dependency id="Microsoft.Extensions.Logging" version="[5.0.0,5.999999)" />
<dependency id="Microsoft.Extensions.Options" version="[5.0.0,5.999999)" />
<dependency id="Microsoft.Extensions.Options.ConfigurationExtensions" version="[5.0.0,5.999999)" />
<dependency id="System.ComponentModel.Annotations" version="[5.0.0,5.999999)" />
<dependency id="System.Configuration.ConfigurationManager" version="[5.0.0,5.999999)" />
<dependency id="System.Runtime.Caching" version="[5.0.0,5.999999)" />
<dependency id="System.Reflection.Emit.Lightweight" version="[4.7.0,4.999999)" />
<dependency id="HtmlAgilityPack" version="[1.11.30,1.999999)" />
<dependency id="MailKit" version="[2.10.1,2.999999)" />
<dependency id="Markdown" version="[2.2.1,2.999999)" />
<dependency id="Microsoft.CSharp" version="[4.7.0,4.999999)" />
<dependency id="Microsoft.Extensions.DependencyInjection" version="[5.0.1,5.999999)" />
<dependency id="Microsoft.Extensions.Configuration.Json" version="[5.0.0,5.999999)" />
<dependency id="Microsoft.Extensions.Http" version="[5.0.0,5.999999)" />
<dependency id="Microsoft.Extensions.Identity.Stores" version="[5.0.2,5.999999)" />
<dependency id="MiniProfiler.Shared" version="[4.2.22,4.999999)" />
<dependency id="ncrontab" version="[3.3.1,3.999999)" />
<dependency id="Newtonsoft.Json" version="[12.0.3,12.999999)" />
<dependency id="NPoco" version="[4.0.2,4.999999)" />
<dependency id="Serilog" version="[2.10.0,2.999999)" />
<dependency id="Serilog.Enrichers.Process" version="[2.0.1,2.999999)" />
<dependency id="Serilog.Enrichers.Thread" version="[3.1.0,3.999999)" />
<dependency id="Serilog.Extensions.Hosting" version="[3.1.0,3.999999)" />
<dependency id="Serilog.Filters.Expressions" version="[2.1.0,2.999999)" />
<dependency id="Serilog.Formatting.Compact" version="[1.1.0,1.999999)" />
<dependency id="Serilog.Formatting.Compact.Reader" version="[1.0.3,1.999999)" />
<dependency id="Serilog.Settings.AppSettings" version="[2.2.2,2.999999)" />
<dependency id="Serilog.Settings.Configuration" version="[3.1.0,3.999999)" />
<dependency id="Serilog.Sinks.Async" version="[1.4.0,1.999999)" />
<dependency id="Serilog.Sinks.File" version="[4.1.0,4.999999)" />
<dependency id="Serilog.Sinks.Map" version="[1.0.2,1.999999)" />
<dependency id="System.Data.SqlClient" version="[4.8.2,4.999999)" />
<dependency id="System.Drawing.Common" version="[5.0.0,5.999999)" />
<dependency id="System.IO.FileSystem.AccessControl" version="[5.0.0,5.999999)" />
<dependency id="System.Threading.Tasks.Dataflow" version="[5.0.0,5.999999)" />
<dependency id="Examine.Core" version="[2.0.0-alpha.20200128.15,2.999999)" />
<dependency id="CSharpTest.Net.Collections-NetStd2" version="[14.906.1403.1084,14.999999)" />
</group>
</dependencies>
</metadata>
<files>
<!-- Umbraco.Examine.Lucene HACK remove this when Examine lucene is a real netstandard dependency -->
<file src="$BuildTmp$\bin\Examine.Lucene.dll" target="lib\netstandard2.0\Examine.Lucene.dll" />
<file src="$BuildTmp$\bin\Lucene.Net.dll" target="lib\netstandard2.0\Lucene.Net.dll" />
<!-- libs -->
<file src="$BuildTmp$\bin\Umbraco.Core.dll" target="lib\netstandard2.0\Umbraco.Core.dll" />
<file src="$BuildTmp$\bin\Umbraco.Examine.Lucene.dll" target="lib\net472\Umbraco.Examine.Lucene.dll" />
<file src="$BuildTmp$\bin\Umbraco.Examine.Lucene.dll" target="lib\netstandard2.0\Umbraco.Examine.Lucene.dll" />
<file src="$BuildTmp$\bin\Umbraco.Infrastructure.dll" target="lib\netstandard2.0\Umbraco.Infrastructure.dll" />
<file src="$BuildTmp$\bin\Umbraco.PublishedCache.NuCache.dll" target="lib\netstandard2.0\Umbraco.PublishedCache.NuCache.dll" />
<!-- docs -->
<file src="$BuildTmp$\bin\Umbraco.Core.xml" target="lib\netstandard2.0\Umbraco.Core.xml" />
<file src="$BuildTmp$\bin\Umbraco.Examine.Lucene.xml" target="lib\net472\Umbraco.Examine.Lucene.xml" />
<file src="$BuildTmp$\bin\Umbraco.Examine.Lucene.xml" target="lib\netstandard2.0\Umbraco.Examine.Lucene.xml" />
<file src="$BuildTmp$\bin\Umbraco.Infrastructure.xml" target="lib\netstandard2.0\Umbraco.Infrastructure.xml" />
<file src="$BuildTmp$\bin\Umbraco.PublishedCache.NuCache.xml" target="lib\netstandard2.0\Umbraco.PublishedCache.NuCache.xml" />
<!-- symbols -->
<file src="$BuildTmp$\bin\Umbraco.Core.pdb" target="lib\netstandard2.0\Umbraco.Core.pdb" />
<file src="$BuildTmp$\bin\Umbraco.Examine.Lucene.pdb" target="lib\net472\Umbraco.Examine.Lucene.pdb" />
<file src="$BuildTmp$\bin\Umbraco.Examine.Lucene.pdb" target="lib\netstandard2.0\Umbraco.Examine.Lucene.pdb" />
<file src="$BuildTmp$\bin\Umbraco.Infrastructure.pdb" target="lib\netstandard2.0\Umbraco.Infrastructure.pdb" />
<file src="$BuildTmp$\bin\Umbraco.PublishedCache.NuCache.pdb" target="lib\netstandard2.0\Umbraco.PublishedCache.NuCache.pdb" />
</files>
</package>

View File

@@ -22,6 +22,7 @@
<dependency id="Umbraco.Cms.Infrastructure" version="[$version$]" />
<dependency id="Newtonsoft.Json" version="[12.0.3,12.999999)" />
<dependency id="NPoco" version="[4.0.2,4.999999)" />
<dependency id="System.Configuration.ConfigurationManager" version="[5.0.0,5.999999)" />
</group>
</dependencies>

View File

@@ -1,57 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata minClientVersion="4.1.0">
<id>Umbraco.Cms.Web</id>
<version>9.0.0</version>
<title>Umbraco Cms Core Binaries</title>
<authors>Umbraco HQ</authors>
<owners>Umbraco HQ</owners>
<license type="expression">MIT</license>
<projectUrl>https://umbraco.com/</projectUrl>
<iconUrl>https://umbraco.com/dist/nuget/logo-small.png</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>Contains the web assemblies needed to run Umbraco Cms. This package only contains assemblies and can be used for package development. Use the UmbracoCms package to setup Umbraco in Visual Studio as an ASP.NET Core project.</description>
<summary>Contains the core assemblies needed to run Umbraco Cms</summary>
<language>en-US</language>
<tags>umbraco</tags>
<repository type="git" url="https://github.com/umbraco/umbraco-cms" />
<dependencies>
<group targetFramework="net5.0">
<!--
note: dependencies are specified as [x.y.z,x.999999) eg [2.1.0,2.999999) and NOT [2.1.0,3.0.0) because
the latter would pick anything below 3.0.0 and that includes prereleases such as 3.0.0-alpha, and we do
not want this to happen as the alpha of the next major is, really, the next major already.
-->
<dependency id="Umbraco.Cms.Core" version="[$version$]" />
<dependency id="HtmlSanitizer" version="[5.0.376,5.999999)" />
<dependency id="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" version="[5.0.3,5.999999)" />
<dependency id="Serilog.AspNetCore" version="[3.4.0,3.999999)" />
<dependency id="Microsoft.AspNetCore.Mvc.NewtonsoftJson" version="[5.0.3,5.999999)" />
<dependency id="MiniProfiler.AspNetCore.Mvc" version="[4.2.22,4.999999)" />
<dependency id="NETStandard.Library" version="[2.0.3,2.999999)" />
<dependency id="SixLabors.ImageSharp.Web" version="[1.0.2,1.999999)" />
<dependency id="Smidge" version="[3.2.0,3.999999)" />
<dependency id="Smidge.Nuglify" version="[3.2.0,3.999999)" />
<dependency id="Microsoft.CodeAnalysis.CSharp" version="[3.8.0,3.999999)" />
</group>
</dependencies>
</metadata>
<files>
<!-- libs -->
<file src="$BuildTmp$\bin\Umbraco.Web.BackOffice.dll" target="lib\net5.0\Umbraco.Web.BackOffice.dll" />
<file src="$BuildTmp$\bin\Umbraco.Web.Common.dll" target="lib\net5.0\Umbraco.Web.Common.dll" />
<file src="$BuildTmp$\bin\Umbraco.Web.Website.dll" target="lib\net5.0\Umbraco.Web.Website.dll" />
<!-- docs -->
<file src="$BuildTmp$\bin\Umbraco.Web.BackOffice.xml" target="lib\net5.0\Umbraco.Web.BackOffice.xml" />
<file src="$BuildTmp$\bin\Umbraco.Web.Common.xml" target="lib\net5.0\Umbraco.Web.Common.xml" />
<file src="$BuildTmp$\bin\Umbraco.Web.Website.xml" target="lib\net5.0\Umbraco.Web.Website.xml" />
<!-- symbols -->
<file src="$BuildTmp$\bin\Umbraco.Web.BackOffice.pdb" target="lib\net5.0\Umbraco.Web.BackOffice.pdb" />
<file src="$BuildTmp$\bin\Umbraco.Web.Common.pdb" target="lib\net5.0\Umbraco.Web.Common.pdb" />
<file src="$BuildTmp$\bin\Umbraco.Web.Website.pdb" target="lib\net5.0\Umbraco.Web.Website.pdb" />
</files>
</package>

View File

@@ -1,6 +1,6 @@
using System.Configuration;
using System.IO;
using System.IO;
using Umbraco.Cms.Core.Configuration.Models;
using Umbraco.Cms.Core.Exceptions;
using Umbraco.Cms.Core.Hosting;
namespace Umbraco.Extensions
@@ -30,7 +30,7 @@ namespace Umbraco.Extensions
// unless AcceptUnsafeModelsDirectory and then everything is OK.
if (!Path.IsPathRooted(root))
throw new ConfigurationErrorsException($"Root is not rooted \"{root}\".");
throw new ConfigurationException($"Root is not rooted \"{root}\".");
if (config.StartsWith("~/"))
{
@@ -43,7 +43,7 @@ namespace Umbraco.Extensions
root = Path.GetFullPath(root);
if (!dir.StartsWith(root) && !acceptUnsafe)
throw new ConfigurationErrorsException($"Invalid models directory \"{config}\".");
throw new ConfigurationException($"Invalid models directory \"{config}\".");
return dir;
}
@@ -51,7 +51,7 @@ namespace Umbraco.Extensions
if (acceptUnsafe)
return Path.GetFullPath(config);
throw new ConfigurationErrorsException($"Invalid models directory \"{config}\".");
throw new ConfigurationException($"Invalid models directory \"{config}\".");
}
}
}

View File

@@ -0,0 +1,41 @@
using System;
using System.Runtime.Serialization;
namespace Umbraco.Cms.Core.Exceptions
{
/// <summary>
/// An exception that is thrown if the configuration is wrong.
/// </summary>
/// <seealso cref="System.Exception" />
[Serializable]
public class ConfigurationException : Exception
{
/// <summary>
/// Initializes a new instance of the <see cref="ConfigurationException" /> class with a specified error message.
/// </summary>
/// <param name="message">The message that describes the error.</param>
public ConfigurationException(string message)
: base(message)
{ }
/// <summary>
/// Initializes a new instance of the <see cref="ConfigurationException" /> class with a specified error message
/// and a reference to the inner exception which is the cause of this exception.
/// </summary>
/// <param name="message">The message that describes the error.</param>
/// <param name="innerException">The inner exception, or null.</param>
public ConfigurationException(string message, Exception innerException)
: base(message, innerException)
{ }
/// <summary>
/// Initializes a new instance of the <see cref="ConfigurationException" /> class.
/// </summary>
/// <param name="info">The <see cref="T:System.Runtime.Serialization.SerializationInfo" /> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="T:System.Runtime.Serialization.StreamingContext" /> that contains contextual information about the source or destination.</param>
protected ConfigurationException(SerializationInfo info, StreamingContext context)
: base(info, context)
{ }
}
}

View File

@@ -7,7 +7,7 @@
<PackageId>Umbraco.Cms.Core</PackageId>
<Title>Umbraco CMS Core</Title>
<Description>Contains the core assembly needed to run Umbraco Cms. This package only contains the assembly, and can be used for package development. Use the template in the Umbraco.Templates package to setup Umbraco</Description>
<Product>Umbraco CMS</Product>
<Product>Umbraco CMS</Product>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
@@ -22,7 +22,6 @@
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.DataAnnotations" Version="5.0.0" />
<PackageReference Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="5.0.0" />
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
<PackageReference Include="System.Runtime.Caching" Version="5.0.0" />
</ItemGroup>

View File

@@ -37,10 +37,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{B5BD12C1
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NuSpecs", "NuSpecs", "{227C3B55-80E5-4E7E-A802-BE16C5128B9D}"
ProjectSection(SolutionItems) = preProject
..\build\NuSpecs\UmbracoCms.Core.nuspec = ..\build\NuSpecs\UmbracoCms.Core.nuspec
..\build\NuSpecs\UmbracoCms.nuspec = ..\build\NuSpecs\UmbracoCms.nuspec
..\build\NuSpecs\UmbracoCms.SqlCe.nuspec = ..\build\NuSpecs\UmbracoCms.SqlCe.nuspec
..\build\NuSpecs\UmbracoCms.Web.nuspec = ..\build\NuSpecs\UmbracoCms.Web.nuspec
..\build\NuSpecs\UmbracoCms.Examine.Lucene.nuspec = ..\build\NuSpecs\UmbracoCms.Examine.Lucene.nuspec
EndProjectSection
EndProject