Skip to content

Fix Microsoft.AI.MachineLearning .NET5 publishing and C# Store Release build#7373

Merged
smk2007 merged 2 commits into
masterfrom
user/sheilk/c-sharp-fixes
Apr 19, 2021
Merged

Fix Microsoft.AI.MachineLearning .NET5 publishing and C# Store Release build#7373
smk2007 merged 2 commits into
masterfrom
user/sheilk/c-sharp-fixes

Conversation

@smk2007

@smk2007 smk2007 commented Apr 19, 2021

Copy link
Copy Markdown
Member

There are 2 fixes in this change.

Issue #1: The Microsoft.AI.MachineLearning package does not publish native binaries to the package output directory automatically.

Reason: This regressed when all of the nuget payload was moved into folders with non-canonical names. This was done to prevent nuget from performing automatic copies, as its logic was getting confused when multiple binaries are produced for the same TFM (static, dynamic crt for native binaries). After moving the files to non-canonical names, all project configuration is now performed by the package itself by including its own targets/props files in the build directory. The copy that was added into the targets file only copied out to the bin directory and not the publish directory, causing the regression.

Fix: The Fix is to call ReferenceCopyLocalPaths on the intended binaries, and that will configure the project to binplace and publish the native binaries.

Issue #2: C# UWP Applications cannot build release because Microsoft.AI.MachineLearning.Experimental.winmd references Windows.AI.MachineLearning.winmd.

Reason: This happened because the core Windows AI API is implemented in a single file Windows.AI.MachineLEarning.idl, and shared between the Inbox implementation and the Redist. However, dependent idls fail to work when referencing Windows.AI.MachineLearning.idl, as import statements are interpretted as winmd references. This causes Release builds to fail, as there is no Windows.AI.MachineLearning.winmd packaged in the redist package.

Fix: The fix is to copy the idls into a separate folder at build, and rename them to Microsoft.* files so that midlrt does not add erroneous winmd references.

Comment thread winml/api/Microsoft.AI.MachineLearning.Experimental.idl
@smk2007
smk2007 merged commit 265db2a into master Apr 19, 2021
@smk2007
smk2007 deleted the user/sheilk/c-sharp-fixes branch April 19, 2021 22:36
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.

2 participants