-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix app packaging in UWP #6804
Merged
Merged
Fix app packaging in UWP #6804
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…work with packages.config also
ryanlai2
previously approved these changes
Mar 2, 2021
ryanlai2
reviewed
Mar 2, 2021
csharp/src/Microsoft.AI.MachineLearning/Microsoft.AI.MachineLearning.targets
Outdated
Show resolved
Hide resolved
ryanlai2
previously approved these changes
Mar 2, 2021
martinb35
approved these changes
Mar 4, 2021
smk2007
pushed a commit
that referenced
this pull request
Mar 24, 2021
* Change msbuild condition for UAP * update .netcore target as well * create nuget packages with _native path * validate path under _native directory for windowsai package * pep8 * add diagnostic error message * pep8 * use baseame * lib\uap10.0 * uap10 * build\\uap10.0 * Manually binplace winmds into appx when PackageReference is used. * always binplace winmd regardless of packagereference since c# should work with packages.config also * resolve all paths to full paths to avoid some reference warnings * move winmds out of lib folder to prevent automatic component registration Co-authored-by: Sheil Kumar <[email protected]>
smk2007
added a commit
that referenced
this pull request
Mar 29, 2021
…rning Package (#7129) * Fix app packaging in UWP (#6804) * Change msbuild condition for UAP * update .netcore target as well * create nuget packages with _native path * validate path under _native directory for windowsai package * pep8 * add diagnostic error message * pep8 * use baseame * lib\uap10.0 * uap10 * build\\uap10.0 * Manually binplace winmds into appx when PackageReference is used. * always binplace winmd regardless of packagereference since c# should work with packages.config also * resolve all paths to full paths to avoid some reference warnings * move winmds out of lib folder to prevent automatic component registration Co-authored-by: Sheil Kumar <[email protected]> * Only set _native folder for Microsoft.AI.MachineLearning package (#6939) * only set _native folder for Microsoft.AI.MachineLearning package Co-authored-by: Sheil Kumar <[email protected]> Co-authored-by: Tiago Koji Castro Shibata <[email protected]> Co-authored-by: Sheil Kumar <[email protected]> Co-authored-by: Changming Sun <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description: Workaround for #6249
Motivation and Context
Nuget supports multi-plarform/multi-architecture packages and Nuget/msbuild picks the correct DLLs from
runtimes\
if you follow their naming conventions (available here). But at some point it started copying files fromnative
into UAP builds, causing #6249. I'm not sure if this is a bug in msbuild or our understanding of "native" is incorrect (maybe "native" means supported everywhere, and we should use another moniker for non-UWP? The reference of existing monikers is here).Anyways,
csharp/src/Microsoft.AI.MachineLearning/Microsoft.AI.MachineLearning.targets
already handles the logic to choose which DLLs to copy so we should do fine if Nuget doesn't interfere. This PR stops Nuget from messing with our packaging. There isn't a straightforward way to tell Nuget to stop doing it (see discussion and discussion - the supported way is adding some tags to PackageReference, which means the consumers of the Nuget package would have to add a couple of lines to their project), so my proposed workaround is simply renaming the native folder so Nuget doesn't attempt to copy DLLs automatically.Not following the folder naming convention and doing the copying through msbuild targets is also done in other projects (e.g. see Microsoft's WebView2 and I don't expect it to cause issues.
I tested my changes by locally editing a Nuget package and they fix UWP. I seem to have recently lost permission to queue jobs at aiinfra, so I couldn't do a clean run of the YAML job to see if it's actually producing a valid package. Before merging we should run the Nuget packaging pipeline and test if both UWP and Desktop are fine. I'll be out of office for the next few days, so @smk2007 will likely be the one driving this PR.