Skip to content

Fix NuGet packages missing onnxruntime_experimental_c_api.inc - #29866

Merged
tianleiwu merged 3 commits into
mainfrom
copilot/fix-onnxruntime-experimental-c-api-include
Jul 27, 2026
Merged

Fix NuGet packages missing onnxruntime_experimental_c_api.inc#29866
tianleiwu merged 3 commits into
mainfrom
copilot/fix-onnxruntime-experimental-c-api-include

Conversation

Copilot AI commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Description

The NuGet native packages shipped onnxruntime_experimental_c_api.h but not onnxruntime_experimental_c_api.inc, which the header #includes directly — causing a fatal compile error for any C/C++ consumer.

tools/nuget/generate_nuspec_for_native_nuget.py

  • Add a onnxruntime_*.inc glob entry alongside the existing onnxruntime_*.h glob so all .inc files from include/onnxruntime/core/session/ are packaged.

tools/nuget/validate_package.py

  • Add onnxruntime_experimental_c_api.h and onnxruntime_experimental_c_api.inc to gpu_related_header_files, dmlep_related_header_files, and training_related_header_files so CI validation catches this class of regression.

Motivation and Context

onnxruntime_experimental_c_api.h ends with #include "onnxruntime_experimental_c_api.inc". The NuGet packaging script used a *.h glob that by construction excludes .inc files, so the included file was never shipped. The CMake install rules already handle both files correctly; this aligns NuGet packaging with that behavior.

Affected packages: all native NuGet packages (Microsoft.ML.OnnxRuntime, .Gpu.Windows, .Gpu.Linux, etc.).

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI changed the title [WIP] Fix missing onnxruntime_experimental_c_api.inc in NuGet packages Fix NuGet packages missing onnxruntime_experimental_c_api.inc Jul 24, 2026
Copilot AI requested a review from tianleiwu July 24, 2026 21:41
tianleiwu added a commit that referenced this pull request Jul 24, 2026
This chery pick #29866 to 1.28 release

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@tianleiwu
tianleiwu marked this pull request as ready for review July 24, 2026 23:12
Copilot AI requested a review from tianleiwu July 25, 2026 01:50
@tianleiwu
tianleiwu enabled auto-merge (squash) July 27, 2026 22:29
@tianleiwu
tianleiwu merged commit 3996b39 into main Jul 27, 2026
88 of 89 checks passed
@tianleiwu
tianleiwu deleted the copilot/fix-onnxruntime-experimental-c-api-include branch July 27, 2026 22:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Build] NuGet packages ship onnxruntime_experimental_c_api.h but not the onnxruntime_experimental_c_api.inc it includes

3 participants