onnxruntime/csharp
dependabot[bot] 18d5cd6ee5
Bump Newtonsoft.Json from 13.0.1 to 13.0.2 in /csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests.Mobile/EndToEndTests.Mobile.Automation (#13884)
[//]: # (dependabot-start)
⚠️  **Dependabot is rebasing this PR** ⚠️ 

Rebasing might not happen immediately, so don't worry if this takes some
time.

Note: if you make any changes to this PR yourself, they will take
precedence over the rebase.

---

[//]: # (dependabot-end)

Bumps [Newtonsoft.Json](https://github.com/JamesNK/Newtonsoft.Json) from
13.0.1 to 13.0.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a
href="https://github.com/JamesNK/Newtonsoft.Json/releases">Newtonsoft.Json's
releases</a>.</em></p>
<blockquote>
<h2>13.0.2</h2>
<ul>
<li>New feature - Add support for DateOnly and TimeOnly</li>
<li>New feature - Add UnixDateTimeConverter.AllowPreEpoch property</li>
<li>New feature - Add copy constructor to JsonSerializerSettings</li>
<li>New feature - Add JsonCloneSettings with property to disable copying
annotations</li>
<li>Change - Add nullable annotation to JToken.ToObject(Type,
JsonSerializer)</li>
<li>Change - Reduced allocations by reusing boxed values</li>
<li>Fix - Fixed MaxDepth when used with ToObject inside of a
JsonConverter</li>
<li>Fix - Fixed deserializing mismatched JToken types in properties</li>
<li>Fix - Fixed merging enumerable content and validate content</li>
<li>Fix - Fixed using $type with arrays of more than two dimensions</li>
<li>Fix - Fixed rare race condition in name table when deserializing on
device with ARM processors</li>
<li>Fix - Fixed deserializing via constructor with ignored base type
properties</li>
<li>Fix - Fixed MaxDepth not being used with ISerializable
deserialization</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a
href="4fba53a324"><code>4fba53a</code></a>
Remove prerelease for 13.0.2</li>
<li><a
href="b15df4b50d"><code>b15df4b</code></a>
Add missing headers</li>
<li><a
href="789bfd3bbc"><code>789bfd3</code></a>
Update to 13.0.2-beta3</li>
<li><a
href="b13717a1c1"><code>b13717a</code></a>
Add JsonCloneSettings to disable copy annotations (<a
href="https://github-redirect.dependabot.com/JamesNK/Newtonsoft.Json/issues/2757">#2757</a>)</li>
<li><a
href="d0a328e8a4"><code>d0a328e</code></a>
Fix MaxDepth not being used with ISerializable deserialization (<a
href="https://github-redirect.dependabot.com/JamesNK/Newtonsoft.Json/issues/2736">#2736</a>)</li>
<li><a
href="aae9284e20"><code>aae9284</code></a>
Update SDK</li>
<li><a
href="bd989708b1"><code>bd98970</code></a>
Update to 13.0.2-beta2</li>
<li><a
href="4dc9af66e0"><code>4dc9af6</code></a>
Add roll forward to global.json (<a
href="https://github-redirect.dependabot.com/JamesNK/Newtonsoft.Json/issues/2726">#2726</a>)</li>
<li><a
href="b8f4ef0f98"><code>b8f4ef0</code></a>
Fixing misspelling (<a
href="https://github-redirect.dependabot.com/JamesNK/Newtonsoft.Json/issues/2698">#2698</a>)</li>
<li><a
href="cb9eed9666"><code>cb9eed9</code></a>
Fix deserializing via constructor with ignored base type properties (<a
href="https://github-redirect.dependabot.com/JamesNK/Newtonsoft.Json/issues/2711">#2711</a>)</li>
<li>Additional commits viewable in <a
href="https://github.com/JamesNK/Newtonsoft.Json/compare/13.0.1...13.0.2">compare
view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Newtonsoft.Json&package-manager=nuget&previous-version=13.0.1&new-version=13.0.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after
your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge
and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating
it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the
default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as
the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as
the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the
default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the
[Security Alerts
page](https://github.com/microsoft/onnxruntime/network/alerts).

</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-09 13:07:05 -08:00
..
ApiDocs Lint updates csharp docs (#12962) 2022-09-14 17:56:41 -05:00
sample Add csharp docfx (#12596) 2022-08-25 09:51:32 -05:00
src Enable nuget packages for on device training (#13637) 2022-12-05 14:54:09 -08:00
test Bump Newtonsoft.Json from 13.0.1 to 13.0.2 in /csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests.Mobile/EndToEndTests.Mobile.Automation (#13884) 2022-12-09 13:07:05 -08:00
testdata Format all python files under onnxruntime with black and isort (#11324) 2022-04-26 09:35:16 -07:00
tools/Microsoft.ML.OnnxRuntime.PerfTool Patch Protobuf and ONNX's cmake files and enforce BinSkim check (#13694) 2022-11-18 10:09:47 -08:00
.clang-format Add Xamarin support (#9436) 2021-10-27 20:07:07 +10:00
Directory.Build.props.in Patch Protobuf and ONNX's cmake files and enforce BinSkim check (#13694) 2022-11-18 10:09:47 -08:00
Nuget.CSharp.config
OnnxRuntime.CSharp.proj Enable nuget packages for on device training (#13637) 2022-12-05 14:54:09 -08:00
OnnxRuntime.CSharp.sln Add csharp docfx (#12596) 2022-08-25 09:51:32 -05:00
OnnxRuntime.DesktopOnly.CSharp.sln Limit inclusion of Xamarin mobile target frameworks. (#9834) 2021-11-23 11:29:53 +10:00
OnnxRuntime.snk
readme.md Add .net6 support to the C# nuget package. (#11908) 2022-06-22 08:08:24 +10:00
readme.txt Limit inclusion of Xamarin mobile target frameworks. (#9834) 2021-11-23 11:29:53 +10:00

ORT C# Managed Library

The solution files here are used to produce nuget packages for the C# bindings.

Note that the project naming is currently confusing and needs updating.

  • The Microsoft.ML.OnnxRuntime project produces the Microsoft.ML.OnnxRuntime.Managed nuget package.
  • The Microsoft.ML.OnnxRuntime nuget package contains the native (i.e. C++) code for various platforms.

Solution files

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).

Development setup:

Requirements:

NOTE: The usage of this solution is primarily for ORT developers creating the managed Microsoft.ML.OnnxRuntime.Managed nuget package. Due to that, the requirements are quite specific.

Visual Studio 2022 v17.2.4 or later, with Xamarin workloads

There's no good way to use Visual Studio 2022 17.3 Preview in a CI, so we currently have to build pre-.net6 targets using VS, and .net6 targets using dotnet. We can't build them all using dotnet as the xamarin targets require msbuild. We can't package them using dotnet as that also requires msbuild.

Once the official VS 2022 release supports .net6 and is available in the CI we can revert to the original simple setup of building everything using msbuild.

To test packaging locally you will also need nuget.exe. Download from https://www.nuget.org/downloads. Put in a folder (e.g. C:\Program Files (x86)\NuGet). Add that folder to your PATH.

Magic incantations to build the nuget managed package locally:

If we're starting with VS 2022 17.2.4 we should have dotnet sdk 6.0.301

Make sure all the required workloads are installed dotnet workload install android ios maccatalyst macos - original example from here: - dotnet workload install android ios maccatalyst macos maui --source https://aka.ms/dotnet6/nuget/index.json --source https://api.nuget.org/v3/index.json - don't need 'maui' in this list until we update the sample/test apps - didn't seem to need --source arg/s for local build. YMMV.

Build pre-net6 targets msbuild -t:restore .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=PreNet6 msbuild -t:build .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=PreNet6

Need to run msbuild twice - once to restore which creates some json configs that are needed like Microsoft.ML.OnnxRuntime\obj\project.assets.json, and once to build using the configs.

Build net6 targets dotnet build .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=Net6

The dotnet build does the restore internally.

Create project.assets.json in obj dir with all targets so the nuget package creation includes them all msbuild -t:restore .\src\Microsoft.ML.OnnxRuntime\Microsoft.ML.OnnxRuntime.csproj -p:SelectedTargets=All

Create nuget package msbuild .\OnnxRuntime.CSharp.proj -t:CreatePackage -p:OrtPackageId=Microsoft.ML.OnnxRuntime -p:Configuration=Debug -p:Platform="Any CPU"