Free Code Snippets in C#, Net Framework, Office 365, ASP.Net,WPF, Visual Studio, SQL Server, Antivirus free
#

Manually converting WPF, Winforms to UWP
 
 
Instructions Tutorial
# Bridge, Win32, Convert, DAC, WPF, WinForms
 
Steps:
 
Step 1: Expand the solution project
 
New project
 
Mark the Windows 32 Solution in the project (WPF or Windows Forms WinForms)
Then add an additional project to the project under Add-> New Project

 
Step 2: Apply uwpApp
Under Add New Project-> Other Languages-> Javascript
Blank App (Universal Windows)
Name the new project with uwpApp

 
Step 3: Transfer exe? Then create a win32 subfolder in the uwpApp javascript project
And copy the output files of the bin directory from the WPF / Winforms project to uwp

 
Step 4: Embed exe
These files must be included in the project

 
Step 4: customize package.appxmanifest
Then you have to adjust the package.appxmanifest in the uwpApp
To do this, highlight the file package.appxmanifest in the solution and open it with code

 
 
Template of the texts of Microsoft
Then you have to transfer some lines into the new appxmanifest structure. The instructions can be found at
[Lnk "https://docs.microsoft.com/de-de/windows/uwp/porting/desktop-to-uwp-packaging-dot-net" /]

 
Own template:
Here is the ScreenShot copy of my WPF project ..
So you just need to exchange the automatically generated appxmanifest file with the new one ..

 
Here is my file from a WPF project
package.appxmanifest

<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities" IgnorableNamespaces="uap rescap mp">
<Identity Name="Microsoft-Programmierer.d.ScreenShottoClipBoard" Version="1.1.15.0" Publisher="CN=8B3F8A59-EDFE-45E9-AD40-11C00C331433" />
<mp:PhoneIdentity PhoneProductId="832b636e-8b8c-4836-ab55-4ed8b265c421" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
<DisplayName>ScreenShot to ClipBoard</DisplayName>
<PublisherDisplayName>Microsoft-Programmierer.de</PublisherDisplayName>
<Logo>Assets\Store\storelogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14393.0" MaxVersionTested="10.0.14393.0" />
</Dependencies>
<Capabilities>
<rescap:Capability Name="runFullTrust" />
</Capabilities>
<Resources>
<Resource Language="x-generate" />
</Resources>
<Applications>
<Application Id="ScreenCaptureToClipboard" Executable="win32\ScreenCapture_to_Clipboard.exe" EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements DisplayName="ScreenShot to Clipboard" Description="ScreenShot to Clipboard" BackgroundColor="transparent" Square150x150Logo="Assets\Store\SampleAppx.150x150.png" Square44x44Logo="Assets\Store\SampleAppx.44x44.png">
<uap:DefaultTile ShortName="ScreenShot to Clipboard" Square310x310Logo="Assets\Store\LargeTile.png" Wide310x150Logo="Assets\Store\WideTile.png" Square71x71Logo="Assets\Store\SmallTile.png">
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="square310x310Logo" />
</uap:ShowNameOnTiles>
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\Store\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
</Package>

 
Step 5: Insert the package.appxmanifest blank and template
So just clear the appxmanifest and insert the new xml structure and customize it

 
Step 6: Enter the application ID
The name can be found under the WPF / Windows 32 project as the assembly name under the application properties, without underscores and without spaces

 
AssemblyName, without underscores and without spaces

 
Entry of WPF project: wpf_Desktop_Arranger
In appxmanifest

<Applications>
<Application Id="wpfDesktopArranger" ..

 
Step 7: Enter the Exe as start point
Enter the exe as an executable point
 
Then load the WPF / Windows 32 exe file under executable.

 
So

<Applications>
<Application Id="wpfDesktopArranger" Executable="win32\wpf_Desktop_Arranger.exe" EntryPoint="Windows.FullTrustApplication">

 
Step 8: Enter the display name
The other entries will be accepted accordingly

<uap:VisualElements DisplayName="Desktop Arranger" Description="Desktop Arranger"

 

 
Step 9: Attach the store
Then close the file and connect it to the Windows Store

 
And then connect a project

 
 
After the transfer you will find the entered values ​​in the display

 
And there is additionally created a file in the uwp project, which contains the store connection
File: uwpApp_StoreKey.pfx with the certificate

 
And if one then the package.appxmanifest file is checked, one finds the change of the ID even as an entry

 
Step 10: Customize icons
Customize visual elements icons
Then open the package.appxmanifest file with the View Designer

 
Step 10a: Error in Application because of Win32
When you first open, an error appears in the Application area under Start Page.
Since this is a Windows 32 application, which accesses the exe file, the uwp error remains here.

 
Step 10 b: Customize icons under Visual Assets
Create icons under Visual Assets

 
Step 11: Create icons with Asset Generator
I always use a Word file as .htm to create the icons and use the image files.

 
 
In Source you enter the icon file, like the image003.png.
As format jpg, pdf, ai, png can be used.
With the button: Generate all necessary images are created.

 
Afterwards, all necessary image files are inserted into the project
In the destination folder, here Assets \ Store

 
 
Step 12: Create output for store
Then create an output file for the app store.
The function can be found under Menu-> Project-> Create App Packages

 
Test: After automatic creation
After the Create Your Packages you have to pass the package with the Certification Test Kit
 
Here is a mistake, which is not true,

 
Error message:
Workaround Bridge Windows 32
In Windows 32 Bridge Apps, the image size is apparently not recognized correctly in the Certifiction Kit or incorrectly created in the Image Generator.
You can simply skip this error and still upload the file to the store.

 
 
Upload the file in the Windows Store

 
This file can then be placed under
Transmit-> Transmission-> Packages (Link)

 

 
After this, a loading bar appears, and the file is then analyzed immediately.

 
If you are on Windows Store as a developer for Windows Bridge Windows 32 is unlocked, then FINAL now appears as correct

 
 
 
 
 
Mobile
»
Manually converting WPF, Winforms to UWP
»
Include Windows 10 UWP in Win32 WPF Winforms
»
Instructions for DAC Desktop App Converter
»
Desktop Bridge Debugging Project and Not Desktop to UWP Packaging Project VS17
»
Error in Appxmanifest: rescap: Capability has invalid child element
»
VS BuildError: Manifest references file win32 ..Exe which is not part of the payload
»
DesktopAppConverter: E_FEATURE_NOT_AVAILABLE: Required Windows Feature Containers is not Available on your system.
»
Desktop App Converter to bring WPF to Windows Store

.

Contact for Jobs, Project Requests: raimund.popp@microsoft-programmierer.de