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

Update to .NET 8 SDK #2304

Merged
merged 17 commits into from
Mar 4, 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/.github.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>False</IsPackable>
</PropertyGroup>

Expand Down
32 changes: 14 additions & 18 deletions .github/workflows/bootstrap/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ inputs:
required: false
default: "false"
azure:
description: 'Install azure functions tool chain ("true" or "false")'
required: false
default: "false"
description: 'Install azure functions tool chain ("true" or "false")'
required: false
default: "false"
outputs:
agent-version:
description: "The current agent version number"
Expand All @@ -35,17 +35,14 @@ runs:
restore-keys: |
${{ runner.os }}-nuget

# Install .NET version as mandated by global.json
#- uses: actions/setup-dotnet@v4
# with:
# global-json-file: global.json
# Install latest .NET SDKs for supported LTS versions
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.x
8.0.x

- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
6.0.100
7.0.100
- id: dotnet
shell: bash
run: |
Expand All @@ -56,14 +53,13 @@ runs:
echo "AGENT_VERSION=${AGENT_VERSION}" >> $GITHUB_ENV
echo "agent-version=${AGENT_VERSION}" >> $GITHUB_OUTPUT
echo "major-version=$(echo ${AGENT_VERSION} | cut -d"." -f1)" >> $GITHUB_OUTPUT



# Setup git config
- uses: elastic/apm-pipeline-library/.github/actions/setup-git@current

# install common dependencies
- name: Install common dependencies
uses: ./.github/workflows/install-dependencies
with:
rust: '${{ inputs.rust }}'
azure: '${{ inputs.azure }}'
rust: '${{ inputs.rust }}'
azure: '${{ inputs.azure }}'
2 changes: 1 addition & 1 deletion .github/workflows/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ inputs:
framework:
description: 'test filter to select tests from solution projects'
required: false
default: 'net7.0'
default: 'net8.0'

runs:
using: "composite"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<LangVersion>11</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<IsTestProject>false</IsTestProject>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<IsTestProject>false</IsTestProject>
Expand Down
6 changes: 3 additions & 3 deletions build/build.fsproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<OutputType>Exe</OutputType>
<NoWarn>$(NoWarn);NU1701</NoWarn>
<IsPackable>false</IsPackable>
Expand Down Expand Up @@ -35,10 +35,10 @@
<PackageReference Include="Fake.IO.Zip" Version="5.20.4" />
<PackageReference Include="Fake.Tools.Git" Version="5.20.4" />

<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />

<PackageReference Include="Octokit" Version="0.32.0" />
<PackageReference Include="Proc" Version="0.6.1" />
<PackageReference Include="Proc" Version="0.6.2" />
</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion build/scripts/Tooling.fs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ open ProcNet.Std
module Tooling =
type ExecResult = { ExitCode: int; Output: LineOut seq;}

let private defaultTimeout = TimeSpan.FromMinutes 5.
let private defaultTimeout = TimeSpan.FromMinutes 10.

type NoopWriter () =
interface IConsoleOutWriter with
Expand Down
2 changes: 1 addition & 1 deletion docs/docs.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>False</IsPackable>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "7.0.100",
"version": "8.0.100",
"rollForward": "latestFeature",
"allowPrerelease": false
}
Expand Down
2 changes: 1 addition & 1 deletion sample/ApiSamples/ApiSamples.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net462;net7.0</TargetFrameworks>
<TargetFrameworks>net8.0</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
Expand Down
13 changes: 8 additions & 5 deletions sample/ElasticsearchSample/ElasticsearchSample.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<LangVersion>latest</LangVersion>
<TargetFramework>net8.0</TargetFramework>
<UserSecretsId>bfb02fcb-6aa5-47e7-9c9e-5fb512708949</UserSecretsId>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="3.1.3" />
<PackageReference Include="NEST" Version="7.11.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="8.0.0" />
<PackageReference Include="NEST" Version="7.17.5" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="$(SrcInstrumentations)\Elastic.Apm.Elasticsearch\Elastic.Apm.Elasticsearch.csproj" />
</ItemGroup>

</Project>
5 changes: 2 additions & 3 deletions sample/HttpListenerSample/HttpListenerSample.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@

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

<ItemGroup>
<ProjectReference Include="..\..\src\Elastic.Apm\Elastic.Apm.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>

</Project>
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>net8.0</TargetFrameworks>
<OutputType>Exe</OutputType>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
Expand All @@ -13,9 +13,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.1" />
<PackageReference Include="Testcontainers" Version="3.4.0" />
<PackageReference Include="Testcontainers.MsSql" Version="3.4.0" />
<PackageReference Include="Microsoft.Data.SqlClient" Version="5.1.5" />
<PackageReference Include="Testcontainers" Version="3.7.0" />
<PackageReference Include="Testcontainers.MsSql" Version="3.7.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="StackExchange.Redis" Version="2.0.495" />
<PackageReference Include="Testcontainers.Redis" Version="3.4.0" />
<PackageReference Include="StackExchange.Redis" Version="2.7.20" />
<PackageReference Include="Testcontainers.Redis" Version="3.7.0" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions sample/WebApiExample/WebApiExample.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

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

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="7.0.5"/>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0"/>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.2"/>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0"/>
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,12 @@ internal static void UpdateServiceInformation(Service service)
var aspNetCoreVersion = GetAssemblyVersion("Microsoft.AspNetCore");
var hostingVersion = GetAssemblyVersion("Microsoft.Extensions.Hosting");
var version = aspNetCoreVersion ?? hostingVersion ?? "n/a";
var isCore = false;

service.Framework = new Framework { Name = aspNetCoreVersion != null ? "ASP.NET Core" : ".NET Core", Version = version };
if (aspNetCoreVersion is null && hostingVersion is not null && Version.TryParse(hostingVersion, out var v))
isCore = v.Major < 5;

service.Framework = new Framework { Name = aspNetCoreVersion != null ? "ASP.NET Core" : isCore ? ".NET Core" : ".NET", Version = version };
service.Language = new Language { Name = "C#" }; //TODO
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ public static partial class DuckType
private static readonly PropertyInfo DuckTypeInstancePropertyInfo = typeof(IDuckType).GetProperty(nameof(IDuckType.Instance));

[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private static readonly MethodInfo _methodBuilderGetToken =
typeof(MethodBuilder).GetMethod("GetToken", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
private static readonly MethodInfo _methodBuilderGetToken = typeof(MethodBuilder)
.GetMethod("GetToken", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)
?? typeof(MethodBuilder).GetProperty("MetadataToken", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance)?.GetMethod;

[DebuggerBrowsable(DebuggerBrowsableState.Never)]
private static readonly Dictionary<Assembly, ModuleBuilder> ActiveBuilders = new Dictionary<Assembly, ModuleBuilder>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public InstrumentMicrosoftDataSqliteAttribute()
Assembly = "Microsoft.Data.Sqlite";
Type = "Microsoft.Data.Sqlite.SqliteCommand";
MinimumVersion = "2.0.0";
MaximumVersion = "7.*.*";
MaximumVersion = "8.*.*";
Group = "SqliteCommand";
}
}
Expand Down
Loading
Loading