diff --git a/csharp/OnnxRuntime.CSharp.proj b/csharp/OnnxRuntime.CSharp.proj
index cf225b34ed..2ba184601c 100644
--- a/csharp/OnnxRuntime.CSharp.proj
+++ b/csharp/OnnxRuntime.CSharp.proj
@@ -44,7 +44,7 @@ CMake creates a target to this project
+ Properties="Platform=AnyCPU;OrtPackageId=$(OrtPackageId)"/>
-
+
diff --git a/csharp/OnnxRuntime.DesktopOnly.CSharp.sln b/csharp/OnnxRuntime.DesktopOnly.CSharp.sln
new file mode 100644
index 0000000000..d02a9e604d
--- /dev/null
+++ b/csharp/OnnxRuntime.DesktopOnly.CSharp.sln
@@ -0,0 +1,230 @@
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.31613.86
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OnnxRuntime", "OnnxRuntime", "{6EFBFAB8-C606-4BA4-9604-BBAF3788520D}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime", "src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj", "{584B53B3-359D-4DC2-BCD8-530B5D4685AD}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample", "Sample", "{02AADD56-0FD4-4F03-A56C-30529A36B0C0}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.InferenceSample", "sample\InferenceSample\Microsoft.ML.OnnxRuntime.InferenceSample\Microsoft.ML.OnnxRuntime.InferenceSample.csproj", "{2E295930-42B1-422D-925D-F07947AD8EFF}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.InferenceSample.Forms", "sample\InferenceSample\Microsoft.ML.OnnxRuntime.InferenceSample.Forms\Microsoft.ML.OnnxRuntime.InferenceSample.Forms.csproj", "{C5BDDD5D-F811-4CDD-A977-2D8581C21F36}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.InferenceSample.NetCoreApp", "sample\InferenceSample\Microsoft.ML.OnnxRuntime.InferenceSample.NetCoreApp\Microsoft.ML.OnnxRuntime.InferenceSample.NetCoreApp.csproj", "{1AA14958-9246-4163-9403-F650E65ADCBC}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Perf", "Perf", "{05C85C92-A377-4F69-9EF4-44A94C9B089D}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.PerfTool", "tools\Microsoft.ML.OnnxRuntime.PerfTool\Microsoft.ML.OnnxRuntime.PerfTool.csproj", "{310506FD-6E78-4D62-989B-25D69A85E8CF}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{6782763B-8097-457C-AEA3-67678621DBE0}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.Tests.Common", "test\Microsoft.ML.OnnxRuntime.Tests.Common\Microsoft.ML.OnnxRuntime.Tests.Common.csproj", "{04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ML.OnnxRuntime.Tests.NetCoreApp", "test\Microsoft.ML.OnnxRuntime.Tests.NetCoreApp\Microsoft.ML.OnnxRuntime.Tests.NetCoreApp.csproj", "{50173D13-DF29-42E7-A30B-8B12D36C77B1}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|iPhone = Debug|iPhone
+ Debug|iPhoneSimulator = Debug|iPhoneSimulator
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|iPhone = Release|iPhone
+ Release|iPhoneSimulator = Release|iPhoneSimulator
+ Release|x86 = Release|x86
+ RelWithDebInfo|Any CPU = RelWithDebInfo|Any CPU
+ RelWithDebInfo|iPhone = RelWithDebInfo|iPhone
+ RelWithDebInfo|iPhoneSimulator = RelWithDebInfo|iPhoneSimulator
+ RelWithDebInfo|x86 = RelWithDebInfo|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|x86.ActiveCfg = Debug|x86
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Debug|x86.Build.0 = Debug|x86
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|Any CPU.Build.0 = Release|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|iPhone.Build.0 = Release|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|x86.ActiveCfg = Release|x86
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.Release|x86.Build.0 = Release|x86
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.RelWithDebInfo|iPhone.ActiveCfg = RelWithDebInfo|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.RelWithDebInfo|iPhone.Build.0 = RelWithDebInfo|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = RelWithDebInfo|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.RelWithDebInfo|iPhoneSimulator.Build.0 = RelWithDebInfo|Any CPU
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x86
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x86
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.Debug|x86.Build.0 = Debug|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.Release|iPhone.Build.0 = Release|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.Release|x86.ActiveCfg = Release|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.Release|x86.Build.0 = Release|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.RelWithDebInfo|iPhone.ActiveCfg = Release|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.RelWithDebInfo|iPhone.Build.0 = Release|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.RelWithDebInfo|iPhoneSimulator.Build.0 = Release|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.RelWithDebInfo|x86.ActiveCfg = Debug|Any CPU
+ {2E295930-42B1-422D-925D-F07947AD8EFF}.RelWithDebInfo|x86.Build.0 = Debug|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Debug|x86.Build.0 = Debug|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Release|Any CPU.Build.0 = Release|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Release|iPhone.Build.0 = Release|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Release|x86.ActiveCfg = Release|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.Release|x86.Build.0 = Release|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.RelWithDebInfo|iPhone.ActiveCfg = Release|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.RelWithDebInfo|iPhone.Build.0 = Release|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.RelWithDebInfo|iPhoneSimulator.Build.0 = Release|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.RelWithDebInfo|x86.ActiveCfg = Debug|Any CPU
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36}.RelWithDebInfo|x86.Build.0 = Debug|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|x86.ActiveCfg = Debug|x86
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.Debug|x86.Build.0 = Debug|x86
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.Release|Any CPU.Build.0 = Release|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.Release|iPhone.Build.0 = Release|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.Release|x86.ActiveCfg = Release|x86
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.Release|x86.Build.0 = Release|x86
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.RelWithDebInfo|iPhone.ActiveCfg = RelWithDebInfo|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.RelWithDebInfo|iPhone.Build.0 = RelWithDebInfo|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = RelWithDebInfo|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.RelWithDebInfo|iPhoneSimulator.Build.0 = RelWithDebInfo|Any CPU
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x86
+ {1AA14958-9246-4163-9403-F650E65ADCBC}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x86
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.Debug|x86.ActiveCfg = Debug|x86
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.Debug|x86.Build.0 = Debug|x86
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.Release|Any CPU.Build.0 = Release|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.Release|iPhone.Build.0 = Release|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.Release|x86.ActiveCfg = Release|x86
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.Release|x86.Build.0 = Release|x86
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.RelWithDebInfo|iPhone.ActiveCfg = RelWithDebInfo|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.RelWithDebInfo|iPhone.Build.0 = RelWithDebInfo|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = RelWithDebInfo|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.RelWithDebInfo|iPhoneSimulator.Build.0 = RelWithDebInfo|Any CPU
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x86
+ {310506FD-6E78-4D62-989B-25D69A85E8CF}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x86
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Debug|x86.ActiveCfg = Debug|x86
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Debug|x86.Build.0 = Debug|x86
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Release|Any CPU.Build.0 = Release|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Release|iPhone.Build.0 = Release|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Release|x86.ActiveCfg = Release|x86
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.Release|x86.Build.0 = Release|x86
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.RelWithDebInfo|iPhone.ActiveCfg = RelWithDebInfo|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.RelWithDebInfo|iPhone.Build.0 = RelWithDebInfo|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = RelWithDebInfo|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.RelWithDebInfo|iPhoneSimulator.Build.0 = RelWithDebInfo|Any CPU
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x86
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x86
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|x86.ActiveCfg = Debug|x86
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.Debug|x86.Build.0 = Debug|x86
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|Any CPU.Build.0 = Release|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|iPhone.Build.0 = Release|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|x86.ActiveCfg = Release|x86
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.Release|x86.Build.0 = Release|x86
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.RelWithDebInfo|Any CPU.ActiveCfg = RelWithDebInfo|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.RelWithDebInfo|Any CPU.Build.0 = RelWithDebInfo|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.RelWithDebInfo|iPhone.ActiveCfg = RelWithDebInfo|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.RelWithDebInfo|iPhone.Build.0 = RelWithDebInfo|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = RelWithDebInfo|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.RelWithDebInfo|iPhoneSimulator.Build.0 = RelWithDebInfo|Any CPU
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.RelWithDebInfo|x86.ActiveCfg = RelWithDebInfo|x86
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1}.RelWithDebInfo|x86.Build.0 = RelWithDebInfo|x86
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {584B53B3-359D-4DC2-BCD8-530B5D4685AD} = {6EFBFAB8-C606-4BA4-9604-BBAF3788520D}
+ {2E295930-42B1-422D-925D-F07947AD8EFF} = {02AADD56-0FD4-4F03-A56C-30529A36B0C0}
+ {C5BDDD5D-F811-4CDD-A977-2D8581C21F36} = {02AADD56-0FD4-4F03-A56C-30529A36B0C0}
+ {1AA14958-9246-4163-9403-F650E65ADCBC} = {02AADD56-0FD4-4F03-A56C-30529A36B0C0}
+ {310506FD-6E78-4D62-989B-25D69A85E8CF} = {05C85C92-A377-4F69-9EF4-44A94C9B089D}
+ {04FA49F0-AA23-4EE5-B455-6E12FFAD29E6} = {6782763B-8097-457C-AEA3-67678621DBE0}
+ {50173D13-DF29-42E7-A30B-8B12D36C77B1} = {6782763B-8097-457C-AEA3-67678621DBE0}
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {C3DBDA2B-F169-4EDE-9353-858904124B75}
+ EndGlobalSection
+ GlobalSection(Performance) = preSolution
+ HasPerformanceSessions = true
+ EndGlobalSection
+EndGlobal
diff --git a/csharp/readme.txt b/csharp/readme.txt
new file mode 100644
index 0000000000..5b9a18847a
--- /dev/null
+++ b/csharp/readme.txt
@@ -0,0 +1,6 @@
+The main solution file is OnnxRuntime.CSharp.sln. This includes desktop and Xamarin mobile projects.
+OnnxRuntime.DesktopOnly.CSharp.sln is a copy of that with all the mobile projects removed. This is
+due to there being no way to selectively exclude a csproj from the sln if Xamarin isn't available.
+
+If changes are required, either update the main solution first and copy the relevant changes across,
+ or copy the entire file and remove the mobile projects (anything with iOS, Android or Droid in the name).
\ No newline at end of file
diff --git a/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj b/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj
index 2eb04ab4fd..46b30483a0 100644
--- a/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj
+++ b/csharp/src/Microsoft.ML.OnnxRuntime/Microsoft.ML.OnnxRuntime.csproj
@@ -1,7 +1,25 @@
-
- netstandard1.1;netstandard2.0;xamarinios10;monoandroid11.0;net5.0;netcoreapp3.1
+
+ Microsoft.ML.OnnxRuntime
+
+
+
+
+
+
+ netstandard1.1;netstandard2.0;xamarinios10;monoandroid11.0;net5.0;netcoreapp3.1
+
+
+
+
+ netstandard1.1;netstandard2.0;net5.0;netcoreapp3.1
+
+
+
+
+
AnyCPU;x86
7.2
true
@@ -19,9 +37,6 @@
false
portable
-
- Microsoft.ML.OnnxRuntime
-
Microsoft.ML.OnnxRuntime.Managed
diff --git a/tools/ci_build/build.py b/tools/ci_build/build.py
index 6797638b08..77dc793ed0 100644
--- a/tools/ci_build/build.py
+++ b/tools/ci_build/build.py
@@ -1759,6 +1759,11 @@ def build_nuget_package(source_dir, build_dir, configs, use_cuda, use_openvino,
csharp_build_dir = os.path.join(source_dir, 'csharp')
is_linux_build = derive_linux_build_property()
+ # in most cases we don't want/need to include the Xamarin mobile targets, as doing so means the Xamarin
+ # mobile workloads must be installed on the machine.
+ # they are only included in the Microsoft.ML.OnnxRuntime nuget package
+ sln = "OnnxRuntime.DesktopOnly.CSharp.sln"
+
# derive package name and execution provider based on the build args
target_name = "/t:CreatePackage"
execution_provider = "/p:ExecutionProvider=\"None\""
@@ -1780,14 +1785,15 @@ def build_nuget_package(source_dir, build_dir, configs, use_cuda, use_openvino,
elif use_nuphar:
package_name = "/p:OrtPackageId=\"Microsoft.ML.OnnxRuntime.Nuphar\""
else:
- pass
+ # use the solution file that includes Xamarin mobile targets
+ sln = "OnnxRuntime.CSharp.sln"
# set build directory based on build_dir arg
native_dir = os.path.normpath(os.path.join(source_dir, build_dir))
ort_build_dir = "/p:OnnxRuntimeBuildDirectory=\"" + native_dir + "\""
# dotnet restore
- cmd_args = ["dotnet", "restore", "OnnxRuntime.CSharp.sln", "--configfile", "Nuget.CSharp.config"]
+ cmd_args = ["dotnet", "restore", sln, "--configfile", "Nuget.CSharp.config"]
run_subprocess(cmd_args, cwd=csharp_build_dir)
# build csharp bindings and create nuget package for each config
@@ -1800,8 +1806,7 @@ def build_nuget_package(source_dir, build_dir, configs, use_cuda, use_openvino,
configuration = "/p:Configuration=\"" + config + "\""
if not use_winml:
- cmd_args = ["dotnet", "msbuild", "OnnxRuntime.CSharp.sln", configuration, package_name, is_linux_build,
- ort_build_dir]
+ cmd_args = ["dotnet", "msbuild", sln, configuration, package_name, is_linux_build, ort_build_dir]
run_subprocess(cmd_args, cwd=csharp_build_dir)
else:
winml_interop_dir = os.path.join(source_dir, "csharp", "src", "Microsoft.AI.MachineLearning.Interop")
@@ -1811,7 +1816,13 @@ def build_nuget_package(source_dir, build_dir, configs, use_cuda, use_openvino,
ort_build_dir, "-restore"]
run_subprocess(cmd_args, cwd=csharp_build_dir)
- nuget_exe = os.path.normpath(os.path.join(native_dir, config, "nuget_exe", "src", "nuget.exe"))
+ if is_windows():
+ # this path is setup by cmake/nuget_helpers.cmake for MSVC on Windows
+ nuget_exe = os.path.normpath(os.path.join(native_dir, config, "nuget_exe", "src", "nuget.exe"))
+ else:
+ # user needs to make sure nuget is installed and can be found
+ nuget_exe = "nuget"
+
nuget_exe_arg = "/p:NugetExe=\"" + nuget_exe + "\""
cmd_args = [
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 f93b076004..283bb70f67 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
@@ -444,11 +444,14 @@ jobs:
inputs:
versionSpec: 5.7.0
- - task: NuGetCommand@2
- displayName: Restore NuGet Packages
+ - task: MSBuild@1
+ displayName: 'Restore NuGet Packages'
inputs:
- command: "restore"
- restoreSolution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
+ solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
+ platform: 'Any CPU'
+ configuration: RelWithDebInfo
+ msbuildArguments: '-t:restore -p:OrtPackageId="Microsoft.ML.OnnxRuntime.Gpu"'
+ workingDirectory: '$(Build.SourcesDirectory)\csharp'
- task: MSBuild@1
displayName: 'Build C#'
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 bfbbe0fdf7..32a0552932 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
@@ -464,11 +464,14 @@ jobs:
inputs:
versionSpec: 5.7.0
- - task: NuGetCommand@2
- displayName: Restore NuGet Packages
+ - task: MSBuild@1
+ displayName: 'Restore NuGet Packages'
inputs:
- command: "restore"
- restoreSolution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
+ solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
+ platform: 'Any CPU'
+ configuration: RelWithDebInfo
+ msbuildArguments: '-t:restore -p:OrtPackageId=$(OrtPackageId)'
+ workingDirectory: '$(Build.SourcesDirectory)\csharp'
- task: MSBuild@1
displayName: 'Build C#'
diff --git a/tools/ci_build/github/azure-pipelines/templates/win-ci-2019.yml b/tools/ci_build/github/azure-pipelines/templates/win-ci-2019.yml
index 0b35f48249..04e21bcd22 100644
--- a/tools/ci_build/github/azure-pipelines/templates/win-ci-2019.yml
+++ b/tools/ci_build/github/azure-pipelines/templates/win-ci-2019.yml
@@ -136,11 +136,14 @@ jobs:
versionSpec: 5.7.0
- ${{ if eq(parameters.BuildCSharp, true) }}:
- - task: NuGetCommand@2
- displayName: Restore NuGet Packages
+ - task: MSBuild@1
+ displayName: 'Restore NuGet Packages'
inputs:
- command: "restore"
- restoreSolution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
+ solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
+ platform: 'Any CPU'
+ configuration: '$(BuildConfig)'
+ msbuildArguments: '-t:restore -p:OrtPackageId=${{ parameters.OrtPackageId }}'
+ workingDirectory: '$(Build.SourcesDirectory)\csharp'
- ${{ if eq(parameters.BuildCSharp, true) }}:
- task: MSBuild@1
@@ -211,6 +214,7 @@ jobs:
${{ parameters.NuPackScript }}
workingDirectory: '$(Build.SourcesDirectory)\csharp'
displayName: 'Create NuGet Package'
+ failOnStderr: true
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline Artifact: ${{ parameters.ArtifactName }}'
diff --git a/tools/ci_build/github/azure-pipelines/templates/win-cpu-ci.yml b/tools/ci_build/github/azure-pipelines/templates/win-cpu-ci.yml
index 0a704ddf4f..3e952d1fd6 100644
--- a/tools/ci_build/github/azure-pipelines/templates/win-cpu-ci.yml
+++ b/tools/ci_build/github/azure-pipelines/templates/win-cpu-ci.yml
@@ -145,12 +145,14 @@ jobs:
arguments: 'bdist_wheel'
workingDirectory: '$(Build.BinariesDirectory)\${{ parameters.BuildConfig }}\${{ parameters.BuildConfig }}'
-
- - task: NuGetCommand@2
- displayName: Restore NuGet Packages
+ - task: MSBuild@1
+ displayName: 'Restore NuGet Packages'
inputs:
- command: "restore"
- restoreSolution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
+ solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
+ platform: 'Any CPU'
+ configuration: '${{ parameters.BuildConfig }}'
+ msbuildArguments: '-t:restore -p:OrtPackageId=$(OrtPackageId)'
+ workingDirectory: '$(Build.SourcesDirectory)\csharp'
- task: MSBuild@1
displayName: 'Build C#'
diff --git a/tools/ci_build/github/azure-pipelines/win-gpu-ci-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-gpu-ci-pipeline.yml
index b435b74d96..7f73482a75 100644
--- a/tools/ci_build/github/azure-pipelines/win-gpu-ci-pipeline.yml
+++ b/tools/ci_build/github/azure-pipelines/win-gpu-ci-pipeline.yml
@@ -130,11 +130,14 @@ stages:
arguments: 'bdist_wheel'
workingDirectory: '$(Build.BinariesDirectory)\$(BuildConfig)\$(BuildConfig)'
- - task: NuGetCommand@2
- displayName: Restore NuGet Packages
+ - task: MSBuild@1
+ displayName: 'Restore NuGet Packages'
inputs:
- command: "restore"
- restoreSolution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
+ solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
+ platform: 'Any CPU'
+ configuration: '$(BuildConfig)'
+ msbuildArguments: '-t:restore -p:OrtPackageId=$(OrtPackageId)'
+ workingDirectory: '$(Build.SourcesDirectory)\csharp'
- task: MSBuild@1
displayName: 'Build C#'
diff --git a/tools/ci_build/github/azure-pipelines/win-gpu-cuda-10-2-pipeline.yml b/tools/ci_build/github/azure-pipelines/win-gpu-cuda-10-2-pipeline.yml
index 55561e4227..3150d8c4b9 100644
--- a/tools/ci_build/github/azure-pipelines/win-gpu-cuda-10-2-pipeline.yml
+++ b/tools/ci_build/github/azure-pipelines/win-gpu-cuda-10-2-pipeline.yml
@@ -81,11 +81,14 @@ jobs:
inputs:
versionSpec: 5.7.0
- - task: NuGetCommand@2
- displayName: Restore NuGet Packages
+ - task: MSBuild@1
+ displayName: 'Restore NuGet Packages'
inputs:
- command: "restore"
- restoreSolution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
+ solution: '$(Build.SourcesDirectory)\csharp\OnnxRuntime.CSharp.sln'
+ platform: 'Any CPU'
+ configuration: '$(BuildConfig)'
+ msbuildArguments: '-t:restore -p:OrtPackageId=$(OrtPackageId)'
+ workingDirectory: '$(Build.SourcesDirectory)\csharp'
- task: MSBuild@1
displayName: 'Build C#'