2

In this answer I was told that I need a packaging project to add a desktop exe to a UWP app (to be used through desktop extensions).

However, the packaging project is very lightweight, there's not much there. So I was wondering if I can insert whatever is the pertinent code from the packaging project into the UWP app (and do without the packaging project) instead of migrating all of the UWP stuff into the packaging project. This will also make everything simpler and therefore less prone to errors, now and in the future.

I tried once. I added the extra TargetDeviceFamily. It got accepted by the store, only to be told later that errors were found. (The app crashes on launch.)

ispiro
  • 26,556
  • 38
  • 136
  • 291

1 Answers1

2

If you want to do this manually, it can be done. In your specific case (as far as I understand it from the other thread) you would only need to add this to the Package.appxmanifest:

  <build:Metadata>
    <build:Item Name="Microsoft.Build.DesktopBridge.Tasks.dll" Version="4.6.27406.0" />
  </build:Metadata>

This way the Store will assume it has been packaged correctly with desktop binaries in sub folders, and UWP binaries in the root - so they can be processes for .NET native compilation.

However, for future sustainability I would recommend using the packaging project for creating the Store upload packages.

Stefan Wick MSFT
  • 13,600
  • 1
  • 32
  • 51
  • Thanks. But I tried and it failed. Though now I'm thinking - perhaps it must be under one folder no more? (I tried in a nested folder.) Also perhaps the .net version was too low (it was 4.6, and perhaps I should try with higher, though 4.6 is enough for all Windows 10 versions.) – ispiro Apr 29 '18 at 20:27
  • Just to verify, you meant just add the line: ``. Right? – ispiro Apr 29 '18 at 20:30
  • Sorry, my paste failed. See updated answer what I meant. – Stefan Wick MSFT Apr 29 '18 at 20:46
  • Thanks! I was already looking for a different approach using delayed clipboard use (which would also make the app quite simpler) but that [simply does not work according to the docs](https://stackoverflow.com/q/50087835/939213) so that wasn't working. – ispiro Apr 29 '18 at 20:48
  • I spoke too soon. `Namespace prefix 'build' is not defined.`. – ispiro Apr 29 '18 at 20:53
  • xmlns:build="http://schemas.microsoft.com/developer/appx/2015/build" - and make sure you add 'build" to the IgnorableNamespaces list. You can look this up from any UWP build output, as VS adds this to every appxmanifest.xml it produces. – Stefan Wick MSFT Apr 29 '18 at 22:09