Skip to content

Commit

Permalink
#61 : Updated target frameworks, package versions, and method for add…
Browse files Browse the repository at this point in the history
…ing headers

Updated the target frameworks across multiple projects to `net8.0` and updated various package versions in `dapr_sidekick_csharp.props`, `ActorSample.ActorClient.csproj`, `ActorSample.DemoActor.csproj`, `ActorSample.IDemoActor.csproj`, `AppConfigurationSample.csproj`, `ConsulSample.Receiver.csproj`, `ConsulSample.Sender.csproj`, `ControllerSample.csproj`, `ServiceInvocationSample.csproj`, `Directory.build.props`, `Man.Dapr.Sidekick.csproj`, `Man.Dapr.Sidekick.AspNetCore.Tests.csproj`, `Man.Dapr.Sidekick.Extensions.Logging.Tests.csproj`, and `Man.Dapr.Sidekick.Tests.csproj`. Also replaced the `Add` method with the `Append` method for adding headers in `HttpContextInvocationHandlerTests.cs`.
  • Loading branch information
badgeratu committed Apr 9, 2024
1 parent 8a00cc7 commit f7d0543
Show file tree
Hide file tree
Showing 19 changed files with 53 additions and 49 deletions.
4 changes: 2 additions & 2 deletions properties/dapr_sidekick_csharp.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
<!-- OpenAPI Analyzers disabled due to issue : https://github.com/dotnet/aspnetcore/issues/14723 -->
<IncludeOpenAPIAnalyzers>false</IncludeOpenAPIAnalyzers>
<MicrosoftNETFrameworkReferenceAssembliesLatestPackageVersion>1.0.2</MicrosoftNETFrameworkReferenceAssembliesLatestPackageVersion>
<MicrosoftNETFrameworkReferenceAssembliesLatestPackageVersion>1.0.3</MicrosoftNETFrameworkReferenceAssembliesLatestPackageVersion>
</PropertyGroup>

<!-- Cls Compliant -->
Expand Down Expand Up @@ -42,7 +42,7 @@

<!-- Asset Packages -->
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.Actors" Version="1.2.0" />
<PackageReference Include="Dapr.Actors" Version="1.13.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.Actors" Version="1.2.0" />
<PackageReference Include="Dapr.Actors.AspNetCore" Version="1.2.0" />
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
<PackageReference Include="Dapr.Actors" Version="1.13.0" />
<PackageReference Include="Dapr.Actors.AspNetCore" Version="1.13.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.Actors" Version="1.2.0" />
<PackageReference Include="Dapr.Actors" Version="1.13.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>10</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.Extensions.Configuration" Version="1.11.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.11"/>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0"/>
<PackageReference Include="Dapr.AspNetCore" Version="1.11.0" />
<PackageReference Include="Serilog.AspNetCore" Version="7.0.0" />
<PackageReference Include="Dapr.Extensions.Configuration" Version="1.13.0" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.11" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
<PackageReference Include="Dapr.AspNetCore" Version="1.13.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Dapr.AspNetCore" Version="1.2.0" />
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
<PackageReference Include="Dapr.AspNetCore" Version="1.13.0" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\..\src\Man.Dapr.Sidekick.AspNetCore\Man.Dapr.Sidekick.AspNetCore.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Serilog.AspNetCore" Version="8.0.1" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Directory.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All"/>
</ItemGroup>

<!-- Enable Deterministic Builds for github actions -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;netstandard2.0;netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Description>This package contains the reference assemblies for developing services using Dapr Sidekick and ASP.NET Core.</Description>
<PackageId>Man.Dapr.Sidekick.AspNetCore</PackageId>
</PropertyGroup>
Expand All @@ -16,7 +16,7 @@
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.2.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' OR '$(TargetFramework)' == 'net5.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0' OR '$(TargetFramework)' == 'net8.0'">
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net45;net461;netstandard2.0;netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks>net45;net461;netstandard2.0;net6.0;net8.0</TargetFrameworks>
<Description>This package contains the reference assemblies for routing Dapr Sidekick logging messages through the Microsoft Extensions Logging framework.</Description>
<PackageId>Man.Dapr.Sidekick.Extensions.Logging</PackageId>
</PropertyGroup>
Expand All @@ -18,12 +18,12 @@
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.2.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1'">
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="3.1.0" />
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.4" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/Man.Dapr.Sidekick/Man.Dapr.Sidekick.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net35;net45;net461;netstandard2.0;netcoreapp3.1;net5.0</TargetFrameworks>
<TargetFrameworks>net35;net45;net461;netstandard2.0;net6.0;net8.0</TargetFrameworks>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Description>This package contains the reference assemblies for developing services using Dapr Sidekick.</Description>
<PackageId>Man.Dapr.Sidekick</PackageId>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net35' OR '$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net461' OR '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net461'">
Expand Down
4 changes: 2 additions & 2 deletions tests/Directory.build.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
<ItemGroup>
<PackageReference Include="NUnit" Version="3.12.0" />
<PackageReference Include="NUnit3TestAdapter" Version="3.16.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.8.0" />
<PackageReference Include="coverlet.msbuild" Version="2.9.0">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="coverlet.msbuild" Version="6.0.2">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void Should_add_authorization_header()
httpContextAccessor.HttpContext.Returns(httpContext);
var handler = new MockHttpContextInvocationHandler(httpContextAccessor);

httpRequest.Headers.Add("Authorization", "AUTH1");
httpRequest.Headers.Append("Authorization", "AUTH1");
var request = new HttpRequestMessage();
var cancellationToken = CancellationToken.None;

Expand All @@ -57,7 +57,7 @@ public void Should_throw_exception_when_multiple_authorization_header_values()
var handler = new MockHttpContextInvocationHandler(httpContextAccessor);

var values = new StringValues(new[] { "AUTH1", "AUTH2" });
httpRequest.Headers.Add("Authorization", values);
httpRequest.Headers.Append("Authorization", values);
var request = new HttpRequestMessage();
var cancellationToken = CancellationToken.None;

Expand Down Expand Up @@ -94,7 +94,7 @@ public void Should_remove_authorization_header()
httpContextAccessor.HttpContext.Returns(httpContext);
var handler = new MockHttpContextInvocationHandler(httpContextAccessor);

httpRequest.Headers.Add("Authorization", "AUTH1");
httpRequest.Headers.Append("Authorization", "AUTH1");
var request = new HttpRequestMessage();
request.Headers.Add("Authorization", "AUTH1");
var cancellationToken = CancellationToken.None;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<RootNamespace>Man.Dapr.Sidekick.AspNetCore</RootNamespace>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
using Microsoft.AspNetCore.Builder;
using System;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using NSubstitute;
using NUnit.Framework;

Expand Down Expand Up @@ -51,7 +53,7 @@ public void Should_add_without_url()
{
var builder = Substitute.For<IApplicationBuilder>();
builder.UseDaprMetricsServer(null);
builder.Received(1).UseMiddleware(typeof(DaprMetricsServerMiddleware));
builder.Received(1).Use(Arg.Any<Func<RequestDelegate, RequestDelegate>>());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Man.Dapr.Sidekick.Extensions.Logging</RootNamespace>
<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions tests/Man.Dapr.Sidekick.Tests/Man.Dapr.Sidekick.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net35;net48;net5.0</TargetFrameworks>
<TargetFrameworks>net35;net48;net8.0</TargetFrameworks>
<LangVersion>8.0</LangVersion>
<IsPackable>false</IsPackable>
<RootNamespace>Man.Dapr.Sidekick</RootNamespace>
Expand All @@ -23,7 +23,7 @@
<ProjectReference Include="..\..\src\Man.Dapr.Sidekick\Man.Dapr.Sidekick.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="3.10.0" />
</ItemGroup>

Expand Down

0 comments on commit f7d0543

Please sign in to comment.