Skip to content

Commit 0a1bf15

Browse files
authored
[Backport 7.10] Update to .NET 5 SDK (#5099) (#5100)
* Update to .NET 5 SDK (#5099) * Update to .NET 5 SDK * Update InternalsVisibleTo as .NET 5 SDK now supports passing a key * Fix test after upgrading tests to net5.0 In .NET 5, System.Text.Json added support for creating types using a constructor with parameters. Despite the internal parameterless ctor being accessible, STJ is not using it. The solution for now seems to be to make this public. (cherry picked from commit fa2edcc)
1 parent 65bdbd7 commit 0a1bf15

28 files changed

+53
-76
lines changed

.ci/DockerFile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
ARG DOTNET_VERSION=3.0.100
2-
FROM mcr.microsoft.com/dotnet/core/sdk:${DOTNET_VERSION} AS elasticsearch-net-build
1+
ARG DOTNET_VERSION=5.0.100
2+
FROM mcr.microsoft.com/dotnet/sdk:${DOTNET_VERSION} AS elasticsearch-net-build
33

44
WORKDIR /sln
55

.ci/Jenkins.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">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.2</TargetFramework>
4+
<TargetFramework>net5.0</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

.ci/make.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ set -euo pipefail
2020
output_folder=".ci/output"
2121
OUTPUT_DIR="$repo/${output_folder}"
2222

23-
DOTNET_VERSION=${DOTNET_VERSION-3.0.100}
23+
DOTNET_VERSION=${DOTNET_VERSION-5.0.100}
2424

2525
echo -e "\033[34;1mINFO:\033[0m VERSION ${STACK_VERSION}\033[0m"
2626
echo -e "\033[34;1mINFO:\033[0m OUTPUT_DIR ${OUTPUT_DIR}\033[0m"

.ci/readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ $ ELASTICSEARCH_VERSION=8.0.0-SNAPSHOT ./.ci/run-tests
3030
|-------------------------|-------------|-------------|
3131
| `ELASTICSEARCH_VERSION` | `N/A` | The elasticsearch version to target
3232
| `TEST_SUITE` | `oss` | `oss` or `xpack` sets which test suite to run and which container to run against. |
33-
| `DOTNET_VERSION` | `3.0.100` | The .NET sdk version used to grab the proper container |
33+
| `DOTNET_VERSION` | `5.0.100` | The .NET sdk version used to grab the proper container |
3434

3535

3636
If you want to manually spin up elasticsearch for this tests and call the runner afterwards you can use

.ci/run-repository.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ param(
1414
$NODE_NAME,
1515

1616
[string]
17-
$DOTNET_VERSION = "3.0.100"
17+
$DOTNET_VERSION = "5.0.100"
1818
)
1919

2020
$ESC = [char]27

.ci/run-repository.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ script_path=$(dirname $(realpath -s $0))
99
source $script_path/functions/imports.sh
1010
set -euo pipefail
1111

12-
DOTNET_VERSION=${DOTNET_VERSION-3.0.100}
12+
DOTNET_VERSION=${DOTNET_VERSION-5.0.100}
1313
ELASTICSEARCH_URL=${ELASTICSEARCH_URL-"$elasticsearch_url"}
1414
elasticsearch_container=${elasticsearch_container-}
1515

.ci/run-tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ param (
88
$TEST_SUITE = "oss",
99

1010
[string]
11-
$DOTNET_VERSION = "3.0.100"
11+
$DOTNET_VERSION = "5.0.100"
1212
)
1313

1414
$ESC = [char]27

.ci/test-matrix.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ TEST_SUITE:
88
- xpack
99

1010
DOTNET_VERSION:
11-
- 3.0.100
11+
- 5.0.100
1212

1313
exclude: ~

Directory.Build.targets

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,4 @@
1616
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
1717
</PropertyGroup>
1818

19-
<Target Name="AssemblyInfos"
20-
BeforeTargets="CoreGenerateAssemblyInfo"
21-
Inputs="@InternalsVisibleTo" Outputs="%(InternalsVisibleTo.Identity)"
22-
Condition="$(IsPackable) == True"
23-
>
24-
<PropertyGroup>
25-
<ExposedAssembly>%(InternalsVisibleTo.Identity)</ExposedAssembly>
26-
<VersionNamespaced>$(ExposedAssembly.Replace("Nest", "Nest$(MajorVersion)").Replace("Elasticsearch.Net","Elasticsearch.Net$(MajorVersion)"))</VersionNamespaced>
27-
</PropertyGroup>
28-
<ItemGroup>
29-
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
30-
<_Parameter1>%(InternalsVisibleTo.Identity), PublicKey=$(ExposedPublicKey)</_Parameter1>
31-
</AssemblyAttribute>
32-
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
33-
<_Parameter1>$(VersionNamespaced), PublicKey=$(ExposedPublicKey)</_Parameter1>
34-
</AssemblyAttribute>
35-
</ItemGroup>
36-
</Target>
37-
3819
</Project>

appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ environment:
66
DOTNET_CLI_TELEMETRY_OPTOUT: true
77
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
88
install:
9-
- cmd: choco install dotnetcore-sdk --version 3.0.100
9+
- cmd: choco install dotnet-5.0-sdk --version 5.0.100
1010
build_script:
1111
- cmd: build.bat canary
1212

0 commit comments

Comments
 (0)