Skip to content

Commit a03cd26

Browse files
authored
Revert "Merge main changes into preview (#271)"
This reverts commit 3e9179a.
1 parent 3e9179a commit a03cd26

26 files changed

+238
-388
lines changed

Microsoft.FeatureManagement.sln

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TargetingConsoleApp", "exam
2121
EndProject
2222
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RazorPages", "examples\RazorPages\RazorPages.csproj", "{BA29A1BB-81D5-4EB1-AF37-6ECF64AF27E2}"
2323
EndProject
24-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.FeatureManagement.AspNetCore", "tests\Tests.FeatureManagement.AspNetCore\Tests.FeatureManagement.AspNetCore.csproj", "{FC0DC3E2-5646-4AEC-A7DB-2D6167BC3BB4}"
25-
EndProject
2624
Global
2725
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2826
Debug|Any CPU = Debug|Any CPU
@@ -57,10 +55,6 @@ Global
5755
{BA29A1BB-81D5-4EB1-AF37-6ECF64AF27E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
5856
{BA29A1BB-81D5-4EB1-AF37-6ECF64AF27E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
5957
{BA29A1BB-81D5-4EB1-AF37-6ECF64AF27E2}.Release|Any CPU.Build.0 = Release|Any CPU
60-
{FC0DC3E2-5646-4AEC-A7DB-2D6167BC3BB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
61-
{FC0DC3E2-5646-4AEC-A7DB-2D6167BC3BB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
62-
{FC0DC3E2-5646-4AEC-A7DB-2D6167BC3BB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
63-
{FC0DC3E2-5646-4AEC-A7DB-2D6167BC3BB4}.Release|Any CPU.Build.0 = Release|Any CPU
6458
EndGlobalSection
6559
GlobalSection(SolutionProperties) = preSolution
6660
HideSolutionNode = FALSE
@@ -71,7 +65,6 @@ Global
7165
{E50FB931-7A42-440E-AC47-B8DFE5E15394} = {FB5C34DF-695C-4DF9-8AED-B3EA2516EA72}
7266
{6558C21E-CF20-4278-AA08-EB9D1DF29D66} = {FB5C34DF-695C-4DF9-8AED-B3EA2516EA72}
7367
{BA29A1BB-81D5-4EB1-AF37-6ECF64AF27E2} = {FB5C34DF-695C-4DF9-8AED-B3EA2516EA72}
74-
{FC0DC3E2-5646-4AEC-A7DB-2D6167BC3BB4} = {8ED6FFEE-4037-49A2-9709-BC519C104A90}
7568
EndGlobalSection
7669
GlobalSection(ExtensibilityGlobals) = postSolution
7770
SolutionGuid = {84DA6C54-F140-4518-A1B4-E4CF42117FBD}

build/install-dotnet.ps1

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# Installs .NET 6 and .NET 7 for CI/CD environment
1+
# Installs .NET Core 2.1, .NET 5 and .NET 6 for CI/CD environment
22
# see: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script#examples
33

44
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
55

6-
&([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Channel 6.0
6+
&([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Version 2.1.816
77

8-
&([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Channel 7.0
8+
&([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Version 5.0.408
9+
10+
&([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1')))

examples/RazorPages/RazorPages.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Web">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>netcoreapp3.1</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

src/Microsoft.FeatureManagement.AspNetCore/AspNetCoreFeatureManagementBuilderExtensions.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//
44
using Microsoft.AspNetCore.Mvc.Filters;
55
using Microsoft.Extensions.DependencyInjection;
6+
using Microsoft.FeatureManagement.FeatureFilters;
67
using Microsoft.FeatureManagement.Mvc;
78
using System;
89
using System.Collections.Generic;

src/Microsoft.FeatureManagement.AspNetCore/Microsoft.FeatureManagement.AspNetCore.csproj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Import Project="..\..\build\Versioning.props" />
1212

1313
<PropertyGroup>
14-
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
14+
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
1515
<SignAssembly>true</SignAssembly>
1616
<DelaySign>false</DelaySign>
1717
<AssemblyOriginatorKeyFile>..\..\build\Microsoft.FeatureManagement.snk</AssemblyOriginatorKeyFile>
@@ -28,9 +28,17 @@
2828
<PackageIconUrl>https://aka.ms/AzureAppConfigurationPackageIcon</PackageIconUrl>
2929
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
3030
</PropertyGroup>
31-
31+
3232
<ItemGroup>
3333
<ProjectReference Include="..\Microsoft.FeatureManagement\Microsoft.FeatureManagement.csproj" />
34+
</ItemGroup>
35+
36+
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
37+
<PackageReference Include="Microsoft.AspNetCore.Mvc.RazorPages" Version="2.1.11" />
38+
<PackageReference Include="Microsoft.AspNetCore.Mvc.TagHelpers" Version="2.1.3" />
39+
</ItemGroup>
40+
41+
<ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0'">
3442
<FrameworkReference Include="Microsoft.AspNetCore.App" />
3543
</ItemGroup>
3644

src/Microsoft.FeatureManagement/ConfigurationFeatureDefinitionProvider.cs

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT license.
33
//
44
using Microsoft.Extensions.Configuration;
5-
using Microsoft.Extensions.Logging;
65
using Microsoft.Extensions.Primitives;
76
using System;
87
using System.Collections.Concurrent;
@@ -26,15 +25,13 @@ sealed class ConfigurationFeatureDefinitionProvider : IFeatureDefinitionProvider
2625
private readonly IConfiguration _configuration;
2726
private readonly ConcurrentDictionary<string, FeatureDefinition> _definitions;
2827
private IDisposable _changeSubscription;
29-
private readonly ILogger _logger;
3028
private int _stale = 0;
3129

3230
const string ParseValueErrorString = "Invalid setting '{0}' with value '{1}' for feature '{2}'.";
3331

34-
public ConfigurationFeatureDefinitionProvider(IConfiguration configuration, ILoggerFactory loggerFactory)
32+
public ConfigurationFeatureDefinitionProvider(IConfiguration configuration)
3533
{
3634
_configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
37-
_logger = loggerFactory?.CreateLogger<ConfigurationFeatureDefinitionProvider>() ?? throw new ArgumentNullException(nameof(loggerFactory));
3835
_definitions = new ConcurrentDictionary<string, FeatureDefinition>();
3936

4037
_changeSubscription = ChangeToken.OnChange(
@@ -298,18 +295,16 @@ We support
298295

299296
private IEnumerable<IConfigurationSection> GetFeatureDefinitionSections()
300297
{
301-
//
302-
// Look for feature definitions under the "FeatureManagement" section
303-
IConfigurationSection featureManagementConfigurationSection = _configuration.GetSection(ConfigurationFields.FeatureManagementSectionName);
304-
305-
if (featureManagementConfigurationSection.Exists())
298+
if (_configuration.GetChildren().Any(s => s.Key.Equals(ConfigurationFields.FeatureManagementSectionName, StringComparison.OrdinalIgnoreCase)))
306299
{
307-
return featureManagementConfigurationSection.GetChildren();
300+
//
301+
// Look for feature definitions under the "FeatureManagement" section
302+
return _configuration.GetSection(ConfigurationFields.FeatureManagementSectionName).GetChildren();
303+
}
304+
else
305+
{
306+
return _configuration.GetChildren();
308307
}
309-
310-
_logger.LogDebug($"No configuration section named '{ConfigurationFields.FeatureManagementSectionName}' was found.");
311-
312-
return Enumerable.Empty<IConfigurationSection>();
313308
}
314309

315310
private T ParseEnum<T>(string feature, string rawValue, string fieldKeyword)

src/Microsoft.FeatureManagement/FeatureManager.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using Microsoft.Extensions.Caching.Memory;
55
using Microsoft.Extensions.Configuration;
66
using Microsoft.Extensions.Logging;
7+
using Microsoft.Extensions.Logging.Abstractions;
78
using Microsoft.Extensions.Options;
89
using Microsoft.FeatureManagement.FeatureFilters;
910
using Microsoft.FeatureManagement.Targeting;

src/Microsoft.FeatureManagement/IsExternalInit.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// This class is used to compile .NET frameworks that don't support C# 9.0 or later while still using the init accessor for a property.
77
// The code referenced for this file can be found here: https://github.com/dotnet/roslyn/issues/45510#issuecomment-725091019
88

9-
#if NETSTANDARD2_0 || NETSTANDARD2_1
9+
#if NETSTANDARD2_0 || NETCOREAPP2_1 || NETCOREAPP3_1
1010

1111
using System.ComponentModel;
1212

src/Microsoft.FeatureManagement/Microsoft.FeatureManagement.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<Import Project="..\..\build\Versioning.props" />
1212

1313
<PropertyGroup>
14-
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
14+
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
1515
<SignAssembly>true</SignAssembly>
1616
<DelaySign>false</DelaySign>
1717
<AssemblyOriginatorKeyFile>..\..\build\Microsoft.FeatureManagement.snk</AssemblyOriginatorKeyFile>

src/Microsoft.FeatureManagement/ServiceCollectionExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public static IFeatureManagementBuilder AddFeatureManagement(this IServiceCollec
8383
throw new ArgumentNullException(nameof(configuration));
8484
}
8585

86-
services.AddSingleton<IFeatureDefinitionProvider>(sp => new ConfigurationFeatureDefinitionProvider(configuration, sp.GetRequiredService<ILoggerFactory>()));
86+
services.AddSingleton<IFeatureDefinitionProvider>(new ConfigurationFeatureDefinitionProvider(configuration));
8787

8888
return services.AddFeatureManagement();
8989
}

0 commit comments

Comments
 (0)