Skip to content

Commit 8ae6f8b

Browse files
committed
dotnet: migrate from .Net 6.0 to 8.0 as default
1 parent f4f3974 commit 8ae6f8b

File tree

9 files changed

+39
-39
lines changed

9 files changed

+39
-39
lines changed

cmake/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ cmake -S. -Bbuild -LH
246246
| `USE_DOTNET_48` | OFF | Enable .Net Framework 4.8 support<br>Only available if `BUILD_DOTNET=ON` |
247247
| `USE_DOTNET_STD_21` | OFF | Enable .Net Standard 2.1 support<br>Only available if `BUILD_DOTNET=ON` and not targeting arm64 platform |
248248
| `USE_DOTNET_CORE_31` | OFF | Enable .Net Core 3.1 LTS support<br>Only available if `BUILD_DOTNET=ON` and not targeting arm64 platform |
249-
| `USE_DOTNET_6` | ON | Enable .Net 6 LTS support<br>Only available if `BUILD_DOTNET=ON` |
249+
| `USE_DOTNET_6` | OFF | Enable .Net 6 LTS support<br>Only available if `BUILD_DOTNET=ON` |
250250
| `USE_DOTNET_7` | OFF | Enable .Net 7 support<br>Only available if `BUILD_DOTNET=ON` |
251-
| `USE_DOTNET_8` | OFF | Enable .Net 8 LTS support<br>Only available if `BUILD_DOTNET=ON` |
251+
| `USE_DOTNET_8` | ON | Enable .Net 8 LTS support<br>Only available if `BUILD_DOTNET=ON` |
252252
| `USE_DOTNET_9` | OFF | Enable .Net 9 support<br>Only available if `BUILD_DOTNET=ON` |
253253
| `UNIVERSAL_DOTNET_PACKAGE` | OFF | Build a multi platform package (i.e. `Google.OrTools` will depends on all runtime packages)<br>Only available if `BUILD_DOTNET=ON` |
254254
| | | |

cmake/samples/dotnet/Google.Sample.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<LangVersion>8.0</LangVersion>
5-
<TargetFramework>net6.0</TargetFramework>
5+
<TargetFramework>net8.0</TargetFramework>
66
<!-- see https://github.com/dotnet/docs/issues/12237 -->
77
<RollForward>LatestMajor</RollForward>
88
<AssemblyName>Google.Sample</AssemblyName>

examples/dotnet/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
The following examples showcase how to use OrTools.<br>
44
The project solution has examples for C#.
55

6-
We recommend that all projects you create target `net6.0`,
6+
We recommend that all projects you create target `net8.0`,
77
as this allows you to compile for various frameworks and
88
keep up-to-date with the latest frameworks.
99

makefiles/Makefile.cpp.mk

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ USE_SCIP ?= ON
4141
USE_CPLEX ?= OFF
4242

4343
USE_DOTNET_CORE_31 ?= OFF
44-
USE_DOTNET_6 ?= ON
44+
USE_DOTNET_8 ?= ON
4545
BUILD_VENV ?= ON
4646
JOBS ?= 4
4747

@@ -72,7 +72,7 @@ third_party:
7272
-DUSE_SCIP=$(USE_SCIP) \
7373
-DUSE_CPLEX=$(USE_CPLEX) \
7474
-DUSE_DOTNET_CORE_31=$(USE_DOTNET_CORE_31) \
75-
-DUSE_DOTNET_6=$(USE_DOTNET_6) \
75+
-DUSE_DOTNET_8=$(USE_DOTNET_8) \
7676
-DBUILD_VENV=$(BUILD_VENV) \
7777
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \
7878
-DCMAKE_INSTALL_PREFIX=$(INSTALL_DIR) \

makefiles/Makefile.dotnet.mk

+25-25
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ $(TEMP_DOTNET_DIR)/$1/%/%.csproj: \
110110
> $(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj
111111
$(SED) -i -e 's/@DOTNET_SAMPLE_LANG@/9.0/' \
112112
$(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj
113-
ifeq ($(USE_DOTNET_6)_$(USE_DOTNET_CORE_31),ON_ON)
114-
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFrameworks>netcoreapp3.1;net6.0<\/TargetFrameworks>/' \
113+
ifeq ($(USE_DOTNET_8)_$(USE_DOTNET_CORE_31),ON_ON)
114+
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFrameworks>netcoreapp3.1;net8.0<\/TargetFrameworks>/' \
115115
$(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj
116116
else
117-
ifeq ($(USE_DOTNET_6),ON)
118-
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFramework>net6.0<\/TargetFramework>/' \
117+
ifeq ($(USE_DOTNET_8),ON)
118+
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFramework>net8.0<\/TargetFramework>/' \
119119
$(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj
120120
else
121121
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFramework>netcoreapp3.1<\/TargetFramework>/' \
@@ -151,9 +151,9 @@ rdotnet_%: \
151151
$(TEMP_DOTNET_DIR)/$1/%/%.csproj \
152152
$(TEMP_DOTNET_DIR)/$1/%/%.cs \
153153
FORCE
154-
ifeq ($(USE_DOTNET_6),ON)
155-
cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework net6.0 -c Release
156-
cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" run --no-build --framework net6.0 -c Release $(ARGS)
154+
ifeq ($(USE_DOTNET_8),ON)
155+
cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework net8.0 -c Release
156+
cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" run --no-build --framework net8.0 -c Release $(ARGS)
157157
endif
158158
ifeq ($(USE_DOTNET_CORE_31),ON)
159159
cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework netcoreapp3.1 -c Release
@@ -184,12 +184,12 @@ $(TEMP_DOTNET_DIR)/$1/%/%.csproj: \
184184
> $(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj
185185
$(SED) -i -e 's/@DOTNET_SAMPLE_LANG@/9.0/' \
186186
$(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj
187-
ifeq ($(USE_DOTNET_6)_$(USE_DOTNET_CORE_31),ON_ON)
188-
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFrameworks>netcoreapp3.1;net6.0<\/TargetFrameworks>/' \
187+
ifeq ($(USE_DOTNET_8)_$(USE_DOTNET_CORE_31),ON_ON)
188+
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFrameworks>netcoreapp3.1;net8.0<\/TargetFrameworks>/' \
189189
$(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj
190190
else
191-
ifeq ($(USE_DOTNET_6),ON)
192-
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFramework>net6.0<\/TargetFramework>/' \
191+
ifeq ($(USE_DOTNET_8),ON)
192+
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFramework>net8.0<\/TargetFramework>/' \
193193
$(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj
194194
else
195195
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFramework>netcoreapp3.1<\/TargetFramework>/' \
@@ -225,9 +225,9 @@ rdotnet_%: \
225225
$(TEMP_DOTNET_DIR)/$1/%/%.csproj \
226226
$(TEMP_DOTNET_DIR)/$1/%/%.cs \
227227
FORCE
228-
ifeq ($(USE_DOTNET_6),ON)
229-
cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework net6.0 -c Release
230-
cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" run --no-build --framework net6.0 -c Release $(ARGS)
228+
ifeq ($(USE_DOTNET_8),ON)
229+
cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework net8.0 -c Release
230+
cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" run --no-build --framework net8.0 -c Release $(ARGS)
231231
endif
232232
ifeq ($(USE_DOTNET_CORE_31),ON)
233233
cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework netcoreapp3.1 -c Release
@@ -255,12 +255,12 @@ $(TEMP_DOTNET_DIR)/$1/%/%.csproj: \
255255
> $(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj
256256
$(SED) -i -e 's/@DOTNET_LANG@/9.0/' \
257257
$(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj
258-
ifeq ($(USE_DOTNET_6)_$(USE_DOTNET_CORE_31),ON_ON)
259-
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFrameworks>netcoreapp3.1;net6.0<\/TargetFrameworks>/' \
258+
ifeq ($(USE_DOTNET_8)_$(USE_DOTNET_CORE_31),ON_ON)
259+
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFrameworks>netcoreapp3.1;net8.0<\/TargetFrameworks>/' \
260260
$(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj
261261
else
262-
ifeq ($(USE_DOTNET_6),ON)
263-
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFramework>net6.0<\/TargetFramework>/' \
262+
ifeq ($(USE_DOTNET_8),ON)
263+
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFramework>net8.0<\/TargetFramework>/' \
264264
$(TEMP_DOTNET_DIR)$S$1$S$$*$S$$*.csproj
265265
else
266266
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFramework>netcoreapp3.1<\/TargetFramework>/' \
@@ -296,9 +296,9 @@ rdotnet_%: \
296296
$(TEMP_DOTNET_DIR)/$1/%/%.csproj \
297297
$(TEMP_DOTNET_DIR)/$1/%/%.cs \
298298
FORCE
299-
ifeq ($(USE_DOTNET_6),ON)
300-
cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework net6.0 -c Release
301-
cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" test --no-build --framework net6.0 -c Release $(ARGS)
299+
ifeq ($(USE_DOTNET_8),ON)
300+
cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework net8.0 -c Release
301+
cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" test --no-build --framework net8.0 -c Release $(ARGS)
302302
endif
303303
ifeq ($(USE_DOTNET_CORE_31),ON)
304304
cd $(TEMP_DOTNET_DIR)$S$1$S$$* && "$(DOTNET_BIN)" build --framework netcoreapp3.1 -c Release
@@ -659,7 +659,7 @@ $(TEMP_DOTNET_DIR)/ortools_examples/examples/dotnet/%.csproj: \
659659
$(TEMP_DOTNET_DIR)$Sortools_examples$Sexamples$Sdotnet$S$$*.csproj
660660
$(SED) -i -e 's/@DOTNET_SAMPLE_LANG@/9.0/' \
661661
$(TEMP_DOTNET_DIR)$Sortools_examples$Sexamples$Sdotnet$S$$*.csproj
662-
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFrameworks>netcoreapp3.1;net6.0<\/TargetFrameworks>/' \
662+
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFrameworks>netcoreapp3.1;net8.0<\/TargetFrameworks>/' \
663663
$(TEMP_DOTNET_DIR)$Sortools_examples$Sexamples$Sdotnet$S$$*.csproj
664664
$(SED) -i -e 's/@DOTNET_PROJECT@/$(DOTNET_ORTOOLS_ASSEMBLY_NAME)/' \
665665
$(TEMP_DOTNET_DIR)$Sortools_examples$Sexamples$Sdotnet$S$$*.csproj
@@ -694,7 +694,7 @@ $(TEMP_DOTNET_DIR)/ortools_examples/examples/dotnet/%.csproj: \
694694
$(TEMP_DOTNET_DIR)$Sortools_examples$Sexamples$Sdotnet$S$$*.csproj
695695
$(SED) -i -e 's/@DOTNET_SAMPLE_LANG@/9.0/' \
696696
$(TEMP_DOTNET_DIR)$Sortools_examples$Sexamples$Sdotnet$S$$*.csproj
697-
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFrameworks>netcoreapp3.1;net6.0<\/TargetFrameworks>/' \
697+
$(SED) -i -e 's/@DOTNET_TFM@/<TargetFrameworks>netcoreapp3.1;net8.0<\/TargetFrameworks>/' \
698698
$(TEMP_DOTNET_DIR)$Sortools_examples$Sexamples$Sdotnet$S$$*.csproj
699699
$(SED) -i -e 's/@DOTNET_PROJECT@/$(DOTNET_ORTOOLS_ASSEMBLY_NAME)/' \
700700
$(TEMP_DOTNET_DIR)$Sortools_examples$Sexamples$Sdotnet$S$$*.csproj
@@ -741,7 +741,7 @@ endif
741741
######################
742742
.PHONY: nuget_archive # Build .Net "Google.OrTools" Nuget Package
743743
nuget_archive: dotnet | $(TEMP_DOTNET_DIR)
744-
"$(DOTNET_BIN)" publish $(DOTNET_BUILD_ARGS) --no-build --no-dependencies --no-restore -f net6.0 \
744+
"$(DOTNET_BIN)" publish $(DOTNET_BUILD_ARGS) --no-build --no-dependencies --no-restore -f net8.0 \
745745
-o "..$S..$S..$S$(TEMP_DOTNET_DIR)" \
746746
ortools$Sdotnet$S$(DOTNET_ORTOOLS_ASSEMBLY_NAME)$S$(DOTNET_ORTOOLS_ASSEMBLY_NAME).csproj
747747
"$(DOTNET_BIN)" pack -c Release $(NUGET_PACK_ARGS) --no-build \
@@ -750,7 +750,7 @@ nuget_archive: dotnet | $(TEMP_DOTNET_DIR)
750750

751751
.PHONY: nuget_upload # Upload Nuget Package
752752
nuget_upload: nuget_archive
753-
@echo Uploading Nuget package for "netcoreapp3.1;net6.0".
753+
@echo Uploading Nuget package for "netcoreapp3.1;net8.0".
754754
$(warning Not Implemented)
755755

756756
endif # HAS_DOTNET=ON

ortools/dotnet/CreateSigningKey/CreateSigningKey.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55
<Version>1.0.0</Version>
66

77
<!-- Nuget Properties -->

ortools/dotnet/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ and osx-x64) nuget package using `dotnet` and few `.csproj`.
2525

2626
## Requirement
2727

28-
The library is compiled against `netcoreapp3.1` and `net6.0`, so you'll only
28+
The library is compiled against `netcoreapp3.1` and `net8.0`, so you'll only
2929
need:
3030

3131
* .Net Core 3.1 LTS SDK
32-
* .Net 6.0 LTS SDK
32+
* .Net 8.0 LTS SDK
3333

3434
note: We won't/can't rely on VS 2022 since we want a portable cross-platform
3535
[`dotnet/cli`](https://github.com/dotnet/cli) pipeline.
@@ -230,7 +230,7 @@ defined) should have this layout:
230230
\- Google.OrTools.dll
231231
...
232232
```
233-
note: `{framework}` could be `netcoreapp3.1` or/and `net6.0`
233+
note: `{framework}` could be `netcoreapp3.1` or/and `net8.0`
234234

235235
### Complete Google.OrTools Package
236236

@@ -278,7 +278,7 @@ dotnet pack <build_dir>/dotnet/Google.OrTools
278278

279279
## Examples
280280

281-
The Test projects show examples of building applications with `net6.0`.
281+
The Test projects show examples of building applications with `net8.0`.
282282

283283
The F# example folder shows how to compile against the typical .NET Framework
284284
installed on machine.

tools/Makefile.dotnet.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ endif #ifeq SOURCE exist
8989
build: $(SOURCE)
9090
"$(DOTNET_BIN)" build examples/$(SOURCE_NAME)/project.csproj
9191
run: build
92-
"$(DOTNET_BIN)" run --no-build --framework net6.0 --project examples/$(SOURCE_NAME)/project.csproj -- $(ARGS)
92+
"$(DOTNET_BIN)" run --no-build --framework net8.0 --project examples/$(SOURCE_NAME)/project.csproj -- $(ARGS)
9393

9494
endif #ifeq SOURCE
9595

tools/README.cc.java.dotnet

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,12 +101,12 @@ make run SOURCE=examples/dotnet/Vrp/Vrp.cs
101101

102102
```shell
103103
dotnet build examples/dotnet/Vrp/Vrp.csproj
104-
dotnet run --no-build --framework net6.0 --project examples/dotnet/Vrp/Vrp.csproj
104+
dotnet run --no-build --framework net8.0 --project examples/dotnet/Vrp/Vrp.csproj
105105
```
106106

107107
- on Windows:
108108

109109
```shell
110110
dotnet build examples\dotnet\Vrp\Vrp.csproj
111-
dotnet run --no-build --framework net6.0 --project examples\dotnet\Vrp\Vrp.csproj
111+
dotnet run --no-build --framework net8.0 --project examples\dotnet\Vrp\Vrp.csproj
112112
```

0 commit comments

Comments
 (0)