Error while creating app package with “fullTrustProcess” pointing to a executable

后端 未结 4 1040
悲&欢浪女
悲&欢浪女 2021-02-02 15:52

I am trying to deploy the sample application for bridging AppServices with a UWP application. The sample runs and builds just fine but when I try to follow the guide to package

4条回答
  •  不思量自难忘°
    2021-02-02 16:20

    I seem to get the package creation working. Being quite desperate already I tried to use C++ console instead of C#, as in AppServiceBridgeSample_C++ sample. I only had to add the Win32Process_CPP.exe file to UWP project and mark it as Content with Copy if newer flag. After that the Create App Packages operation succeeds. But just simple changing the C++ console back to a C# one resulted to failure again - quite strange!

    As I have found, the main problem is known and described in docs:

    If you prefer to use a C# project to package your app, you need to be aware of the following known issues:

    Win32 Binaries stored in the root folder of the UWP project are removed in Release. If you don't use a folder to store your Win32 binaries, the .NET Native compiler will remove those from the final package, resulting in a manifest validation error since the executable entry point can't be found.

    Solution to this issue was simple:

    1. Create a directory (e.g. win32) in UWP project root. This is the place where the console binary (BackgroundProcess.exe) has to be placed.

      So you get e.g. c:\test\AppServiceBridgeSample\cs\UWP\win32

    2. Edit the desktop:Extension element in Package.appxmanifest - add the folder to the Executable attribute value:

    3. Add the BackgroundProcess.exe binary from the newly created folder to your UWP project. In its properties set the BuildAction attribute to Content and Copy to Output Directory to Copy if newer.

    The package should now get created.

    Note: If you run AppCertKit (WACK) with the created package, you may get failure due to using rescap namespace (which is reserved for Microsoft and its partner vendors only, see here). The BinaryAnalyzer.AppContainerCheck will probably fail as well, due to call of unprotected binary.

提交回复
热议问题