Skip to content

Commit 5966deb

Browse files
Target .NET 8 and update test packages (#529)
* target .NET 8 and update other testing packages * use version of dependency injection equal to net version * remove test comment * fix json content test * revert change to flattener * change back version of json package * add back versions * fix test to work for new versions of microsoft.extensions.configuration.json * remove conditional packages * fix spacing, test with ado pipeline * fix spacing * update other examples * allow informationalversionattribute format in test for useragentheader
1 parent fd3e538 commit 5966deb

File tree

11 files changed

+42
-40
lines changed

11 files changed

+42
-40
lines changed

build/install-dotnet.ps1

Lines changed: 4 additions & 2 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 6, .NET 7, and .NET 8 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

66
&([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Channel 6.0
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'))) -Channel 7.0
9+
10+
&([scriptblock]::Create((Invoke-WebRequest -UseBasicParsing 'https://dot.net/v1/dotnet-install.ps1'))) -Channel 8.0

examples/ConfigStoreDemo/ConfigStoreDemo.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
<PropertyGroup>
33
<IsPackable>false</IsPackable>
4-
<TargetFramework>net7.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
</PropertyGroup>
66
<ItemGroup>
77
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.2" />

examples/ConsoleAppWithFailOver/ConsoleAppWithFailOver.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net7.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
</PropertyGroup>
77

88
<ItemGroup>

examples/ConsoleApplication/ConsoleApplication.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<IsPackable>false</IsPackable>
55
<OutputType>Exe</OutputType>
6-
<TargetFramework>net7.0</TargetFramework>
6+
<TargetFramework>net8.0</TargetFramework>
77
</PropertyGroup>
88

99
<ItemGroup>

src/Microsoft.Azure.AppConfiguration.AspNetCore/Microsoft.Azure.AppConfiguration.AspNetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="..\..\build\NugetProperties.props" />
33

44
<PropertyGroup>
5-
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
5+
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
66
<Description>Microsoft.Azure.AppConfiguration.AspNetCore allows developers to use Microsoft Azure App Configuration service as a configuration source in their applications. This package adds additional features for ASP.NET Core applications to the existing package Microsoft.Extensions.Configuration.AzureAppConfiguration.</Description>
77
<SignAssembly>true</SignAssembly>
88
<DelaySign>false</DelaySign>

src/Microsoft.Azure.AppConfiguration.Functions.Worker/Microsoft.Azure.AppConfiguration.Functions.Worker.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="..\..\build\NugetProperties.props" />
33

44
<PropertyGroup>
5-
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
5+
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
66
<Description>Microsoft.Azure.AppConfiguration.Functions.Worker allows developers to use the Microsoft Azure App Configuration service as a configuration source in their applications. This package adds additional features to the existing package Microsoft.Extensions.Configuration.AzureAppConfiguration for .NET Azure Functions running in an isolated process.</Description>
77
<SignAssembly>true</SignAssembly>
88
<DelaySign>false</DelaySign>

tests/Tests.AzureAppConfiguration.AspNetCore/Tests.AzureAppConfiguration.AspNetCore.csproj

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
55
<LangVersion>8.0</LangVersion>
66
<DelaySign>false</DelaySign>
77
<SignAssembly>true</SignAssembly>
@@ -10,11 +10,14 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
14-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
15-
<PackageReference Include="Moq" Version="4.16.0" />
16-
<PackageReference Include="xunit" Version="2.4.1" />
17-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
13+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
15+
<PackageReference Include="Moq" Version="4.20.70" />
16+
<PackageReference Include="xunit" Version="2.7.0" />
17+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
18+
<PrivateAssets>all</PrivateAssets>
19+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
20+
</PackageReference>
1821
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
1922
</ItemGroup>
2023

tests/Tests.AzureAppConfiguration.Functions.Worker/Tests.AzureAppConfiguration.Functions.Worker.csproj

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
4+
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
55
<LangVersion>8.0</LangVersion>
66
<DelaySign>false</DelaySign>
77
<SignAssembly>true</SignAssembly>
@@ -10,11 +10,14 @@
1010
</PropertyGroup>
1111

1212
<ItemGroup>
13-
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="6.0.0" />
14-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
15-
<PackageReference Include="Moq" Version="4.16.0" />
16-
<PackageReference Include="xunit" Version="2.4.1" />
17-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
13+
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
14+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
15+
<PackageReference Include="Moq" Version="4.20.70" />
16+
<PackageReference Include="xunit" Version="2.7.0" />
17+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
18+
<PrivateAssets>all</PrivateAssets>
19+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
20+
</PackageReference>
1821
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
1922
</ItemGroup>
2023

tests/Tests.AzureAppConfiguration/JsonContentTypeTests.cs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,15 @@ public void JsonContentTypeTests_CompareJsonSettingsBetweenAppConfigAndJsonFile(
2828

2929
var appconfigSettings = new ConfigurationBuilder()
3030
.AddAzureAppConfiguration(options => options.ClientManager = mockClientManager)
31-
.Build()
32-
.AsEnumerable();
31+
.Build();
3332

3433
var jsonSettings = new ConfigurationBuilder()
3534
.AddJsonFile(jsonFilePath)
36-
.Build()
37-
.AsEnumerable();
38-
39-
Assert.Equal(jsonSettings.Count(), appconfigSettings.Count());
35+
.Build();
4036

41-
foreach (KeyValuePair<string, string> jsonSetting in jsonSettings)
37+
foreach (KeyValuePair<string, string> jsonSetting in jsonSettings.AsEnumerable())
4238
{
43-
KeyValuePair<string, string> appconfigSetting = appconfigSettings.SingleOrDefault(x => x.Key == jsonSetting.Key);
44-
Assert.Equal(jsonSetting, appconfigSetting);
39+
Assert.Equal(jsonSettings.GetSection(jsonSetting.Key).Value, appconfigSettings.GetSection(jsonSetting.Key).Value);
4540
}
4641
}
4742

tests/Tests.AzureAppConfiguration/Tests.AzureAppConfiguration.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>net48;net6.0;net7.0</TargetFrameworks>
4+
<TargetFrameworks>net48;net6.0;net7.0;net8.0</TargetFrameworks>
55
<LangVersion>8.0</LangVersion>
66
<DelaySign>false</DelaySign>
77
<SignAssembly>true</SignAssembly>
@@ -11,23 +11,22 @@
1111

1212
<ItemGroup>
1313
<PackageReference Include="Azure.Identity" Version="1.10.2" />
14-
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="5.0.0" />
15-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
16-
<PackageReference Include="Moq" Version="4.16.0" />
14+
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
15+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
1716
<PackageReference Include="System.Linq.Async" Version="6.0.1" />
18-
<PackageReference Include="xunit" Version="2.4.1" />
19-
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3" />
17+
<PackageReference Include="Moq" Version="4.20.70" />
18+
<PackageReference Include="xunit" Version="2.7.0" />
19+
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
20+
<PrivateAssets>all</PrivateAssets>
21+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
22+
</PackageReference>
2023
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
2124
</ItemGroup>
22-
25+
2326
<ItemGroup>
2427
<ProjectReference Include="..\..\src\Microsoft.Extensions.Configuration.AzureAppConfiguration\Microsoft.Extensions.Configuration.AzureAppConfiguration.csproj" />
2528
</ItemGroup>
2629

27-
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
28-
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
29-
</ItemGroup>
30-
3130
<ItemGroup>
3231
<None Update="MockTestData\jsonconfig-settings.json">
3332
<CopyToOutputDirectory>Always</CopyToOutputDirectory>

0 commit comments

Comments
 (0)