Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reunion Developer Experience #493

Closed
wants to merge 1 commit into from
Closed
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
181 changes: 181 additions & 0 deletions specs/devexperience/DevExperience.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
# Reunion Developer Experience

## 1.0 - Overview
This spec will detail the design of how the Reunion developer experience will work. Through analysis of the current landscape of Windows development, there are a few important items that were found:
1. The Windows Application Packaging (WAP) project increases build time by 40%
2. Requiring the WAP creates a disjointed developer experience, where developers trying to create Win32 apps have a different workflow than UWP developers.
3. Therefore, to provide our customers with the best inner-loop, and to unify the experience for Win32 and UWP developers, we must not require the WAP for our core user scenarios.

If we are to remove the WAP project, we then must ask ourselves the following questions:
1. What kicks in the MSIX Package tooling?
2. Can developers opt-out of the pri generation?
3. How does building a Sparse Package look?
- A Sparse Package is a Win32 app that has identity, but isn’t using MSIX.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite. A 'sparse package' is a package that contains 'footprint' files but no 'content'. It's typically used in conjunction with an ExternalLocation telling Windows where 'content' files can be found.

SUGGESTION: Remove lines 13+14. These (badly) define what a Sparse Package is, but nothing else has definitions -- #1 doesn't define what "MSIX Package" or "MSIX Package tooling" is. #2 doesn't define what "pri" is (P.S. Isn't it PRI?). #4 doesn't define what "unpackaged applications" are.

ALTERNATE SUGGESTION: Change Sparse Package to be a hyperlink to more information e.g.

  1. How does building a Sparse Package1,2 look?

Copy link
Author

@stevenbrix stevenbrix Mar 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite. A 'sparse package' is a package that contains 'footprint' files but no 'content'. It's typically used in conjunction with an ExternalLocation telling Windows where 'content' files can be found.

This may have been worded poorly because it is using an empty msix file. But I think the below definition is simpler to understand. I don't want to leak implementation details in the definition of the feature. All of that should be opaque to the developer.

- This means there is a package.appxmanifest and a SxS manifest
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SxS manifest is NOT required (or even useful in most cases) for a Sparse Package.

This blog post mentions 4 features:

  1. Sparse Package registration
  2. Package 'External Location'
  3. Win32 type RuntimeBehavior (via RuntimeBehavior=win32App)
  4. Activation via CreateProcess (via <msix> in a SxS manifest)

1+2 are conjoined behavior. It's really 2 techniques used together to accomplish one goal: registering a package with Windows but having all its 'content' files live somewhere else, not owned or managed by the MSIX deployment stack. A "Bring Your Own Installer" technique.

3 is an independent feature. It can be used on its own (without 1+2 or 4).

4 is an independent feature. It can be used on its own (without 1+2 or 4).

Moot point as this line should be deleted; see other comment.

4. What to do with the Windows store /start menu assets that aren’t used in unpackaged applications
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is "Windows store /start menu assets"?

The Windows store has a start menu?
Did you mean '...Windows store assets and start menu assets...'?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Microsoft Store is the official name.

5. How does an existing UWP developer move forward and use this?
6. How does an existing WPF or WinForms developer move forward and use this?

## 2.0 – Definitions
- Reunion – The effort to unify the Win32 and UWP platforms
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHANGE: "Project Reunion"

Proper term is "Project Reunion", not "Reunion".

Same comment applies throughout the spec

- Reunion Tooling – MSBuild and VisualStudio tooling used to build Reunion apps.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it "VisualStudio" or "Visual Studio"?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, should be "Visual Studio" - can you provide a suggestion?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, should be "Visual Studio" - can you provide a suggestion?

I'd think global search/replace would do it :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is a "Reunion app"? Sounds like a new type of application (which it's not).

SUGGESTION: "...to build apps using Project Reunion".

- Workflow – The steps a developer will take in Visual Studio to be successful using Reunion.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this doc defining the "Reunion Developer Experience" or the "Reunion Developer Visual Studio Experience"?

Does this doc apply to developers using VSCode? TSE? EMACS? vi? ...

- WAP – A project used to generate an .msix or .msixbundle.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Use the full term, not just the acronym e.g.

- Windows Application Packaging (WAP) - A Visual Studio project...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, feel free to use the suggestion feature so I can merge this in directly :)

- Sparse Package – An unpackaged Win32 app with package Identity via registration of an .msix.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This definition is incorrect in multiple ways. Please see comment above.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this definition incorrect?


## 3.0 Guiding Principles
Below is a list of some guiding principles to ground this proposal
1. Easy for developers to understand.
2. Easy for developers to change between the four different app model types:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't a Packaged Service a 5th "app model type"?

- Unpackaged
- Sparse Package
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an 'app model type'? That's...an interesting definition.

I don't see a definition of what "Unpackaged", "Sparse Package", "Packaged Desktop" and "UWP" are or how they differ. There are assumptions in the doc what these terms mean; it would help if you provided crisp definitions here to prevent ambiguity and reader confusion.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These "app model types" seem a weird way of specifying what a developer wants to achieve.
eg
The app needs to be able to be xcopy deployed = Unpackaged
The app needs to be able to be xcopy deployed but wants to leverage identity = Sparse Package
The app needs to run in the Windows App Container = Packaged Desktop with Trust Level = Partial <-- is this correct?
The app needs to have a modern app lifecycle = UWP packaging <-- Seriously don't call this Universal or UWP.

The names of the app model types should reflect the impact they have on the app, rather than some historic name that's not fully understood by anyone.

- Packaged Desktop
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I make an MSIX whose appxmanifest.xml declares <Application...RuntimeBehavior="packagedClassicApp" TrustLevel="mediumIL"> it's a "Packaged Desktop app?

What about <Application...RuntimeBehavior="packagedClassicApp" TrustLevel="appContainer">? Is it a Packaged Desktop app because RuntimeBehavior=packagedClassicApp, regardless of TrustLevel?

What about <Application...RuntimeBehavior="win32App" TrustLevel="mediumIL">? Is it a Packaged Desktop app if RuntimeBehavior is packagedClassicApp or win32App?

- UWP
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I make an MSIX whose appxmanifest.xml declares <Application...RuntimeBehavior="windowsApp" TrustLevel="appContainer"> it's a "UWP"?

What about <Application...RuntimeBehavior="windowsApp" TrustLevel="mediumIL">? Is it a UWP because RuntimeBehavior=windowsApp, regardless of TrustLevel?

3. Easy for developers to migrate their existing Win32 and UWP apps.
a. Maintain compat with Microsoft.AppxPackage.targets
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'a.'? Should that be '4.'?


## 4.0 Key Design Elements
In order to satisfy principles 2 and 3 above, there are some key design elements which need to be taken into account:
1. A single MSBuild property, `WindowsPackageType`, will enable developers to easily change their application type. It is an enum value with the following four options:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about Service?

- `None`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Elsewhere in the spec (before and after) 'Unpackaged' and 'Win32' terms are used. Please use consistent terminology.

RECOMMENDATION: Pick one term (Unpackaged, Win32 or something else?) and update all mentions to the singular term

- `Sparse`
- `Desktop`
- `Universal`
- Potential future options: `Framework` (for framework package)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Framework isn't a type of app. It's a type of package.

Likewise in the 'future' bucket, an Optional package isn't a type of app, it's a type of package.

Are you really talking about types of apps or rather Visual Studio projects? Calling these types of "apps" and "packages" is confusing.

2. The package.appxmanifest file cannot require changes between Sparse, Packaged Desktop, and UWP. The tooling will generate the appropriate appxmanifest.xml based on the project being built.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These sentences are contradictory. Your intent here is unclear. Can you elaborate?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the tooling support Main packages containing >1 application?1

1 Main and Optional packages can contain 0-100 applications.

3. There must be an Item Template for the package.appxmanifest
4. The default splash screen and start menu assets will be provided by the tooling. The same behavior of preventing store submissions for apps which use these assets will still exist.
5. A migration tool will be provided for migrating projects
- Work for this has started with the https://github.com/dotnet/try-convert tool.
- This tool needs to be updated for .vcxproj.
- This tool will update code, project files, and manifest files
- Update nuget references to WinUI3 supported packages (i.e. Win2D & WCT)
6. The existing Manifest designer tool in VS must work for these projects
7. The existence of a Package.appxmanifest file will enable Packaged Desktop apps by default.
8. The Reunion NuGet package will provide tooling for generating the Sparse Package and Dynamic Dependencies registration code. (link to existing issues)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think this entails?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should also allow the user to disable the build task and customize that code if wanted.

a. [.NET Only] A source generator will be provided to accomplish this
b. [C++ only] A build task will be provided for this
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this targeting Visual Studio or other tools? VSCode? CMake or other instead of VS or MSBuild?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The build task will probably, ultimately, generate source code. It's just that .NET has this capability built-in and calls it source generators.

And +1 on not locking to VS, although one could just manually write that code

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the differing solutions (codegen for .NET, (VS?) build task for C++)?

9. The Reunion meta package will provide tooling for generating typed access to Resource strings for resw resources, similar to how resx works in .NET
a. [.NET Only] A source generator will be provided this.
b. [C++ only] A build task will be provided for this
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why different techniques (codegen + buildtask)?

10. The existing Publish UI will be enabled for creating and publishing app packages to the Microsoft Store.


## 5.0 - Developer Workflow
This section goes into more fine grain detail about the developer experience that will come with developers who are using Project Reunion. It will expand off the Key Design Elements and Principles sections, and articulate where each of those comes into play in the overall story of Reunion.

### 5.1 – Migration and Compat
This section will highlight the basic workflow for developers looking to use Reunion, as well as highlight some basic high-level requirements that the tooling must guarantee. The section on MSIX packaging will go into more detail on how we will simplify the developer story, while maintaining compat at the same time.

#### 5.1.1 - Migrating Existing Win32 Apps
App developers which are migrating existing Win32 Apps will do the following:
1. Install Reunion VSIX
2. Add package reference to Reunion
At this point, the developer can stop and have an unpackaged app, with the ability to use MRT. None of the MSIX package tooling will run, because there is no existence of a Package.appxmanifest file. If the developer would like to create a packaged Desktop app, then they do the following:
3. Add Package.appxmanifest file to the project
After this step, if they’d prefer to create a Sparse Package, they would add this to their project file:
<WindowsPackageType>Sparse</WindowsPackageType>
Question: could we update try convert to give existing Win32 apps Sparse by default?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you asking if the default if <WindowsPackageType> is omitted should be Sparse rather than Desktop?
Or if the tool should automagically add <WindowsPackageType>Sparse</WindowsPackageType> when converting an existing Win32 app?

What is an "existing Win32 app"? Do you mean an existing Win32 "project"?
Aren't there multiple VS project types that would qualify here? Which ones are you thinking?


### 5.1.2 - Migrating Existing UWP Apps
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5.1.1 = Migrating Existing Win32 Apps
5.1.2 = Migrating Existing UWP Apps

What about existing Packaged Desktop apps? VS projects creating DesktopBridge apps are neither Win32 nor UWP. Do you intend to support migrating those?

Existing UWP applications will require being converted to WinUI3 applications first. The following are the steps a developer will run in order to migrate their apps:
1. Run the try-convert tool
a. If the user wants a desktop app, they will then update <WindowsPackageType> in their project file.
2. Fix up any compilation errors that may exist

### 5.1.3 - Other Compat/Migration Concerns
None of the tooling will be WinUI/Reunion specific, and the tooling could be used for all existing UWP apps. However, the hypothesis is that trying to move existing UWP apps to the new tooling pipeline would result in noise and over-complicate the story, as well as require more documentation updates. Therefore, we will not be advertising it as such. However, one of the key components of the tooling will be that it is easily migratable, and therefore we cannot require users to make any changes to their existing build customizations. By design, this forces the tooling to maintain compatibility.

With that being said, one thing that will be supported is users having a mix of old UWP and newer Reunion projects in the same .sln file or repository. This will allow developers to migrate slowly at their own pace. In order to do this, the task assemblies that ship as part of Reunion must be renamed. Otherwise, MSBuild will mistakenly use the wrong assemblies.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...the task assemblies that ship as part of Reunion must be renamed.

Could you elaborate? What is a 'task assembly'? Do these exist today in Reunion?

Might be my VSfu is weak :-) but I'm not following this issue

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Task assemblies are the .NET assemblies that contain VS build task code.


### 5.1.4 – Helping Developers call the right APIs
Many WinRT APIs do not work in certain scenarios. Whether they don’t work because of the difference in App model, or whether they require Package Identity, we will help developers where possible, to make the right API calls in their application. We will generate a list of API calls that don’t work in Win32, as well as APIs that require Package identity, and provide tooling for .NET developers through a Roslyn Analyzer.
Here is the list of APIs that we can use as a starting point: [Windows Runtime APIs available to a packaged desktop app (Desktop Bridge)](https://docs.microsoft.com/en-us/windows/apps/desktop/modernize/desktop-to-uwp-supported-api)

Prior Art: We started on a Roslyn Analyzer for [incompatible WinUI3 APIs](https://github.com/dotnet/try-convert/blob/feature/winui/src/WinUI.Analyzer/Analyzer/DeprecatedUseAnalyzer.cs).

#### 5.1.4.1 – Analyzer for App Authors
With the WindowsPackageType property, we can expose the exact type of application the customer is building, and therefore provide the exact type of information that they need.

#### 5.1.4.2 – Analyzer for Library authors
Since library authors won’t set the WindowsPackageType property, the analyzer for library authors should be general purpose, and provide messages such as “this API behaves differently in Desktop vs UWP, add a runtime check or use <replacement API>”.

### 5.2 – New Apps and WinUI3

#### 5.2.1 - New WinUI3 Apps
Creating new WinUI3 apps will have the proper manifest files included, and project files by design. Developers will use Visual Studio to create new projects, and .NET developers will have the options of using the .NET CLI. There will be a separate doc more specifically focused on the new project experience for Windows developers that will go into more detail.

##### 5.2.1.1 - Manifest Files
All new WinUI3 apps will have a package.appxmanifest file, but the SxS manifest should be removed. The tooling will supply default manifest files, which it can use mt.exe to merge. The “default” manifests include:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...the SxS manifest should be removed.

What SxS manifest are you referring to?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a default one in new WinUI3 projects

- WinRT registrations for WinUI (and Reunion ) types
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're referring to WinRT registrations for WinUI (and Reunion) types? In a SxS manifest, for use via RegFreeWinRT? If so then can be removed.

A SxS manifest isn't necessary (or desirable). WinRT types in the Project Reunion framework package are listed in the framework's appxmanifest.xml.

These WinRT types are used by packaged apps that declare <PackageDependency Name="Microsoft.ProjectReunion".../> through the magic of MSIX and Windows' deployment and WinRT stacks.

Not-packaged apps use Dynamic Dependencies to get access to framework packages' content (be they ProjectReunion or other framework packages). This finds WinRT types defined in the framework package's appxmanifest.xml.

Past practices using RegFreeWinRT are unnecessary (and, in some ways, counter productive).

Copy link
Author

@stevenbrix stevenbrix Mar 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this is an implementation detail that probably doesn't deserve to be in this spec. Thanks for pointing this out.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...WinUI (and Reunion)...

WinUI is part of Project Reunion. It's not a separate thing.

- PerMonV2 (and other DPI awareness) settings
The reason for this is that over time, we want to consolidate on a single manifest. This certainly won’t be possible today, and we won’t try to tell that story yet. There are things that can only be accomplished with a SxS manifest, and those scenarios will absolutely still work. Note, that in order to consolidate on a single manifest, we don’t need to change the OS or runtime implementation. We could use the package.appxmanifest format to produce a SxS manifest for unpackaged apps, just like we produce an appxmanifest.xml file for packaged/sparse apps today.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for this is that over time, we want to consolidate on a single manifest

What multiple manifests today are you implying? SxS? MSIX? package.appxmanifest? Other?

Copy link
Author

@stevenbrix stevenbrix Mar 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manifest files that exist in the developers project that they use to configure their application. We really shouldn't have two, and should move anything that can only be accomplished in a SxS manifest into the Package.appxmanifest file (could use a possible rename).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move anything that can only be accomplished in a SxS manifest into the Package.appxmanifest file

Did you mean anything that can be accomplished via appxmanifest should be moved out of SxS manifest?
(as-is it reads the other way - if both work use SxS. But the other direction makes more sense)

Another reason for having a default package.appxmanifest is that we want to lead developers down the pit of success, and give them easy and non-intrusive updates to using the latest Windows tech. Sparse win32 packages allow unpackaged apps to have Identity, and use Windows features like the Share target and notifications.

#### 5.2.2 - WinUI3 Specific Tooling Requirements
Since WinUI3 is the only UI framework which will support all the Windows app models, the templates for WinUI3 must work in both UWP and Desktop applications. This means that an app developer can just toggle the WindowsPackageType property, to change the app they are building.
Since WinUI has C++ customers, a special tool for generating the main method (i.e. Xaml compiler), which registers the Sparse Package and Dynamic Dependencies registration will be required.

#### 5.2.3 - Choosing your Windows APIs
The UWP target platform selector is problematic with Reunion. The Reunion APIs are designed to ship out of band with the OS, and with this, users are able to select Windows versions that are not compatible with their Reunion packages. This UI should just be disabled, since we hard code the TargetPlatformVersion (TPV) in the project file to match what reunion supports. The default TargetPlatformMinVersion (TPMV) if not specified, will match the TPV, and developers can change it by setting the TPMV property. When migrating existing UWP apps, they will likely have TPMV set, and the existing property will be respected.

### 5.3 – MSIX Packaging
This section will go into more detail for the MSIX packaging story, and the steps that users will take in Visual Studio, or from the command line, in order to successfully build MSIX packages.

#### 5.3.1 – Single-Exe Packages
Single-exe packages are the default, and like UWP projects today, won't require the Windows Application Packaging (WAP) project. Developers will be able to build and debug these apps directly in Visual Studio.

#### 5.3.2 - Multi-Exe packages
Many apps, like the Windows terminal, package multiple exes into their msix. For this reason, the .wapproj will not be fully retired. However, this project can solely be used for packaging their app for distribution, and not get in the way of their inner-loop.

#### 5.3.3 - Creating App Bundles and Publishing to the Microsoft Store
In this section, we’ll be using command line interface (cli) examples for simplicity and greater articulation of how the technology works. While all these actions are accomplishable through the VS UI, developers still require cli workflows in their day-to-day, and especially for Continuous Integration (CI) environments. The VS UI will be a nice wrapper around these tasks.

Today, in order to build app bundles from the cli, there is a complicated incantation that you need to specify on the command line:

>msbuild WindowXamlAppCs.sln /m /p:Platform=x64 /p:UapAppxPackageBuildMode=StoreOnly /p:AppxBundle=Always /p:AppxBundlePlatforms="x64|arm64" /p:Configuration=Release

This invokes MSBuild in a recursive manner which rebuilds the project for multiple architectures. This behavior adds enormous complexity to the build and is difficult to maintain. Furthermore, a complex build is a slow build, and so this behavior *will not* be carried forward. Instead, we will only build individual .msix files per architecture, and we will enable developers to submit their apps to the store either by using the [Windows Store Azure DevOps task](https://marketplace.visualstudio.com/items?itemName=MS-RDX-MRO.windows-store-publish), and the VS `Publish->Create App Packages` UI will be updated to handle individual .msix files.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and the VS Publish->Create App Packages UI will be updated to handle individual .msix files.

By 'individual .msix files' you mean not bundles?

Are you aware of Flat bundles? Will that be supported?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, at least not the bundles that contain multiple arch's. I was not aware of flat bundles, but that does look super promising! What's the workflow for creating a flat bundle? Do I need to author a special manifest?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevenbrix here's more info on flat bundles. The key difference is running makeappx.exe with a different command line.


TODO: More details about the steps the developer takes using Azure DevOps pipeline.

#### 5.3.4 - C++ Developer Experience
We want to make sure any improved experience is still familiar. And since there is an existing `GenerateAppxPackageOnBuild` property, we’ll utilize that, and build off of it, to make a simplified story for building an .msix. > msbuild WinUI3AppCpp.sln /m /p:Platform=x64 /p:Configuration=Release /p:GenerateAppxPackageOnBuild=true

#### 5.3.5 - .NET Developer Experience
With .NET Core, there is the new SDK-style project format, which presents greatly simplified project format and improved experience for developers. Because of this, we want the Reunion workflow to be familiar to .NET developers.
While the above MSBuild properties (GenerateAppx*OnBuild) will work for .NET developers, “Build” is not the verb used for preparing your app for distribution. The verb for .NET is “Publish”, and the Publish stage of the Build is the only place where you can do certain things like AOT compile, assembly trimming, and self-contained deployment. Because of this, we will introduce two new properties, which are similarly named:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...we will introduce two new properties, which are similarly named:

Incomplete sentence?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, no I was refactoring and missed this change. Thanks, I'll remove it.


For helpful links that go into more detail on this, see [Application publishing - .NET](https://docs.microsoft.com/en-us/dotnet/core/deploying/). One key aspect of this that we will be promoting, is the use of [Publish Profiles](https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/visual-studio-publish-profiles?view=aspnetcore-5.0), which enable developers to configure how they deploy their application.

Here is the new, simplified incantation for .NET developers that will work for Reunion:
> dotnet publish WinUI3AppCs.sln /p:PublishProfile=win10-x86.pubxml

**Example: Contents of a PublishProfile**
Here is an example of a publish profile that would generate an .msix that runs in the UWP sandbox:

```xml
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Platform>arm64</Platform>
<RuntimeIdentifier>win10-arm64</RuntimeIdentifier>
<PublishDir>bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\</PublishDir>
<SelfContained>true</SelfContained>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun>True</PublishReadyToRun>
<PublishAppxPackage>true</PublishAppxPackage>
<WindowsPackageType>Universal</WindowsPackageType>
</PropertyGroup>
</Project>
```

It would deploy the .msix to a location on disk, where the VS tooling pipeline would pick it up and publish it to the store. Future improvements can be made to introduce a new `<PublishProtocol>WindowsStore</PublishProtocol>`, but are not required for V1.

##### 5.3.5.1 - Publish UI for .NET6 Apps
As described above, .NET has a different, albeit very similar, definition of Publish. There is a specific UI that developers can use to publish to an Azure service or Folder location. This action implies you are building an unpackaged app. This context menu in VS is similar to the existing UWP `Publish->Create App Packages`, but just says `Publish`. Having both UIs enabled at the same time may not be ideal and could possibly be confusing, but it has the advantage of being familiar to existing UWP devs who are migrating to WinUI3. The amount of work to design and build a whole new UI to avoid this possible confusion is not worth the effort, especially since we don’t know for certain that it will be a problem.
The proposal is to first re-enable the existing UI, which has been investigated and should be a simple change. We’ve proven the UI works, because there is actually a way to enable it today, but it involves hand crafting your own appx manifest. That is not a scenario we want to tell customers about, but it gives us confidence that the investment will be worthwhile. Once this scenario is enabled, we can get feedback from customers.