diff --git a/CMakeLists.txt b/CMakeLists.txt
index 715ed9c1f5..d003603a83 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -221,6 +221,11 @@ message(STATUS "CPLEX support: ${USE_CPLEX}")
option(USE_XPRESS "Use the XPRESS solver" OFF)
message(STATUS "XPRESS support: ${USE_XPRESS}")
+if(BUILD_DOTNET)
+ option(UNIVERSAL_DOTNET_PACKAGE "Build a .Net multi OS Package" OFF)
+ message(STATUS ".Net: Create multiple os package: ${UNIVERSAL_DOTNET_PACKAGE}")
+endif()
+
if(BUILD_JAVA)
option(BUILD_FAT_JAR "Create single .jar with all dependencies (including native binaries)" OFF)
message(STATUS "Java: Build single fat .jar: ${BUILD_FAT_JAR}")
diff --git a/cmake/dotnet.cmake b/cmake/dotnet.cmake
index 1f34a0e917..671548c532 100644
--- a/cmake/dotnet.cmake
+++ b/cmake/dotnet.cmake
@@ -213,10 +213,17 @@ add_custom_target(dotnet_native_package
####################
## .Net Package ##
####################
-configure_file(
- ${PROJECT_SOURCE_DIR}/ortools/dotnet/${DOTNET_PROJECT}.csproj.in
- ${DOTNET_PROJECT_DIR}/${DOTNET_PROJECT}.csproj.in
- @ONLY)
+if(UNIVERSAL_DOTNET_PACKAGE)
+ configure_file(
+ ${PROJECT_SOURCE_DIR}/ortools/dotnet/${DOTNET_PROJECT}-full.csproj.in
+ ${DOTNET_PROJECT_DIR}/${DOTNET_PROJECT}.csproj.in
+ @ONLY)
+else()
+ configure_file(
+ ${PROJECT_SOURCE_DIR}/ortools/dotnet/${DOTNET_PROJECT}-local.csproj.in
+ ${DOTNET_PROJECT_DIR}/${DOTNET_PROJECT}.csproj.in
+ @ONLY)
+endif()
add_custom_command(
OUTPUT ${DOTNET_PROJECT_DIR}/${DOTNET_PROJECT}.csproj
diff --git a/ortools/dotnet/Google.OrTools.csproj.in b/ortools/dotnet/Google.OrTools-full.csproj.in
similarity index 90%
rename from ortools/dotnet/Google.OrTools.csproj.in
rename to ortools/dotnet/Google.OrTools-full.csproj.in
index 0a49ab165c..6312f108d3 100644
--- a/ortools/dotnet/Google.OrTools.csproj.in
+++ b/ortools/dotnet/Google.OrTools-full.csproj.in
@@ -96,14 +96,14 @@
+
-
-
+
@@ -170,12 +170,9 @@
-
-
-
-
-
-
+
+
+
diff --git a/ortools/dotnet/Google.OrTools-local.csproj.in b/ortools/dotnet/Google.OrTools-local.csproj.in
new file mode 100644
index 0000000000..6aa98980da
--- /dev/null
+++ b/ortools/dotnet/Google.OrTools-local.csproj.in
@@ -0,0 +1,170 @@
+
+
+ Library
+ 9.0
+ netcoreapp3.1;net6.0
+ @RUNTIME_IDENTIFIER@
+ true
+ @DOTNET_PROJECT@
+ @PROJECT_VERSION@
+
+
+ .NET wrapper for the Operations Research Tools project
+
+
+ @DOTNET_PROJECT@ v@PROJECT_VERSION@
+ @DOTNET_PROJECT@
+ true
+ snupkg
+
+
+ ../or-tools.snk
+ true
+ false
+ false
+
+
+
+
+ netcoreapp3.1;net6.0
+
+
+ netcoreapp3.1;net6.0;net452
+
+
+
+
+ algorithms/%(Filename)%(Extension)
+
+
+
+ bop/%(Filename)%(Extension)
+
+
+
+ graph/%(Filename)%(Extension)
+
+
+
+ graph/%(Filename)%(Extension)
+
+
+ graph/%(Filename)%(Extension)
+
+
+
+ linear_solver/%(Filename)%(Extension)
+
+
+ linear_solver/%(Filename)%(Extension)
+
+
+
+ constraint_solver/%(Filename)%(Extension)
+
+
+ constraint_solver/%(Filename)%(Extension)
+
+
+
+ init/%(Filename)%(Extension)
+
+
+
+ sat/%(Filename)%(Extension)
+
+
+
+ sat/%(Filename)%(Extension)
+
+
+ sat/%(Filename)%(Extension)
+
+
+
+ util/%(Filename)%(Extension)
+
+
+ util/%(Filename)%(Extension)
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ content/algorithms
+ true
+ PreserveNewest
+
+
+ content/bop
+ true
+ PreserveNewest
+
+
+ content/constraint_solver
+ true
+ PreserveNewest
+
+
+ content/data
+ true
+ PreserveNewest
+
+
+ content/glop
+ true
+ PreserveNewest
+
+
+ content/graph
+ true
+ PreserveNewest
+
+
+ content/linear_solver
+ true
+ PreserveNewest
+
+
+ content/pdlp
+ true
+ PreserveNewest
+
+
+ content/sat
+ true
+ PreserveNewest
+
+
+ content/util
+ true
+ PreserveNewest
+
+
+
+
+
+
+
+
+
+ @DOTNET_PACKAGES_DIR@;$(RestoreSources);https://api.nuget.org/v3/index.json
+
+
+
+
+
+
+