diff --git a/csharp/sample/Microsoft.ML.OnnxRuntime.InferenceSample/Microsoft.ML.OnnxRuntime.InferenceSample.csproj b/csharp/sample/Microsoft.ML.OnnxRuntime.InferenceSample/Microsoft.ML.OnnxRuntime.InferenceSample.csproj
index ba07300312e54..20a226a9f9e9b 100644
--- a/csharp/sample/Microsoft.ML.OnnxRuntime.InferenceSample/Microsoft.ML.OnnxRuntime.InferenceSample.csproj
+++ b/csharp/sample/Microsoft.ML.OnnxRuntime.InferenceSample/Microsoft.ML.OnnxRuntime.InferenceSample.csproj
@@ -17,7 +17,7 @@
Always
false
-
+
Always
false
diff --git a/tools/ci_build/github/azure-pipelines/azure-pipelines.yml b/tools/ci_build/github/azure-pipelines/azure-pipelines.yml
index 7bfeff5b74416..e573c946c4f94 100644
--- a/tools/ci_build/github/azure-pipelines/azure-pipelines.yml
+++ b/tools/ci_build/github/azure-pipelines/azure-pipelines.yml
@@ -44,7 +44,7 @@ jobs:
- task: BatchScript@1
inputs:
filename: build.bat
- arguments: ' --enable_onnx_tests'
+ arguments: ' --enable_onnx_tests --build_shared_lib --build_csharp'
workingFolder: "$(Build.SourcesDirectory)"
- task: CmdLine@1