diff --git a/csharp/ApiDocs/ApiDocs.csproj b/csharp/ApiDocs/ApiDocs.csproj index 773f073a6a2c9..6081c444ba1af 100644 --- a/csharp/ApiDocs/ApiDocs.csproj +++ b/csharp/ApiDocs/ApiDocs.csproj @@ -1,7 +1,7 @@  - net7.0 + net6.0 enable true diff --git a/csharp/ApiDocs/docfx.json b/csharp/ApiDocs/docfx.json index 45be1a044e718..c3ed49b563019 100644 --- a/csharp/ApiDocs/docfx.json +++ b/csharp/ApiDocs/docfx.json @@ -14,7 +14,7 @@ "disableDefaultFilter": false, "properties": { "AllowUnsafeBlocks": true, - "TargetFramework" : "net7.0", + "TargetFramework" : "net6.0", "Nullable" : "enable", "LangVersion": "8.0", "EnableTrainingApis": "true" diff --git a/csharp/readme.md b/csharp/readme.md index e80a405a826b0..74572b5f17505 100644 --- a/csharp/readme.md +++ b/csharp/readme.md @@ -101,8 +101,8 @@ For example, to build a CUDA GPU package, just run: --cudnn_home=/usr \ --build_nuget \ --msbuild_extra_options \ - /p:SelectedTargets=Net7 \ - /p:Net6Targets=net7.0 \ + /p:SelectedTargets=Net6 \ + /p:Net6Targets=net6.0 \ /p:TargetFrameworks=netstandard2.0 \ /p:IsLinuxBuild=true ``` diff --git a/csharp/sample/InferenceSample/Microsoft.ML.OnnxRuntime.InferenceSample.Maui/Microsoft.ML.OnnxRuntime.InferenceSample.Maui.csproj b/csharp/sample/InferenceSample/Microsoft.ML.OnnxRuntime.InferenceSample.Maui/Microsoft.ML.OnnxRuntime.InferenceSample.Maui.csproj index 893cb270d0ae7..30952cb314546 100644 --- a/csharp/sample/InferenceSample/Microsoft.ML.OnnxRuntime.InferenceSample.Maui/Microsoft.ML.OnnxRuntime.InferenceSample.Maui.csproj +++ b/csharp/sample/InferenceSample/Microsoft.ML.OnnxRuntime.InferenceSample.Maui/Microsoft.ML.OnnxRuntime.InferenceSample.Maui.csproj @@ -1,9 +1,9 @@  - - net7.0-android;net7.0-ios - $(TargetFrameworks);net7.0-windows10.0.19041.0 + + net6.0-android;net6.0-ios + $(TargetFrameworks);net6.0-windows10.0.19041.0 Exe Microsoft.ML.OnnxRuntime.InferenceSample.Maui true @@ -36,7 +36,7 @@ - diff --git a/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/Microsoft.ML.OnnxRuntime.Tests.Common.csproj b/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/Microsoft.ML.OnnxRuntime.Tests.Common.csproj index 8dad819950387..ab27d62c3bf3b 100644 --- a/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/Microsoft.ML.OnnxRuntime.Tests.Common.csproj +++ b/csharp/test/Microsoft.ML.OnnxRuntime.Tests.Common/Microsoft.ML.OnnxRuntime.Tests.Common.csproj @@ -2,8 +2,8 @@ - netstandard2.0;net7.0 + net6.0 is required for linux. --> + netstandard2.0;net6.0 false $(ProjectDir)..\.. AnyCPU diff --git a/csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp.csproj b/csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp.csproj index 5576f3eeb5254..9886f050fbd6b 100644 --- a/csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp.csproj +++ b/csharp/test/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp/Microsoft.ML.OnnxRuntime.Tests.NetCoreApp.csproj @@ -1,7 +1,7 @@  - net7.0 + net6.0 false $(ProjectDir)..\.. AnyCPU;x86 diff --git a/tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml b/tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml index c0270a70de6b7..a124cb3c1ac77 100644 --- a/tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml +++ b/tools/ci_build/github/azure-pipelines/c-api-noopenmp-packaging-pipelines.yml @@ -594,8 +594,8 @@ stages: - job: workspace: clean: all - # we need to use the 2022 pool to create the nuget package with both pre-net7+Xamarin and net7 targets. - # VS2019 has no support for net7 and we need to use msbuild (from the VS install) to do the packing + # we need to use the 2022 pool to create the nuget package with both pre-net6+Xamarin and net6 targets. + # VS2019 has no support for net6 and we need to use msbuild (from the VS install) to do the packing pool: 'Onnxruntime-Win-CPU-2022' variables: breakCodesignValidationInjection: ${{ parameters.DoEsrp }} @@ -675,7 +675,7 @@ stages: inputs: targetType: 'inline' script: | - dotnet workload install android ios maccatalyst + dotnet workload install android ios workingDirectory: '$(Build.SourcesDirectory)\csharp' - task: MSBuild@1 @@ -811,8 +811,8 @@ stages: - job: workspace: clean: all - # we need to use the 2022 pool to create the nuget package with both pre-net7+Xamarin and net7 targets. - # VS2019 has no support for net7 and we need to use msbuild (from the VS install) to do the packing + # we need to use the 2022 pool to create the nuget package with both pre-net6+Xamarin and net6 targets. + # VS2019 has no support for net6 and we need to use msbuild (from the VS install) to do the packing pool: 'Onnxruntime-Win-CPU-2022' variables: breakCodesignValidationInjection: ${{ parameters.DoEsrp }} @@ -876,20 +876,20 @@ stages: versionSpec: 6.2.1 - task: PowerShell@2 - displayName: Build .NET 7 targets using dotnet + displayName: Build .NET 6 targets using dotnet inputs: targetType: 'inline' # we don't specify 'Any CPU' as the platform here because if we do it gets added to the output path - # e.g. csharp\src\Microsoft.ML.OnnxRuntime\bin\Any CPU\RelWithDebInfo\net7.0-ios\ - # which is inconsistent with the msbuild output path for the pre-.net7 targets + # e.g. csharp\src\Microsoft.ML.OnnxRuntime\bin\Any CPU\RelWithDebInfo\net6.0-ios\ + # which is inconsistent with the msbuild output path for the pre-.net6 targets # e.g. csharp\src\Microsoft.ML.OnnxRuntime\bin\RelWithDebInfo\monoandroid11.0 # and makes it harder to do the packing # # 'Any CPU' is the default (first 'mixed' platform specified in the csproj) so this should be fine. script: | dotnet build .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj ` - -p:SelectedTargets=Net7 ` - /p:Net7Targets=net7.0 ` + -p:SelectedTargets=Net6 ` + /p:Net6Targets=net6.0 ` -p:Configuration=RelWithDebInfo ` -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" ` -p:OrtPackageId="Microsoft.ML.OnnxRuntime.ROCm" ` @@ -898,22 +898,22 @@ stages: workingDirectory: '$(Build.SourcesDirectory)\csharp' - task: MSBuild@1 - displayName: 'Restore NuGet Packages and create project.assets.json for pre-.net7 targets' + displayName: 'Restore NuGet Packages and create project.assets.json for pre-.net6 targets' inputs: solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln' platform: 'Any CPU' configuration: RelWithDebInfo - msbuildArguments: '-t:restore -p:SelectedTargets=PreNet7 -p:OrtPackageId="Microsoft.ML.OnnxRuntime.ROCm"' + msbuildArguments: '-t:restore -p:SelectedTargets=PreNet6 -p:OrtPackageId="Microsoft.ML.OnnxRuntime.ROCm"' workingDirectory: '$(Build.SourcesDirectory)\csharp' - task: MSBuild@1 - displayName: 'Build C# for pre-.net7 targets' + displayName: 'Build C# for pre-.net6 targets' inputs: solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln' configuration: RelWithDebInfo platform: 'Any CPU' msbuildArguments: > - -p:SelectedTargets=PreNet7 + -p:SelectedTargets=PreNet6 -p:OnnxRuntimeBuildDirectory="$(Build.BinariesDirectory)" -p:OrtPackageId="Microsoft.ML.OnnxRuntime.ROCm" -p:IsReleaseBuild=${{ parameters.IsReleaseBuild }} diff --git a/tools/ci_build/github/azure-pipelines/linux-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/linux-ci-pipeline.yml index fe31dc38f037f..82e571bf6519f 100644 --- a/tools/ci_build/github/azure-pipelines/linux-ci-pipeline.yml +++ b/tools/ci_build/github/azure-pipelines/linux-ci-pipeline.yml @@ -262,7 +262,7 @@ stages: pushd /onnxruntime_src/csharp; \ dotnet restore /onnxruntime_src/csharp/OnnxRuntime.DesktopOnly.CSharp.sln; \ dotnet build /onnxruntime_src/csharp/OnnxRuntime.DesktopOnly.CSharp.sln -c Release; \ - dotnet test /onnxruntime_src/csharp/OnnxRuntime.DesktopOnly.CSharp.sln -c Release -f net7.0 --no-build -l \"console;verbosity=normal\"; \ + dotnet test /onnxruntime_src/csharp/OnnxRuntime.DesktopOnly.CSharp.sln -c Release -f net6.0 --no-build -l \"console;verbosity=normal\"; \ popd " displayName: 'Dotnet build C# sln and Test' diff --git a/tools/ci_build/github/azure-pipelines/stages/nuget-combine-cuda-stage.yml b/tools/ci_build/github/azure-pipelines/stages/nuget-combine-cuda-stage.yml index 9a28ee138b279..2452e2885e74e 100644 --- a/tools/ci_build/github/azure-pipelines/stages/nuget-combine-cuda-stage.yml +++ b/tools/ci_build/github/azure-pipelines/stages/nuget-combine-cuda-stage.yml @@ -98,12 +98,12 @@ stages: workingDirectory: '$(Build.SourcesDirectory)\csharp' - task: PowerShell@2 - displayName: Build .NET 7 targets using dotnet + displayName: Build .NET 6 targets using dotnet inputs: targetType: 'inline' # we don't specify 'Any CPU' as the platform here because if we do it gets added to the output path - # e.g. csharp\src\Microsoft.ML.OnnxRuntime\bin\Any CPU\RelWithDebInfo\net7.0-ios\ - # which is inconsistent with the msbuild output path for the pre-.net7 targets + # e.g. csharp\src\Microsoft.ML.OnnxRuntime\bin\Any CPU\RelWithDebInfo\net6.0-ios\ + # which is inconsistent with the msbuild output path for the pre-.net6 targets # e.g. csharp\src\Microsoft.ML.OnnxRuntime\bin\RelWithDebInfo\monoandroid11.0 # and makes it harder to do the packing # diff --git a/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml b/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml index f8c0009f5abe6..847d5b831fcfe 100644 --- a/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml +++ b/tools/ci_build/github/azure-pipelines/templates/c-api-cpu.yml @@ -409,7 +409,7 @@ stages: inputs: targetType: 'inline' script: | - dotnet workload install android ios maccatalyst + dotnet workload install android ios workingDirectory: '$(Build.SourcesDirectory)\csharp' - task: MSBuild@1 diff --git a/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-vs-2022-job.yml b/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-vs-2022-job.yml index ce60fbc879c98..30e427a18509d 100644 --- a/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-vs-2022-job.yml +++ b/tools/ci_build/github/azure-pipelines/templates/jobs/win-ci-vs-2022-job.yml @@ -96,13 +96,6 @@ jobs: WithCache: ${{parameters.WITH_CACHE}} Today: $(Today) - - task: UseDotNet@2 - inputs: - version: '7.x' - ${{ if eq(parameters.isX86, true) }}: - env: - PROCESSOR_ARCHITECTURE: 'x86' - - task: NodeTool@0 inputs: versionSpec: '18.x' @@ -247,4 +240,4 @@ jobs: condition: and(failed(), eq(variables['DocUpdateNeeded'], 'true')) inputs: pathtoPublish: '$(Build.SourcesDirectory)/docs/ContribOperators.md' - artifactName: 'ContribOperators.md' + artifactName: 'ContribOperators.md' \ No newline at end of file diff --git a/tools/ci_build/github/linux/docker/scripts/install_dotnet.sh b/tools/ci_build/github/linux/docker/scripts/install_dotnet.sh index 80914385a88cf..c4689ed19c148 100755 --- a/tools/ci_build/github/linux/docker/scripts/install_dotnet.sh +++ b/tools/ci_build/github/linux/docker/scripts/install_dotnet.sh @@ -4,7 +4,7 @@ set -e -x if [ -f /etc/redhat-release ]; then # If you found the following command went successfully but dotnet command still reports no sdk was found, most likely # it was because the dotnet packages were installed from more than one dnf repos. - dnf install -y dotnet-sdk-7.0 dotnet-runtime-7.0 + dnf install -y dotnet-sdk-6.0 dotnet-runtime-6.0 elif [ -f /etc/os-release ]; then # Get Ubuntu version declare repo_version @@ -16,7 +16,7 @@ elif [ -f /etc/os-release ]; then # Clean up rm packages-microsoft-prod.deb # Update packages - apt-get update && apt-get install -y dotnet-sdk-7.0 + apt-get update && apt-get install -y dotnet-sdk-6.0 else echo "Unsupported OS" exit 1 diff --git a/tools/nuget/generate_nuspec_for_native_nuget.py b/tools/nuget/generate_nuspec_for_native_nuget.py index bea0b16344a40..670e595e03e40 100644 --- a/tools/nuget/generate_nuspec_for_native_nuget.py +++ b/tools/nuget/generate_nuspec_for_native_nuget.py @@ -268,20 +268,16 @@ def generate_dependencies(xml_text, package_name, version): xml_text.append('') xml_text.append('') xml_text.append("") - # Support net7.0-android - xml_text.append('') + # Support net6.0-android + xml_text.append('') xml_text.append('') xml_text.append("") - # Support net7.0-ios - xml_text.append('') + # Support net6.0-ios + xml_text.append('') xml_text.append('') xml_text.append("") - # Support net7.0-macos - xml_text.append('') - xml_text.append('') - xml_text.append("") - # Support net7.0-maccatalyst - xml_text.append('') + # Support net6.0-macos + xml_text.append('') xml_text.append('') xml_text.append("") # Support Native C++ @@ -961,70 +957,56 @@ def generate_files(line_list, args): args.package_name + ".targets", ) - net7_android_source_targets = os.path.join( + net6_android_source_targets = os.path.join( args.sources_path, "csharp", "src", "Microsoft.ML.OnnxRuntime", "targets", - "net7.0-android", + "net6.0-android", "targets.xml", ) - net7_android_target_targets = os.path.join( + net6_android_target_targets = os.path.join( args.sources_path, "csharp", "src", "Microsoft.ML.OnnxRuntime", "targets", - "net7.0-android", + "net6.0-android", args.package_name + ".targets", ) - net7_ios_source_targets = os.path.join( - args.sources_path, "csharp", "src", "Microsoft.ML.OnnxRuntime", "targets", "net7.0-ios", "targets.xml" + net6_ios_source_targets = os.path.join( + args.sources_path, "csharp", "src", "Microsoft.ML.OnnxRuntime", "targets", "net6.0-ios", "targets.xml" ) - net7_ios_target_targets = os.path.join( + net6_ios_target_targets = os.path.join( args.sources_path, "csharp", "src", "Microsoft.ML.OnnxRuntime", "targets", - "net7.0-ios", + "net6.0-ios", args.package_name + ".targets", ) - net7_maccatalyst_source_targets = os.path.join( - args.sources_path, - "csharp", - "src", - "Microsoft.ML.OnnxRuntime", - "targets", - "net7.0-maccatalyst", - "_._", + net6_macos_source_targets = os.path.join( + args.sources_path, "csharp", "src", "Microsoft.ML.OnnxRuntime", "targets", "net6.0-macos", "targets.xml" ) - net7_maccatalyst_target_targets = os.path.join( - args.sources_path, "csharp", "src", "Microsoft.ML.OnnxRuntime", "targets", "net7.0-maccatalyst", "_._" - ) - - net7_macos_source_targets = os.path.join( - args.sources_path, "csharp", "src", "Microsoft.ML.OnnxRuntime", "targets", "net7.0-macos", "targets.xml" - ) - net7_macos_target_targets = os.path.join( + net6_macos_target_targets = os.path.join( args.sources_path, "csharp", "src", "Microsoft.ML.OnnxRuntime", "targets", - "net7.0-macos", + "net6.0-macos", args.package_name + ".targets", ) os.system(copy_command + " " + monoandroid_source_targets + " " + monoandroid_target_targets) os.system(copy_command + " " + xamarinios_source_targets + " " + xamarinios_target_targets) - os.system(copy_command + " " + net7_android_source_targets + " " + net7_android_target_targets) - os.system(copy_command + " " + net7_ios_source_targets + " " + net7_ios_target_targets) - os.system(copy_command + " " + net7_maccatalyst_source_targets + " " + net7_maccatalyst_target_targets) - os.system(copy_command + " " + net7_macos_source_targets + " " + net7_macos_target_targets) + os.system(copy_command + " " + net6_android_source_targets + " " + net6_android_target_targets) + os.system(copy_command + " " + net6_ios_source_targets + " " + net6_ios_target_targets) + os.system(copy_command + " " + net6_macos_source_targets + " " + net6_macos_target_targets) files_list.append("') files_list.append( @@ -1037,30 +1019,20 @@ def generate_files(line_list, args): ) files_list.append( - "' - ) - files_list.append( - "' + "' ) - - files_list.append("') files_list.append( - "' + "' ) + files_list.append("') files_list.append( - "' - ) - files_list.append( - "' + "' ) - files_list.append("') + files_list.append("') files_list.append( - "' + "' ) # Process Training specific targets and props @@ -1084,27 +1056,27 @@ def generate_files(line_list, args): args.package_name + ".targets", ) - net7_android_source_targets = os.path.join( + net6_android_source_targets = os.path.join( args.sources_path, "csharp", "src", "Microsoft.ML.OnnxRuntime", "targets", - "net7.0-android", + "net6.0-android", "targets.xml", ) - net7_android_target_targets = os.path.join( + net6_android_target_targets = os.path.join( args.sources_path, "csharp", "src", "Microsoft.ML.OnnxRuntime", "targets", - "net7.0-android", + "net6.0-android", args.package_name + ".targets", ) os.system(copy_command + " " + monoandroid_source_targets + " " + monoandroid_target_targets) - os.system(copy_command + " " + net7_android_source_targets + " " + net7_android_target_targets) + os.system(copy_command + " " + net6_android_source_targets + " " + net6_android_target_targets) files_list.append("') files_list.append( @@ -1112,10 +1084,10 @@ def generate_files(line_list, args): ) files_list.append( - "' + "' ) files_list.append( - "' + "' ) # README