Properly package a Desktop Bridge UWP App with a Win32 App - wpf

We already have a working UWP app for x86, x64 and ARM. Everything is fine regarding store certification, all tests are passed, including with .NET native compilation.
We would like to use the Desktop Bridge (similar to what is specified here: https://blogs.msdn.microsoft.com/appconsult/2016/12/19/desktop-bridge-the-migrate-phase-invoking-a-win32-process-from-a-uwp-app/) to add a small .NET 4.6.1 WPF side-kick app to the main UWP (x86, x64) versions. The WPF app has three dependencies(x86 and x64) on some native dll's which are packaged together with the rest of the app.
We added the WPF.exe app and dll's to the existing UWP package (like specified in the above blog post - using xcopy) and built packages for HockeyApp. Locally and functionally, everything works fine for both x86 and x64. Once uploaded to the ms dev center, the Store certification unfortunately fails with the following error:
"Package acceptance validation error: Apps converted with the Desktop
Bridge and that require the .NET Native framework must be pre-compiled
by the .NET Native tool chain"
-- but native compilation is already enabled for UWP Release x86, x64.
We then tried to create a Windows Application Packaging Project (like described here: https://learn.microsoft.com/en-us/windows/uwp/porting/desktop-to-uwp-packaging-dot-net#generate-packages-for-your-desktop-bridge-app) and add both the UWP app and the WPF as dependencies. Then we created a new app manifest and store association (unfortunately it does not seem possible to reuse the existing manifest from the UWP app). We built the app store packages for (x86 x64 Release) and successfully tested everything locally. We then uploaded the package to win dev center and got again the same errors as before
"Package acceptance validation error: Apps converted with the Desktop
Bridge and that require the .NET Native framework must be pre-compiled
by the .NET Native tool chain".
As a follow up we removed the UWP project from the Windows Application Packaging Project and set the WPF app as an entry point. We then built a store package, uploaded it and the .NET native compilation error disappeared. Which is very weird...
Somehow the combination of UWP and WPF (even with native compilation enabled for UWP) causes this certification error. We have a feeling that something is wrong with the packaging.
We would really want to get this combination working or we will have to fall back to having two separate apps: one pure UWP and one packaged WPF companion app which needs to be installed separately. We truly wish we wouldn't have to do this. I'm not sure what we are doing wrong and for the moment I have run out of ideas.
PS: We also know we need to fill and submit a form regarding the restricted capability: full trust. But before we do that we need to be sure that everything else is fine.

UPDATE 4/21/2018
The workaround explained below is no longer needed, and in fact will not be accepted by the Store anymore. The right way to properly package a UWP app with a Win32 extension is to use the new VS Packaging Project, and then create the store package off of that project in VS. Details are in this blog post, see example #3 for this specific case:
https://blogs.windows.com/buildingapps/2017/12/04/extend-desktop-application-windows-10-features-using-new-visual-studio-application-packaging-project/#uvfV1r7937WrSkX2.97
OUTDATED ANSWER BELOW
You are hitting a known flaw in the Store ingestion process for packages that contain a mix of UWP and Desktop .NET binaries. The Store team is actively working on resolving this, so it will work automatically for submissions of this type. In the meantime you can do the following to get unblocked:
Manually create your.appxupload as follows (see screenshots for clarity below):
Go to the output folder for the AppPackage
Select the .appxsym files and the .appxbundle file
Create a new .zip file from those
Rename the .zip file to .appxupload
Resubmit to the Store with the new .appxupload file

Related

Program requires .net5 SDK, why?

A few days ago I updated a wpf program from .net4.8 to .net5. Some users now get an error message that can be seen in the picture.
These users have .NET Desktop Runtime 5.0.x installed. Apparently that is not enough. The program will not work until the SDK is installed.
My question now is, is there any way I can quickly tell whether I'm using classes or methods that need an SDK?
Do I have to adjust the publish config?
I would not like to deliver the whole framework with the program together.
Appearantly your app has a dependency on the ASP.NET runtime as well.
You will either have to download and install this one separately or remove any references to it from your app.
Check for any framework reference to Microsoft.AspNetCore.App in your project files (Project Sdk="Microsoft.NET.Sdk.Web">) or under Dependencies->Frameworks in Visual Studio.

Load PDF in a WPF application?

I've been searching around and I can't find any clean ways to render PDFs in a native WPF application. Most solutions are either paid or run with errors or cannot load PDFs for my particular use case in Civil Construction.
Does WPF have any built in PDF renderers?
There's a built in PDF API in the UWP Runtime under the following nuget package:
Microsoft.Windows.SDK.Contracts
If you check under Windows.Data.Pdf there's actually an example link to GITHub for a very barebones PDF Renderer--that just so happens to be robust enough to load up Civil Construction PDFs: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/PdfDocument
Of course the example is running on UWP so you'll need to go into the Windows settings (which should be auto-prompted if you've never installed UWP developer packages) and enable developer mode. This will give VS access to run UWP applications on your computer. You can search "developer" in the Windows settings or they're located under:
Settings -> Update & Security -> For developers -> "Developer Mode"
For the build platform in the configuration manager change from ARM to x64 (or x86 if you're on a 32-bit machine) and the program should run (works in VS Community 2019).

Fiori Mobile - Unhandled Error: 'bPackagedBuild' is undefined (SAP Build Project)

Just last week I exported a zip file from SAP Build (the prototyping tool) and imported this into SAP WEB IDE.
I simply choose 'Fiori Mobile' and 'Build Packaged app' from the menu to create a mobile app.
Unfortunately this doesn't appear to work anymore.
The error returned is
Unhandled Error: 'bPackagedBuild' is undefined
The full error in the log is : (hat) no template id is found, and the project seems not created from WEB IDE. As such, Fiori mobile does not officially support it. The app may encounter issues if you continue with a build.
Why has SAP stopped support?
To my knowledge, this has never been supported. The cloud-based build from the Fiori Mobile context menu always had a white list for supported template types, and it happens to cover most Web IDE application templates. Are you perhaps confusing the cloud-based build with the local Hybrid Application Toolkit? This tool allows you to run builds from your Web IDE and does have those restrictions. The builds are run locally on your machine, and you will need to set up the corresponding software in order to be able to use it.
Edit: I stand corrected. Unsurprisingly, this is supposed to work, and the use case has been documented e.g. in a recent blog post. As Thomas pointed out below, I believe that you are experiencing a temporary issue.

WACK Error after Converting WPF to UWP using Desktop App Converter

I was trying to convert my awesome WPF app to UWP using the Desktop App Converter.
I converted the app using DesktopAppConverter successfully, installed on my local Windows 10 machine and works like a charm. All good so far.
However when I tried the Windows App Certification process, it fails with the below error.
API _amsg_exit in msvcr100.dll is not supported for this application type.
API _cexit in msvcr100.dll is not supported for this application type.
API _commode in msvcr100.dll is not supported for this application type.
I actually use many essential functionalities via a CPP library which was created using some python code (which I don't have source code for).
(I guess "msvcr100.dll" is Microsoft C++ Re-distributable Package? )
Can any one help resolve this issue?
The WACK tool in the Windows 10 AU SDK is not applicable to Desktop Bridge app. You don't need to run it prior to submission. The error you are seeing here you can ignore.
Upcoming new versions of the SDK will have an updated WACK tool with specific support for Desktop Bridge apps.
Thanks!

Containing WPF-web-based app and WPF-desktop app in same csproj.

I have a WPF application, which until now - was an browser-based application. Now - due some changes in project i want to be able to run that application as desktop application. My question is - is it possible, that by using single CSProj file, and adding extra build configuration, to have single WPF Project which would build to desktop and web-based app? I want to be able to choose between options:
Debug (application is building as web-WPF-app, and is launched in web browser)
Release (same)
Debug Desktop (application is building as desktop-WPF-app, and is launched as client-desktop app)
Release Desktop (same)
Kind regards
Szymon D.
The output type of a project is independent from the Build configuration in Visual Studio.
Also, why? Why not factor out the things that are shared into DLLs and creating separate projects per output type?

Resources