Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
<SelfContained>true</SelfContained>
<Platforms>AnyCPU;x86</Platforms>
</PropertyGroup>

<ItemGroup>
<FrameworkReference Include="Microsoft.DesktopUI" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\WindowsFormsApp1\WindowsFormsApp1.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>

<Target Name="__GetPublishItems" DependsOnTargets="ComputeFilesToPublish" Returns="@(_PublishItem)">
<ItemGroup>
<_PublishItem Include="@(ResolvedFileToPublish->'%(FullPath)')" TargetPath="%(ResolvedFileToPublish.RelativePath)" OutputGroup="__GetPublishItems" />
<_PublishItem Include="$(ProjectDepsFilePath)" TargetPath="$(ProjectDepsFileName)" />
<_PublishItem Include="$(ProjectRuntimeConfigFilePath)" TargetPath="$(ProjectRuntimeConfigFileName)" />
</ItemGroup>
</Target>
</Project>
18 changes: 18 additions & 0 deletions windowsforms/MSIX-WindowsForms/CoreWinFormsApp1/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Windows.Forms;

namespace CoreWinFormsApp1
{
class Program
{
[STAThread]
static void Main()

{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new WindowsFormsApp1.Form1());

}
}
}
60 changes: 60 additions & 0 deletions windowsforms/MSIX-WindowsForms/MSIX-WindowsForms.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2041
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsFormsApp1", "WindowsFormsApp1\WindowsFormsApp1.csproj", "{F9E02CDA-E0B5-4E43-82EF-64EF405CB213}"
EndProject
Project("{C7167F0D-BC9F-4E6E-AFE1-012C56B48DB5}") = "WindowsFormsApp1.Package", "WindowsFormsApp1.Package\WindowsFormsApp1.Package.wapproj", "{FA0D80AB-4FC9-40D6-AA5F-E50044ED2C5C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CoreWinFormsApp1", "CoreWinFormsApp1\CoreWinFormsApp1.csproj", "{BF70C62C-99B5-47C5-B527-A4AD1338723E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C3AFF30C-502F-4A5B-BF49-785A9F4C4089}"
ProjectSection(SolutionItems) = preProject
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F9E02CDA-E0B5-4E43-82EF-64EF405CB213}.Debug|x64.ActiveCfg = Debug|Any CPU
{F9E02CDA-E0B5-4E43-82EF-64EF405CB213}.Debug|x64.Build.0 = Debug|Any CPU
{F9E02CDA-E0B5-4E43-82EF-64EF405CB213}.Debug|x86.ActiveCfg = Debug|x86
{F9E02CDA-E0B5-4E43-82EF-64EF405CB213}.Debug|x86.Build.0 = Debug|x86
{F9E02CDA-E0B5-4E43-82EF-64EF405CB213}.Release|x64.ActiveCfg = Release|Any CPU
{F9E02CDA-E0B5-4E43-82EF-64EF405CB213}.Release|x64.Build.0 = Release|Any CPU
{F9E02CDA-E0B5-4E43-82EF-64EF405CB213}.Release|x86.ActiveCfg = Release|x86
{F9E02CDA-E0B5-4E43-82EF-64EF405CB213}.Release|x86.Build.0 = Release|x86
{FA0D80AB-4FC9-40D6-AA5F-E50044ED2C5C}.Debug|x64.ActiveCfg = Debug|x64
{FA0D80AB-4FC9-40D6-AA5F-E50044ED2C5C}.Debug|x64.Build.0 = Debug|x64
{FA0D80AB-4FC9-40D6-AA5F-E50044ED2C5C}.Debug|x64.Deploy.0 = Debug|x64
{FA0D80AB-4FC9-40D6-AA5F-E50044ED2C5C}.Debug|x86.ActiveCfg = Debug|x86
{FA0D80AB-4FC9-40D6-AA5F-E50044ED2C5C}.Debug|x86.Build.0 = Debug|x86
{FA0D80AB-4FC9-40D6-AA5F-E50044ED2C5C}.Debug|x86.Deploy.0 = Debug|x86
{FA0D80AB-4FC9-40D6-AA5F-E50044ED2C5C}.Release|x64.ActiveCfg = Release|x64
{FA0D80AB-4FC9-40D6-AA5F-E50044ED2C5C}.Release|x64.Build.0 = Release|x64
{FA0D80AB-4FC9-40D6-AA5F-E50044ED2C5C}.Release|x64.Deploy.0 = Release|x64
{FA0D80AB-4FC9-40D6-AA5F-E50044ED2C5C}.Release|x86.ActiveCfg = Release|x86
{FA0D80AB-4FC9-40D6-AA5F-E50044ED2C5C}.Release|x86.Build.0 = Release|x86
{FA0D80AB-4FC9-40D6-AA5F-E50044ED2C5C}.Release|x86.Deploy.0 = Release|x86
{BF70C62C-99B5-47C5-B527-A4AD1338723E}.Debug|x64.ActiveCfg = Debug|Any CPU
{BF70C62C-99B5-47C5-B527-A4AD1338723E}.Debug|x64.Build.0 = Debug|Any CPU
{BF70C62C-99B5-47C5-B527-A4AD1338723E}.Debug|x86.ActiveCfg = Debug|x86
{BF70C62C-99B5-47C5-B527-A4AD1338723E}.Debug|x86.Build.0 = Debug|x86
{BF70C62C-99B5-47C5-B527-A4AD1338723E}.Release|x64.ActiveCfg = Release|Any CPU
{BF70C62C-99B5-47C5-B527-A4AD1338723E}.Release|x64.Build.0 = Release|Any CPU
{BF70C62C-99B5-47C5-B527-A4AD1338723E}.Release|x86.ActiveCfg = Release|x86
{BF70C62C-99B5-47C5-B527-A4AD1338723E}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E34C6E40-45E2-459E-AF10-FE4E6D3319D3}
EndGlobalSection
EndGlobal
51 changes: 51 additions & 0 deletions windowsforms/MSIX-WindowsForms/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# MSIX Windows Forms Core Application

This sample shows how to use the Windows Packaging Project to package a WinForms application running on .NET Core 3.0.

## Pre-requisites

To use the Windows Packaging Project (wapproj) you need to install the Universal Windows workload in Visual Studio.

To produce `MSIX` packages, you must have the **Windows 10 October 2018 SDK** (aka 10.0.17763): otherwise, the generated package will have the `APPX` extension.

To install MSIX packages you need the **Windows 10 October 2018 Update**

## Customize the Packaging Project

Currently, the packaging project does not support .NET Core applications. As a workaround, we updated the project files to call the `publish` target to produce a self-contained app, and to fix the manifest entry point.

In the .NET Core csproj file add:

```xml
<Target Name="__GetPublishItems" DependsOnTargets="ComputeFilesToPublish" Returns="@(_PublishItem)">
<ItemGroup>
<_PublishItem Include="@(ResolvedFileToPublish->'%(FullPath)')" TargetPath="%(ResolvedFileToPublish.RelativePath)" OutputGroup="__GetPublishItems" />
<_PublishItem Include="$(ProjectDepsFilePath)" TargetPath="$(ProjectDepsFileName)" />
<_PublishItem Include="$(ProjectRuntimeConfigFilePath)" TargetPath="$(ProjectRuntimeConfigFileName)" />
</ItemGroup>
</Target>
```

In the .wapproj file modify the `ProjectReference` element:
```xml
<ItemGroup>
<ProjectReference Include="..\CoreWinFormsApp1\CoreWinFormsApp1.csproj" SkipGetTargetFrameworkProperties="true" Properties="RuntimeIdentifier=win-x86;SelfContained=true" />
</ItemGroup>
```

And add the targets:
```xml
<PropertyGroup>
<PackageOutputGroups>@(PackageOutputGroups);__GetPublishItems</PackageOutputGroups>
</PropertyGroup>

<Target Name="_ValidateAppReferenceItems" />
<Target Name="_FixEntryPoint" AfterTargets="_ConvertItems">
<PropertyGroup>
<EntryPointExe>CoreWinFormsApp1\CoreWinFormsApp1.exe</EntryPointExe>
</PropertyGroup>
</Target>
<Target Name="PublishReferences" BeforeTargets="ExpandProjectReferences">
<MSBuild Projects="@(ProjectReference->'%(FullPath)')" BuildInParallel="$(BuildInParallel)" Targets="Publish" />
</Target>
```
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BundleArtifacts/
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?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 mp rescap">
<Identity Name="WindowsFormsApp1.Package" Publisher="CN=rmpablos" Version="0.0.3.0" />
<Properties>
<DisplayName>WindowsFormsApp1 MSIX Sample</DisplayName>
<PublisherDisplayName>rmpablos</PublisherDisplayName>
<Logo>Images\StoreLogo.png</Logo>
</Properties>
<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="WindowsFormsApp1" Description="WindowsFormsApp1 MSIX Sample" BackgroundColor="transparent" Square150x150Logo="Images\Square150x150Logo.png" Square44x44Logo="Images\Square44x44Logo.png">
<uap:DefaultTile Wide310x150Logo="Images\Wide310x150Logo.png" Square310x310Logo="Images\LargeTile.png" Square71x71Logo="Images\SmallTile.png">
</uap:DefaultTile>
<uap:SplashScreen Image="Images\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '15.0'">
<VisualStudioVersion>15.0</VisualStudioVersion>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x86">
<Configuration>Debug</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x86">
<Configuration>Release</Configuration>
<Platform>x86</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|AnyCPU">
<Configuration>Debug</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|AnyCPU">
<Configuration>Release</Configuration>
<Platform>AnyCPU</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup>
<WapProjPath Condition="'$(WapProjPath)'==''">$(MSBuildExtensionsPath)\Microsoft\DesktopBridge\</WapProjPath>
</PropertyGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.props" />
<PropertyGroup>
<ProjectGuid>fa0d80ab-4fc9-40d6-aa5f-e50044ed2c5c</ProjectGuid>
<TargetPlatformVersion>10.0.17763.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
<DefaultLanguage>en-US</DefaultLanguage>
<PackageCertificateKeyFile>WindowsFormsApp1.Package_TemporaryKey.pfx</PackageCertificateKeyFile>
<GenerateAppInstallerFile>false</GenerateAppInstallerFile>
<AppxAutoIncrementPackageRevision>false</AppxAutoIncrementPackageRevision>
<EntryPointProjectUniqueName>..\CoreWinFormsApp1\CoreWinFormsApp1.csproj</EntryPointProjectUniqueName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AppxBundle>Never</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<AppxBundle>Never</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<AppxBundle>Never</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<AppxBundle>Never</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x86'">
<AppxBundle>Never</AppxBundle>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
<AppxBundle>Never</AppxBundle>
</PropertyGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
<None Include="WindowsFormsApp1.Package_TemporaryKey.pfx" />
</ItemGroup>
<ItemGroup>
<Content Include="Images\*" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\CoreWinFormsApp1\CoreWinFormsApp1.csproj" SkipGetTargetFrameworkProperties="true" Properties="RuntimeIdentifier=win-x86;SelfContained=true" />
</ItemGroup>
<Import Project="$(WapProjPath)\Microsoft.DesktopBridge.targets" />
<PropertyGroup>
<PackageOutputGroups>@(PackageOutputGroups);__GetPublishItems</PackageOutputGroups>
</PropertyGroup>
<Target Name="_ValidateAppReferenceItems" />
<Target Name="_FixEntryPoint" AfterTargets="_ConvertItems">
<PropertyGroup>
<EntryPointExe>CoreWinFormsApp1\CoreWinFormsApp1.exe</EntryPointExe>
</PropertyGroup>
</Target>
<Target Name="PublishReferences" BeforeTargets="ExpandProjectReferences">
<MSBuild Projects="@(ProjectReference->'%(FullPath)')" BuildInParallel="$(BuildInParallel)" Targets="Publish" />
</Target>
<PropertyGroup>
<DebuggerType>CoreClr</DebuggerType>
</PropertyGroup>
</Project>
6 changes: 6 additions & 0 deletions windowsforms/MSIX-WindowsForms/WindowsFormsApp1/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
</configuration>
86 changes: 86 additions & 0 deletions windowsforms/MSIX-WindowsForms/WindowsFormsApp1/Form1.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading