Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add .NET 8 TFM, clean up new warnings #2105

Merged
merged 1 commit into from
Apr 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samples/BasicYarpSample/BasicYarpSample.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
</PropertyGroup>

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

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<UserSecretsId>78d1f3b4-abce-4c5a-b914-3321fab1f8d0</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<IsPackable>$('System.TeamProject') != 'internal'</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<UserSecretsId>b2dc6cd7-acbb-4d65-ad19-74771ff3c80f</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<IsPackable>$('System.TeamProject') != 'internal'</IsPackable>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<UserSecretsId>42f98116-26c4-4115-b6af-c5dec1f88c84</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<IsPackable>$('System.TeamProject') != 'internal'</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion samples/KubernetesIngress.Sample/backend/backend.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<RootNamespace>Backend</RootNamespace>
<UserSecretsId>aaa98da6-d0d4-4ad6-9821-f66057413c3a</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
Expand Down
2 changes: 1 addition & 1 deletion samples/Prometheus/HttpLoadApp/HttpLoadApp.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
</PropertyGroup>

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

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>Yarp.Sample</RootNamespace>
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>Yarp.Sample</RootNamespace>
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>Yarp.Sample</RootNamespace>
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>Yarp.Sample</RootNamespace>
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>Yarp.Sample</RootNamespace>
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>Yarp.Sample</RootNamespace>
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
</PropertyGroup>

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

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>Yarp.Sample</RootNamespace>
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>latest</LangVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>Yarp.Sample</RootNamespace>
<LangVersion>latest</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion samples/SampleServer/Controllers/HttpController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void Headers([FromBody] Dictionary<string, string> headers)
{
foreach (var (key, value) in headers)
{
Response.Headers.Add(key, value);
Response.Headers[key] = value;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion samples/SampleServer/SampleServer.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<RootNamespace>SampleServer</RootNamespace>
</PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Toolkit for building a Kubernetes Ingress Controller in .NET using the infrastructure from ASP.NET and .NET</Description>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<OutputType>Library</OutputType>
<NoWarn>$(NoWarn);CS8002</NoWarn>
<IsPackable>$('System.TeamProject') != 'internal'</IsPackable>
Expand Down
2 changes: 1 addition & 1 deletion src/ReverseProxy/Yarp.ReverseProxy.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Reverse proxy toolkit for building fast proxy servers in .NET using the infrastructure from ASP.NET and .NET</Description>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we want to make 8.0 non-packable for releases, or just clarify in the docs that previews have a different support window?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a decision we can make when we're closer to release. For now I think it's sufficient to say that 8.0 is preview and only gets preview support. I think it's also valuable for now to have the 8.0 bits in the nightly builds for people to try.

<OutputType>Library</OutputType>
<RootNamespace>Yarp.ReverseProxy</RootNamespace>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Yarp.ReverseProxy extension package for in-process telemetry consumption</Description>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<OutputType>Library</OutputType>
<RootNamespace>Yarp.Telemetry.Consumption</RootNamespace>
<Nullable>enable</Nullable>
Expand Down
2 changes: 1 addition & 1 deletion test/Kubernetes.Tests/Yarp.Kubernetes.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<OutputType>Library</OutputType>
<NoWarn>$(NoWarn);CS8002</NoWarn>
<RootNamespace>Yarp.Kubernetes</RootNamespace>
Expand Down
12 changes: 10 additions & 2 deletions test/ReverseProxy.FunctionalTests/HeaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ public async Task ProxyAsync_EmptyResponseHeader_Proxied()
var test = new TestEnvironment(
context =>
{
context.Response.Headers.Add(HeaderNames.WWWAuthenticate, "");
context.Response.Headers.Add("custom", "");
context.Response.Headers[HeaderNames.WWWAuthenticate] = "";
context.Response.Headers["custom"] = "";
return Task.CompletedTask;
})
{
Expand Down Expand Up @@ -427,7 +427,15 @@ public async Task ContentLengthAndTransferEncoding_ContentLengthRemoved()
{
try
{
#if NET8_0_OR_GREATER
// Removed by the server
Assert.Null(context.Request.ContentLength);
// Set it just to make sure YARP removes it
context.Request.ContentLength = 11;
#else
// Fixed in 8.0 https://github.com/dotnet/aspnetcore/issues/43523
Assert.Equal(11, context.Request.ContentLength);
#endif
Assert.Equal("chunked", context.Request.Headers[HeaderNames.TransferEncoding]);
proxyTcs.SetResult(0);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks>
<OutputType>Library</OutputType>
<RootNamespace>Yarp.ReverseProxy</RootNamespace>

Expand Down
Loading
Loading