Code Monkey home page Code Monkey logo

desktopbridgetouwp-samples's Introduction

Desktop app bridge to UWP Samples

Desktop Conversion Extensions is a bridge that enables you to convert your classic desktop application (like Win32, Windows Forms, and WPF) or game to a Universal Windows Platform (UWP) app or game. After conversion, your classic desktop app is packaged, serviced, and deployed in the form of a UWP app package (an .appx or an .appxbundle) targeting Windows 10. There are two parts to the technology that enables desktop apps to be converted to UWP packages. The first is the Desktop App Converter, which takes your existing binaries and repackages them as a UWP package, you can also create the package manually like we show in these samples. Your code is the same, it's just packaged differently. The second piece is comprised of runtime technologies in the Windows Anniversary update that enable a UWP package to have executables that run as full trust instead of in an app container. This technology also gives a converted app a package identity, which is required to use some UWP APIs. For more info on UWP apps, see the Universal Application Platform Guide

Requirements

Feedback

License

MIT

Additional resources

desktopbridgetouwp-samples's People

Contributors

adambraden avatar arianghotbimsft avatar aruproy14 avatar ashjain avatar coolrick avatar lc-soft avatar llly avatar madve2 avatar marcusbreda avatar microsoft-github-policy-service[bot] avatar mortonfox avatar msftgits avatar pezan avatar ptorr-msft avatar rido-min avatar ridomin avatar vladimp avatar wickste avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

desktopbridgetouwp-samples's Issues

Reference a dll in the Background process.

Hi,

I want to use a dll in my UWP app. I have created a bridge (followed the example AppServiceBridgeSample). It contains a BackgroundProcess which is c# console application. UWP uses the bridge to communicate with console application.
Issue:

  1. If I reference a dll in BackgroundProcess , I get the error "System.IO.FileException, Could not load assembly or File", when I am running the UWP app.
    Please let me know what is the right way to add a dll in BackgroundProcess so that we can use it the UWP app.
    PS: The Background process with the dll works fine when run as standlone application. But when communicating via the Bridge, the above exception is thrown ( "System.IO.FileException, Could not load assembly or File") .

SystrayExtension: System.InvalidOperationException: The process has no package identity

Hi there,

the SystrayExtension-Sample does not seem to work. When deploying the solution and executing it, it successfully launches the WinForms tray icon application. However, when e.g. double clicking the tray icon to open the UWP application, it crashes with an exception:

System.InvalidOperationException: 'The process has no package identity. (Exception from HRESULT: 0x80073D54)'

Can you give me a hint on how to fix this? Haven't found anything useful yet.

AppServiceBridgeSample Create store packages fails

1> UWP -> C:\Project\DesktopBridgeToUWP-Samples-master\Samples\AppServiceBridgeSample\cs\UWP\bin\x64\Release\Test.exe
1> Starting .NET Native compilation
1> Processing application code
1> Computing application closure and generating interop code
1> Generating serialization code
1> Compiling interop code
1> Cleaning up unreferenced code
1> Generating native code
1> Generating fixups for native code
1> C:\Project\DesktopBridgeToUWP-Samples-master\Samples\AppServiceBridgeSample\cs\BackgroundProcess\bin\Release\BackgroundProcess.exe
1> 1 File(s) copied
1> C:\Project\DesktopBridgeToUWP-Samples-master\Samples\AppServiceBridgeSample\cs\BackgroundProcess\bin\Release\BackgroundProcess.exe
1> 1 File(s) copied
1>MakeAppx : error : Manifest validation error: Line 37, Column 64, Reason: The file name "BackgroundProcess.exe" declared for element "[local-name()='Applications']/[local-name()='Application']/[local-name()='Extensions']/[local-name()='Extension' and not(@category='windows.backgroundTasks' or @category='windows.appService')]" doesn't exist in the package.
1>MakeAppx : error : Manifest validation error: Line 37, Column 64, Reason: The file name "BackgroundProcess.exe" declared for element "[local-name()='Applications']/[local-name()='Application']/[local-name()='Extensions']/[local-name()='Extension' and @category='windows.fullTrustProcess']" doesn't exist in the package.
1>MakeAppx : error : Package creation failed.
1>MakeAppx : error : 0x80080204 - The specified package format is not valid: The package manifest is not valid.

VS 2015 error when opening DesktopBridgeDemoStep solutions

Got error when loading Step 1:
"Unsupported
This version of Visual Studio is unable to open the following projects. The project types may not be installed or this version of Visual Studio may not support them.
For more information on enabling these project types or otherwise migrating your assets, please see the details in the "Migration Report" displayed after clicking OK.
- UWPPackager, "E:\work\GitHub\DesktopBridgeToUWP-Samples\Samples\JourneyAcrossTheBridge\DesktopBridgeDemo - Step1\UWPPackager\UWPPackager.vsdproj"

No changes required
These projects can be opened in Visual Studio 2015, Visual Studio 2013, Visual Studio 2012, and Visual Studio 2010 SP1 without changing them.
- MyDesktopApp, "E:\work\GitHub\DesktopBridgeToUWP-Samples\Samples\JourneyAcrossTheBridge\DesktopBridgeDemo - Step1\MyDesktopApp\MyDesktopApp.csproj"
- DesktopBridgeDemoStep1, "E:\work\GitHub\DesktopBridgeToUWP-Samples\Samples\JourneyAcrossTheBridge\DesktopBridgeDemo - Step1\DesktopBridgeDemoStep1.sln"

Trying Step 4 I get:
E:\work\GitHub\DesktopBridgeToUWP-Samples\Samples\JourneyAcrossTheBridge\DesktopBridgeDemo - Step4\BackgroundTasks\BackgroundTasks.csproj : error : The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. E:\work\GitHub\DesktopBridgeToUWP-Samples\Samples\JourneyAcrossTheBridge\DesktopBridgeDemo - Step4\BackgroundTasks\BackgroundTasks.csproj

E:\work\GitHub\DesktopBridgeToUWP-Samples\Samples\JourneyAcrossTheBridge\DesktopBridgeDemo - Step4\MyUWPApp\MyUWPApp.csproj : error : The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. E:\work\GitHub\DesktopBridgeToUWP-Samples\Samples\JourneyAcrossTheBridge\DesktopBridgeDemo - Step4\MyUWPApp\MyUWPApp.csproj

E:\work\GitHub\DesktopBridgeToUWP-Samples\Samples\JourneyAcrossTheBridge\DesktopBridgeDemo - Step4\BackgroundTasks\BackgroundTasks.csproj : error : The imported project "C:\Program Files (x86)\MSBuild\Microsoft\WindowsXaml\v15.0\Microsoft.Windows.UI.Xaml.CSharp.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. E:\work\GitHub\DesktopBridgeToUWP-Samples\Samples\JourneyAcrossTheBridge\DesktopBridgeDemo - Step4\BackgroundTasks\BackgroundTasks.csproj

AppServiceBridgeSample closes UWP if Win32 app is closed

In the AppServiceBridge sample, the win32 app, if shut down, will cause the UWP app to shut down. That isn't desired. How can this dependency be avoided?

  1. Start UWP app
  2. Start Win32 process
  3. Win32 process connects to UWP app
  4. Close Win32 process
  5. UWP shuts down a few seconds later without suspending. (How can we avoid this)

Thanks,
Michael

Open File Dialog crash the app

Using the appx generated from PhotoStoreDemo.Pakcage project, when click on "Add Photo" button, the file dialog first shows up and then a second windows show up and states this program has stopped working... It works if it is ran under PhotoStoreDemo.Package.Debug (the project also misses the package layout file)

AppServiceBridgeSample_C++ fails to build: can't find platform.winmd

Building the Win32 component of the AppServiceBridgeSample_C++ in Visual Studio 2017 15.5.0, I get a build error:
could not find assembly 'platform.winmd': please specify the assembly search path using /AI or by setting the LIBPATH environment variable

Any suggestions?
Michael

non-plated taskbar icons

Are there any known issues with unplated / *_altform-unplated.png icons (or in general scaled resources) for Windows Bridge apps?

Scaled (e.g. *.scale-100.png) resources seem to get fully ignored for my Desktop Bridge app even though it works fine UWP apps.

Interminable notifications

I built step 4 and ran it once. After closing the app, I'm now getting toast notifications every 10-20 minutes telling me my status is "available." I've killed every running process Windows would allow me to, and rebooted, and it continues. What is the DLL, service, or process that is causing this, so I can shut it down?

ETA: Nothing Windows restore couldn't fix.

[StoreSample] An error Occured

I get the: "update AppxManifest.xml". I published the app to windows store, so app identity can't be wrong. ( the manifest is checked by that process ). Also I have 2 add-ons "Consumable (Store-managed)" in this app.
Also I added using Windows.ApplicationModel and checked if all the data from the manifest is correct.

PS: after "StoreContext storeContext = StoreContext.GetDefault();" storeContext is still null.

EndInvoke throws property not found exception

6.0.2,

myPowerShell.EndInvoke(ayncResult);

System.Management.Automation.RemoteException: 'The property 'OperationalStatus' cannot be found on this object. Verify that the property exists.

windows.fulltrustprocess

I see that this SDK entension is not recognized in VS2015 update 3. I'm using latest Win10 14383 SDK to debug this sample. Can you please help?
<desktop:Extension Category="windows.fullTrustProcess" Executable="BackgroundProcess.exe" />

Thanks!

Error C1107 compiling UWPWrappers

Compiling UWPWrappers of VB6withXaml project an Error C1107 occurs.

Below the complete error message
"could not find assembly 'platform.winmd': please specify the assembly search path using /AI or by setting the LIBPATH environment variable "

AppServiceConnection.OpenAsync() retrun wrong status

First I try the code as following:
var connection = new AppServiceConnection();
connection.AppServiceName = "RegistrationService";
connection.PackageFamilyName = TargetPackageFamilyName;
var connectionStatus = await connection.OpenAsync();
But I got the error status "AppNotInstalled".

I replace TargetPackageFamilyName to another UWP App's PackageFamilyName, and run "connection.OpenAsync()" again. I can get the correct status "Success".

And I replace the code as following:
Launcher.QueryUriSupportAsync(uri, LaunchQuerySupportType.Uri, TargetPackageFamilyName)
I can get the status "Available" and launched success.

Occurrence of the current computer environment is Windows 10 15063.250.

I try to uninstall the target UWP App, and run "connection.OpenAsync()" again. I got the error status "AppServiceUnavailable" and found that target UWP App didn't completely be removed in "C:\Program Files\WindowsApps".
Try to update Windows OS to 15063.674, and reinstall the target UWP App, the problem still exist.
Please help me to resolve the issue. Thanks.

Windows 10 SDK 10.0.14342.0

Where can I get Windows 10 SDK 10.0.14342.0?

Unless Im missing something, Insider Preview page still only has a link for

Windows 10 SDK 10.0.14332.0

Wont let me build without it.

Thx!

DesktopBridgeToUWP-Samples-master>AppServiceBridgeSample

In AppServiceBridgeSample , Package.appxmanifest showing an error at <desktop:Extension Category="windows.fullTrustProcess" Executable="BackgroundProcess.exe" /> and <rescap:Capability Name="runFullTrust" />.
Please help to resolve the issue.

package-level extension

In the WinformAppService example, the README.MD mentioned that:

"This component gets activated out-of-proc to the main application process, so we also need to declare a package-level extension to explain to the system how the class will get activated."

But I can't find more detail about the package level extension.

Also notice that the vcxproj file missing the Package.StoreAssociation.xml, is that related?

AppServiceBridgeSample

Hello!
In AppServiceBridgeSample BackgroundProcess sends a message (response) to UWP, if a corresponding request is received... I have modified this sample. So BackgroundProcess communicates with another process (win32host), using pipes. So there is a thread, which BackgroundProcess uses to read messages from win32host, convert received data to ValueSet and redirect it to UWP using SendMessageAsync method of connection object. Also I have added corresponding RequestReceived handler to connection of UWP programm. It works fine, but I have a question about connection object of BackgroundProcess. Is it thread safe? I mean, is it normal that this object can be used by two threads at the same time? I assume, that the first thread uses it on Connection_RequestReceived, and the second thread (which reads responses from win32host) uses SendMessageAsync method of this object. Could you explain me this moment? And in which thread event handlers of connection object are executed? May be I missed something in the documentation...

request a sample of 'desktop2:ThumbnailHandler'

I am implementing ThumbnailHandler in C ++ and try to distribute desktop applications with APPX.
However, although the application association works fine, ThumbnailHandler did not work.
I would like to make APPX with thumbnail handlers like 'Paint.Net' (on Microsoft Store).

I would like a sample of a thumbnail handler for dummy extension.
Thank you for your consideration.

AppServiceBridgeSample - Can't access BackgroundProcess.exe

Building and deploying works. When I click on "Launch Background Process" I get a message box (see attachement)

I am the administrator of my machine. Is there anything I have to set/change, so the uwp can launch the background process?

image

SecondaryTileSample NOT work, win10 1703, OS Build 15063.1387, VS2017

1>------ Rebuild All started: Project: PhotoStoreDemo, Configuration: Debug Any CPU ------
1> PhotoStoreDemo -> d:$ABC$\SecondaryTileSample\PhotoStoreDemo\bin\Debug\PhotoStoreDemo.exe
2>------ Rebuild All started: Project: MyDesktopApp.Package, Configuration: Debug x86 ------
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(2492,5): warning APPX0104: Certificate file 'MyDesktopApp.Package_TemporaryKey.pfx' not found.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(2492,5): warning APPX0107: The certificate specified is not valid for signing. For more information about valid certificates, see http://go.microsoft.com/fwlink/?LinkID=241478.
2>C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\Microsoft\VisualStudio\v15.0\AppxPackage\Microsoft.AppXPackage.Targets(2608,5): warning : This project uses the 'runFullTrust' capability. You should use the Windows Application Packaging Project to produce the store and sideload packages. See https://go.microsoft.com/fwlink/?linkid=871803 for more information.
2>Done building project "MyDesktopApp.Package.jsproj".
3>------ Rebuild All started: Project: PhotoStoreDemo.AppxDebug, Configuration: Debug Any CPU ------
3>d:$ABC$\SecondaryTileSample\PhotoStoreDemo.AppxDebug\PhotoStoreDemo.AppxDebug.vsdproj(61,5): error : LayoutFile does not exist [d:\PhotoStoreDemo.exe]
========== Rebuild All: 2 succeeded, 1 failed, 0 skipped ==========

VB6 With XAML Sample: toast always create a new instance of app instead of resume the existing app

Hello,
I run this app: https://www.microsoft.com/vi-vn/p/vb6-app-with-xaml-sample/9n191ncxf2f6?rtc=1&activetab=pivot:overviewtab
to generate toast notification. Then I click on the notification, but it launches a new instance of the app instead of resuming from then existing app.
Could you please let me know why it happened? and how to fix this?
I want to integrate push notification into my Desktop bridge app and have the same problem.

Thank in advise!

Cannot find 'Windows.ApplicationModel' Reference in JourneyAcrossTheBridge_Build2017Edition\Step2

No code change, just clone and build. Hit Build errors when trying to compile JourneyAcrossTheBridge_Build2017Edition\Step2

DesktopBridgeToUWP-Samples\Samples\JourneyAcrossTheBridge_Build2017Edition\Step2

using Windows.ApplicationModel.Payments;

Severity Code Description Project File Line Suppression State
Error CS0234 The type or namespace name 'ApplicationModel' does not exist in the namespace 'Windows' (are you missing an assembly reference?) Step2 - Windows Forms D:\Prototype\DesktopBridgeJourney\Step2\WindowsFormsApp\Form1.cs 26 Active

Missing dependency after deploying the app

DesktopBridgeToUWP-Samples/Samples/JourneyAcrossTheBridge_Build2017Edition/Step2/

I can complied and run (ctrl + F5) in Visual Studio.

But After I deploy the app, it cannot run from app list. It shows an empty form and disappears after a few seconds.

On another machine, I can see the exception:
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'WindowsFormsApp3' or one of its dependencies. The system cannot find the file specified.

UWP Systray - cannot find reference

Hi, thanks for the samples. I have a reference problem in the UWP Systray sample
In SysSystrayComponent project
Windows.ApplicationModel; Windows.ApplicationModel.Core; Windows.ApplicationModel.AppService; Windows.Foundation.Collections;
Cannot be found in SystrayApplicationContext class.
Thanks

Can't debug WinformsOutOfProcessWinRTComponent -- looking for Brokered Component alternative

I have a working Brokered Component along the lines of the MSFT article here. I have also read Adam Braden's recent post "Calling WinRT Components from a Win32 process via the Desktop Bridge" here, which references the WinformsOutOfProcessWinRTComponent sample.

I have built the sample but get an error: "The application appears to already be running" when trying to launch for debug. This is with VS 2017 15.4.0 Preview 1.0 and SDK 16210. I have tried killing the COM Surrogate, and even rebooting, to no avail.

The sample isn't quite my use case however, and uses a hand-rolled COM DLL. I am ultimately looking for is some sample or walk-though that consists of:

  • A UWP C# application containing the UX inside the app container
  • A WRT C++/CX component containing some non-UX application logic that runs outside the app container "full trust"

A WRT component running outside the sandbox that returned "hello" from a method would do.

The app won't be in the store, because the WRT component requires verboten win32 calls. How might I achieve this? The article mentions "metadata marshalling" but it is commented out in the appxmanifest here. I think the pieces are there, but I am having trouble putting them together. Any help appreciated.

Desktop App Migration

I see that Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\PreviousPhotoStore") == false. If you haven't created the "PreviousPhotoStore" folder, how can you migrate the user data?

Cannot clone and build AppServiceBridgeSample on VM Win 10 + VS 2017 Community edition

  1. I downloaded https://developer.microsoft.com/en-us/windows/downloads/virtual-machines for VirtualBox. Unpack, import and run the VM.
  2. Run VS Installer and update to the latest version: 15.7.4
  3. Install TortoiseGit + Git and clone this repository
  4. Launch VS 2017, log in with my MSDN/VS account.
  5. Open the AppServiceBridgeSample (C#) solution and, for UWP, VS update is required, so I target the latest UWP SDK: v1803 (10.0; Build 17134).
  6. If I look at the BackgroundProcess's References, the Windows has warning icon.
  7. When I build it [Config: DEBUG; CPU: Any], then it reports 5 errors:
Severity	Code	Description	Project	File	Line	Suppression State
Error	CS0234	The type or namespace name 'Collections' does not exist in the namespace 'Windows.Foundation' (are you missing an assembly reference?)	BackgroundProcess	C:\git\DesktopBridgeToUWP-Samples\Samples\AppServiceBridgeSample\cs2\BackgroundProcess\Program.cs	16	Active
Error	CS0234	The type or namespace name 'ApplicationModel' does not exist in the namespace 'Windows' (are you missing an assembly reference?)	BackgroundProcess	C:\git\DesktopBridgeToUWP-Samples\Samples\AppServiceBridgeSample\cs2\BackgroundProcess\Program.cs	17	Active
Error	CS0246	The type or namespace name 'AppServiceConnection' could not be found (are you missing a using directive or an assembly reference?)	BackgroundProcess	C:\git\DesktopBridgeToUWP-Samples\Samples\AppServiceBridgeSample\cs2\BackgroundProcess\Program.cs	23	Active
Error	CS0246	The type or namespace name 'AppServiceConnection' could not be found (are you missing a using directive or an assembly reference?)	BackgroundProcess	C:\git\DesktopBridgeToUWP-Samples\Samples\AppServiceBridgeSample\cs2\BackgroundProcess\Program.cs	79	Active
Error	CS0246	The type or namespace name 'AppServiceRequestReceivedEventArgs' could not be found (are you missing a using directive or an assembly reference?)	BackgroundProcess	C:\git\DesktopBridgeToUWP-Samples\Samples\AppServiceBridgeSample\cs2\BackgroundProcess\Program.cs	79	Active

On my desktop, I have VS 2017 Pro, and I'm able to clone and build with no error.

  1. I tried to reference C:\Program Files (x86)\Windows Kits\10\UnionMetadata\Facade\Windows.WinMD
    which reduced the errors down to 3:
Severity	Code	Description	Project	File	Line	Suppression State
Error	CS0246	The type or namespace name 'AppServiceConnection' could not be found (are you missing a using directive or an assembly reference?)	BackgroundProcess	C:\git\DesktopBridgeToUWP-Samples\Samples\AppServiceBridgeSample\cs\BackgroundProcess\Program.cs	23	Active
Error	CS0246	The type or namespace name 'AppServiceConnection' could not be found (are you missing a using directive or an assembly reference?)	BackgroundProcess	C:\git\DesktopBridgeToUWP-Samples\Samples\AppServiceBridgeSample\cs\BackgroundProcess\Program.cs	79	Active
Error	CS0246	The type or namespace name 'AppServiceRequestReceivedEventArgs' could not be found (are you missing a using directive or an assembly reference?)	BackgroundProcess	C:\git\DesktopBridgeToUWP-Samples\Samples\AppServiceBridgeSample\cs\BackgroundProcess\Program.cs	79	Active

9.When I copy over the folder [which built OK] from my desktop to VM, then it builds OK, too.

[10. I made changes to this solution and when I check in and out from repository, I get the same build problems on VM but not my desktop.]

So, my questions are: is this problem specific to VS2017 Community edition or just VM issue [only on VirtualBox?]? Or is there some setup/config needed that's missing in the VM environment?

AppServiceBridgeSample doesn't work with final Windows 10 AU build and SDK

Tried loading this solution with the Windows 10 AU SDK and got errors about missing components (from a different build SDK I don't have installed). After manually editing the UWP csproj file to change the version numbers to the AU release number (14393) it was able to load, however the background app fails with:

An exception of type 'System.InvalidOperationException' occurred in BackgroundProcess.exe but was not handled in user code

Additional information: The process has no package identity. (Exception from HRESULT: 0x80073D54)

This occurs on the following line:
connection.PackageFamilyName = Windows.ApplicationModel.Package.Current.Id.FamilyName;

Scratch that, the second part came from the fact that when the UWP project didn't load initially VS set the background app as the startup project so when I hit F5 it tried to run as a normal Win32 app instead of launching the UWP app which would then start the background app. So there's only one issue here and that's the build numbers in the UWP.csproj file need to be updated to the final RTM.

How to support kiosk mode

I generated the UWP application package through the MSIX Packaging Tool or the Desktop APP Converter. After installing this package, we cannot find this application from the Kiosk App list during the process of setting the Kiosk mode.
Converted UWP application how to support kiosk mode?

Create app packages in release mode

When I try to create the app packages in release mode I get the following errors:

1>MakeAppx : error : Manifest validation error: Line 36, Column 64, Reason: The file name "BackgroundProcess.exe" declared for element "[local-name()='Applications']/[local-name()='Application']/[local-name()='Extensions']/[local-name()='Extension' and not(@category='windows.backgroundTasks' or @category='windows.appService')]" doesn't exist in the package.
1>MakeAppx : error : Manifest validation error: Line 36, Column 64, Reason: The file name "BackgroundProcess.exe" declared for element "[local-name()='Applications']/[local-name()='Application']/[local-name()='Extensions']/[local-name()='Extension' and @category='windows.fullTrustProcess']" doesn't exist in the package.
1>MakeAppx : error : Package creation failed.
1>MakeAppx : error : 0x80080204 - The specified package format is not valid: The package manifest is not valid.

Compiling the code in release mode works, also debug mode works fine all the way.

Has anyone a solution for this?

Thanks,
Andreas

Using AppService with runFullTrust Desktop bridge and allowElevation

I have:

  • An UWP App
  • A Console App (.NET Framework)
  • A Package project

This is (part of) the package.appxmanifest that tells you how it is setup:

  <Dependencies>
    <TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
    <TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
  </Dependencies>

  <Resources>
    <Resource Language="x-generate"/>
  </Resources>

  <Applications>
    <Application Id="App"
      Executable="$targetnametoken$.exe"
      EntryPoint="$targetentrypoint$">
      <uap:VisualElements
        DisplayName="CularBytes W10 App"
        Description="Package"
          .... />
      </uap:VisualElements>
      <Extensions>
        <uap:Extension Category="windows.appService">
          <uap:AppService Name="SampleInteropService" />
        </uap:Extension>
        <desktop:Extension Category="windows.fullTrustProcess" Executable="CularBytes.App.WindowsApp.Bridge\CularBytes.App.WindowsApp.Bridge.exe"/>
      </Extensions>
    </Application>
  </Applications>

  <Capabilities>
    <Capability Name="internetClient" />
    <rescap:Capability Name="runFullTrust" />
    <rescap:Capability Name="allowElevation" />
  </Capabilities>

As you can see I want to run it in the same process.

The Console app contains an app.manifest, so that I can define elevated permissions needed:

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

Within the Console app I start the AppService connection:

        private static async void InitializeAppServiceConnection()
        {
            AppServiceConnection Connection = new AppServiceConnection();
            Connection.AppServiceName = "SampleInteropService";
            Connection.PackageFamilyName = Package.Current.Id.FamilyName;
            Connection.RequestReceived += Connection_RequestReceived;
            Connection.ServiceClosed += Connection_ServiceClosed;

            AppServiceConnectionStatus status = await Connection.OpenAsync();
            if (status != AppServiceConnectionStatus.Success)
            {
                // something went wrong ...
                Console.WriteLine("status not success on connecting, status:" + status + " pacakgeName:" + Connection.PackageFamilyName);

            }
            else
            {
                Console.WriteLine("Status success!");
            }
        }

Somewhere from the UWP app, I start the FullTrustProcess like documented:

        if (ApiInformation.IsApiContractPresent("Windows.ApplicationModel.FullTrustAppContract", 1, 0))
        {
            await FullTrustProcessLauncher.LaunchFullTrustProcessForCurrentAppAsync();
        }

The console app starts like expected but the connection is not successful, console.writeline prints:

status not success on connecting, status:Unknown pacakgeName:df84c6a8....

I verified that the packageName is correct.

When I remove <rescap:Capability Name="allowElevation" /> from Package.appxmanifest and <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> from app.manifest, then the connection is successful!

So why, due elevated client-app, is the connection not working?

I need elevated permissions to do more actions from the console app. Don't bother asking what that is, I know I will have Microsoft Store limitations, etc. Please help me solve this issue.

Do I need to use another packageName? Is that changed when using allowElevation? How can I find this out?

when run SystrayComponent.exe , click " open uwp" then an exception

有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。

************** 异常文本 **************
System.InvalidOperationException: 该进程没有程序包标识符。 (异常来自 HRESULT:0x80073D54)
在 Windows.ApplicationModel.Package.get_Current()
在 SystrayComponent.SystrayApplicationContext.d__5.MoveNext() 位置 D:\codes\cs\DesktopBridgeToUWP-Samples\Samples\UWP Systray\SystrayComponent\SystrayApplicationContext.cs:行号 53
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.CompilerServices.AsyncMethodBuilderCore.<>c.b__6_0(Object state)

Update for VS2017

Building with Visual Studio 2017 doesn't work: many errors.
Can you please update the solution for VS2017?

Does not run, References missing

Hi,

I tried to debug the application but I got so many errors, for solve them I update the windows 10 , update the SDK UWP and refresh and reinstalled the nugets .... but I have the same problems u.u
image
northwinddemo - microsoft visual studio

Element Not Found

Hi team !

I have an error, when trying to run the ``HelloWorldConsoleSample` application

The error occurs on runtime on the TileUpdateManager.CreateTileUpdaterForApplication() method
The exception is :

System.Exception: 'Element not found. (Exception from HRESULT: 0x80070490)'

Actually, I have the last VS 2017 (version 15.2 (26430.6)) installed.
I have installed the last Windows 10 SDK as well.

And I have no InnerException ...

Assigned Access Mode not support for DesktopAppTransition

set up a single-app kiosk for PhotoStoreDemo App.
When the user logs in, Windows attempts to run the application (the blue window appears with the loading spinner). The whole screen flickers for a minute or so and then an error message appears stating:

"We weren't able to start your app. Press Ctrl + Alt + Del to sign out or contact your system admin. For more info, search online for error code: 0x80270254".

DesktopBridgeToUWP

Hi,

Thank you for your sample code , is there any code/knowledge on how to do DesktopBridge on javascript version? My code is on hosted web app and want to call Desktop App to get data.

Right now what I do is set appService to be StartPage="js/appservice.js"
and after UWP ( index.html ) call to Desktop via launchFullTrustProcessForCurrentAppAsync it open WPF App , after that WPF app call back on AppServiceConnection and open the connection to UWP App on StartPage ( appservice.js ) but my deadend here since my index.html cannot get anything from appservice.js , even in appservice.js show messagebox that come from WPF it still not show.
Did I missing some concept or how I can make it work

Thank you,
Tour

How to use Desktop Bridge in UWP Background Task?

I have a desktop application which I need to use and communicate from Background Task. I tried various solution but no luck.
Is it possible to communicate with desktop bridge app through App Service from UWP Background Task? And if yes how do i achieve that? Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.