Skip to content

Commit d1ac97e

Browse files
Fix #24130 by adding an empty dependency group to the code that generates Microsoft.ML.OnnxRuntime.nuspec (#24131)
### Description As detailed in the issue (#24130), the Microsoft.ML.OnnxRuntime nuspec needs an additional dependency group for the `native` TFM, to allow it to be referenced via `PackageReference` in vcxproj projects. I took a peek at the code after filing the issue, since it seemed like it ought to be a simple fix. It looks like the nuspec file for the `Microsoft.ML.OnnxRuntime` package is generated by the python code in `generate_nuspec_for_native_nuget.py`, so I just added a line of code there. However I'm not sure how the build system invokes this generator so I haven't been able to test it in situ. Let me know if this isn't the right fix! ### Motivation and Context See detailed description in #24130
1 parent 1c6d07f commit d1ac97e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

tools/nuget/generate_nuspec_for_native_nuget.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ def generate_dependencies(xml_text, package_name, version):
268268
xml_text.append(dml_dependency)
269269
xml_text.append("</group>")
270270
if package_name == "Microsoft.ML.OnnxRuntime":
271+
xml_text.append('<group targetFramework="native" />')
271272
# Support net8.0-android
272273
xml_text.append('<group targetFramework="net8.0-android31.0">')
273274
xml_text.append('<dependency id="Microsoft.ML.OnnxRuntime.Managed"' + ' version="' + version + '"/>')

0 commit comments

Comments
 (0)