Skip to content

Commit cd01f93

Browse files
rajkumar-rangarajCodeBlanchKielek
authored
[repo] Replace .NET6 target with .NET9 (open-telemetry#5832)
Co-authored-by: Mikel Blanchard <[email protected]> Co-authored-by: Piotr Kiełkowicz <[email protected]>
1 parent 6e1b5ab commit cd01f93

File tree

19 files changed

+73
-53
lines changed

19 files changed

+73
-53
lines changed

.editorconfig

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ csharp_indent_labels = flush_left
4141

4242
# Modifier preferences
4343
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:suggestion
44-
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
44+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
4545

4646
# this. preferences
4747
dotnet_style_qualification_for_field = true:suggestion
@@ -53,8 +53,8 @@ dotnet_style_qualification_for_event = true:suggestion
5353
csharp_style_var_for_built_in_types = true:silent
5454
csharp_style_var_when_type_is_apparent = true:silent
5555
csharp_style_var_elsewhere = true:silent
56-
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
57-
dotnet_style_predefined_type_for_member_access = true:silent
56+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
57+
dotnet_style_predefined_type_for_member_access = true:suggestion
5858

5959
# name all constant fields using PascalCase
6060
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
@@ -75,28 +75,31 @@ dotnet_style_readonly_field = true:suggestion
7575
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
7676
dotnet_style_prefer_simplified_interpolation = true:suggestion
7777
dotnet_style_object_initializer = true:suggestion
78+
csharp_style_prefer_primary_constructors = false:none
7879

7980
# Expression-level preferences
8081
dotnet_style_object_initializer = true:suggestion
8182
dotnet_style_collection_initializer = true:suggestion
8283
dotnet_style_explicit_tuple_names = true:suggestion
8384
dotnet_style_coalesce_expression = true:suggestion
8485
dotnet_style_null_propagation = true:suggestion
85-
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
86+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
8687
dotnet_style_prefer_inferred_tuple_names = true:suggestion
8788
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
88-
dotnet_style_prefer_auto_properties = true:silent
89-
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
90-
dotnet_style_prefer_conditional_expression_over_return = true:silent
89+
dotnet_style_prefer_auto_properties = true:suggestion
90+
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
91+
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
9192
csharp_prefer_simple_default_expression = true:suggestion
93+
csharp_style_unused_value_expression_statement_preference = discard_variable:none
9294

9395
# Expression-bodied members
94-
csharp_style_expression_bodied_methods = false:silent
95-
csharp_style_expression_bodied_constructors = false:silent
96-
csharp_style_expression_bodied_operators = false:silent
97-
csharp_style_expression_bodied_properties = true:silent
98-
csharp_style_expression_bodied_indexers = true:silent
99-
csharp_style_expression_bodied_accessors = true:silent
96+
csharp_style_expression_bodied_methods = true:suggestion
97+
dotnet_diagnostic.IDE0022.severity = suggestion # dotnet format doesn't respect the suggestion in the line above
98+
csharp_style_expression_bodied_constructors = false:warning
99+
csharp_style_expression_bodied_operators = true:suggestion
100+
csharp_style_expression_bodied_properties = true:suggestion
101+
csharp_style_expression_bodied_indexers = true:suggestion
102+
csharp_style_expression_bodied_accessors = true:suggestion
100103

101104
# Pattern matching
102105
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
@@ -113,6 +116,7 @@ csharp_style_prefer_range_operator = false:none
113116
csharp_style_pattern_local_over_anonymous_function = true:suggestion
114117
csharp_style_deconstructed_variable_declaration = true:suggestion
115118
csharp_style_namespace_declarations = file_scoped:warning
119+
dotnet_style_namespace_match_folder = false:none
116120

117121
# Space preferences
118122
csharp_space_after_cast = false
@@ -128,10 +132,10 @@ csharp_space_between_method_declaration_parameter_list_parentheses = false
128132
csharp_space_between_parentheses = false
129133

130134
# Parentheses preferences
131-
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
132-
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
133-
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
134-
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
135+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
136+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
137+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
138+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion
135139

136140
# Code analyzers
137141
# CA1031: Do not catch general exception types

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ body:
4848
- type: input
4949
attributes:
5050
label: Runtime Version
51-
description: What .NET runtime version did you use? (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can find this information from the `*.csproj` file)
51+
description: What .NET runtime version did you use? (e.g. `net462`, `net48`, `net8.0`, etc. You can find this information from the `*.csproj` file)
5252
validations:
5353
required: true
5454

.github/workflows/Component.BuildTest.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ on:
2424
required: false
2525
type: string
2626
tfm-list:
27-
default: '[ "net462", "net6.0", "net8.0" ]'
27+
default: '[ "net462", "net8.0", "net9.0" ]'
2828
required: false
2929
type: string
3030

@@ -42,7 +42,7 @@ jobs:
4242
- os: otel-linux-arm64
4343
version: net462
4444
- os: otel-linux-arm64
45-
version: net6.0
45+
version: net8.0
4646

4747
runs-on: ${{ matrix.os }}
4848
steps:

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ jobs:
111111
strategy:
112112
fail-fast: false
113113
matrix:
114-
version: [ net6.0, net8.0 ]
114+
version: [ net8.0, net9.0 ]
115115
steps:
116116
- uses: actions/checkout@v4
117117
- name: Run OTLP Exporter docker compose
@@ -129,7 +129,7 @@ jobs:
129129
strategy:
130130
fail-fast: false
131131
matrix:
132-
version: [ net6.0, net8.0 ]
132+
version: [ net8.0, net9.0 ]
133133
steps:
134134
- uses: actions/checkout@v4
135135
- name: Run W3C Trace Context docker compose

.github/workflows/docfx.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313
- name: check out code
1414
uses: actions/checkout@v4
1515

16+
- name: Setup dotnet
17+
uses: actions/setup-dotnet@v4
18+
1619
- name: install docfx
1720
run: dotnet tool install -g docfx
1821

.github/workflows/verifyaotcompat.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
1313
matrix:
1414
os: [ ubuntu-latest, windows-latest ]
15-
version: [ net8.0 ]
15+
version: [ net8.0, net9.0 ]
1616

1717
runs-on: ${{ matrix.os }}
1818
steps:

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ You can contribute to this project from a Windows, macOS or Linux machine.
4444
On all platforms, the minimum requirements are:
4545

4646
* Git client and command line tools.
47-
* .NET 8.0
47+
* .NET 9.0
4848

4949
### Linux or MacOS
5050

Directory.Packages.props

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@
9797
<PackageVersion Include="xunit.runner.visualstudio" Version="[2.8.2,3.0)" />
9898
</ItemGroup>
9999

100-
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
101-
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="6.0.33" />
102-
</ItemGroup>
103100
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
104101
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.8" />
105102
</ItemGroup>
103+
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
104+
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="9.0.0-rc.1.24452.1" />
105+
</ItemGroup>
106106
</Project>

OpenTelemetry.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7CB2F02E
3131
build\debug.snk = build\debug.snk
3232
Directory.Packages.props = Directory.Packages.props
3333
build\docfx.cmd = build\docfx.cmd
34-
build\docker-compose.net6.0.yml = build\docker-compose.net6.0.yml
3534
build\docker-compose.net8.0.yml = build\docker-compose.net8.0.yml
35+
build\docker-compose.net9.0.yml = build\docker-compose.net9.0.yml
3636
build\GlobalAttrExclusions.txt = build\GlobalAttrExclusions.txt
3737
build\opentelemetry-icon-color.png = build\opentelemetry-icon-color.png
3838
build\OpenTelemetry.prod.loose.ruleset = build\OpenTelemetry.prod.loose.ruleset

build/Common.nonprod.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</PropertyGroup>
99

1010
<PropertyGroup>
11-
<DefaultTargetFrameworkForExampleApps>net8.0</DefaultTargetFrameworkForExampleApps>
11+
<DefaultTargetFrameworkForExampleApps>net9.0</DefaultTargetFrameworkForExampleApps>
1212
</PropertyGroup>
1313

1414
<PropertyGroup Condition="$(MSBuildProjectName.EndsWith('.Tests'))">

0 commit comments

Comments
 (0)