Skip to content
New issue

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

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

Already on GitHub? # to your account

Upgrade lib to dotnet 8 #2

Merged
merged 1 commit into from
Apr 30, 2024
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 .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
workflow_dispatch:

env:
DOTNET_VERSION: '6.x.x' # The .NET SDK version to use
DOTNET_VERSION: '8.x.x' # The .NET SDK version to use

jobs:
build-and-test:
Expand Down
9 changes: 6 additions & 3 deletions OpenMeteo/HttpController.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Http;

namespace OpenMeteo
Expand All @@ -15,7 +13,12 @@ internal class HttpController

public HttpController()
{
_httpClient = new HttpClient();
var socketHttpHandler = new SocketsHttpHandler()
{
PooledConnectionLifetime = TimeSpan.FromMinutes(4),
};
_httpClient = new HttpClient(socketHttpHandler);

_httpClient.DefaultRequestHeaders.Accept.Clear();
_httpClient.DefaultRequestHeaders.Accept.Add(
new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")
Expand Down
6 changes: 3 additions & 3 deletions OpenMeteo/OpenMeteo.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<PackageId>$(AssemblyName).colinnuk.dotnet</PackageId>
<Title>Open Meteo Dotnet Library</Title>
<Title>Open Meteo Dotnet 8 Library</Title>
<Version>0.0.3</Version>
<Authors>AlienDwarf</Authors>
<Company />
Expand All @@ -17,7 +17,7 @@
<AssemblyVersion>0.0.1</AssemblyVersion>
<FileVersion>0.0.1</FileVersion>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<Description>A .Net Standard 2.1 library for the Open-Meteo.com API.</Description>
<Description>A DotNet 8 library for the Open-Meteo.com API.</Description>
<IncludeSymbols>True</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<SignAssembly>False</SignAssembly>
Expand Down
2 changes: 1 addition & 1 deletion OpenMeteoTests/OpenMeteoTests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

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

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand Down
Loading