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

Add VC Redist dependency to Windows templates #6318

Merged
merged 4 commits into from
Apr 22, 2022
Merged

Add VC Redist dependency to Windows templates #6318

merged 4 commits into from
Apr 22, 2022

Conversation

jfversluis
Copy link
Member

Description of Change

This adds the Visual C++ Redistributable libraries as a dependency to our Windows templates to light up the MSIX distributable scenario on non-dev machines.

By adding this the C++ redist will be added as a prerequisite and installed as part of installing the .NET MAUI app.

It seems this will also be fixed on the WinUI side (microsoft/WindowsAppSDK#2117) so when WinAppSdk 1.1 lands we might no longer need this.

Issues Fixed

NA

@jfversluis jfversluis added platform/windows 🪟 area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) labels Apr 20, 2022
@jfversluis jfversluis added this to the 6.0.300-rc.3 milestone Apr 20, 2022
@jfversluis jfversluis requested a review from a team as a code owner April 20, 2022 14:46
Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

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

Looks great!

Copy link
Member

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

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

This is probably related to the fact that the SDKReference things are not working. This should be added via the build process and not manually included as different VCLibs are used in Debug/Release.

@mattleibow
Copy link
Member

mattleibow commented Apr 20, 2022

Based on an exciting email thread around this, this is a result of a few things:

  1. The Win2D dependency that Maui uses is compiled with the end result of it requiring the VCLibs
  2. The VCLibs is not being included because the process to include it (SDKReference) is not supported in dotnet build

There is steps to solve this that I believe are happening as we speak but will not make it in time:

  1. Rebuild Win2D to no longer have the VCLibs dependency

There is also some workaround for now:

  1. This PR: Add the 2 VCLibs into the appx manifest
  2. (sad mode) Use full MSBuild and add back the SDKReference by setting: <WinUISDKReferences>true</WinUISDKReferences> in your csproj

Things that we cannot control:

  1. There may exist libraries that also have a VCLibs dependency, so:
    1. either they rebuild with a HybridCRT
    2. or the app still includes VCLibs

@mattleibow mattleibow self-requested a review April 20, 2022 16:53
Copy link
Member

@mattleibow mattleibow left a comment

Choose a reason for hiding this comment

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

I added back the Microsoft.VCLibs.140.00 dependency in addition to the Microsoft.VCLibs.140.00.UWPDesktop because I am not sure what they all do. The Windows App SDK adds both, so I am adding both.

It technically also adds the <build:Item Name="Microsoft.UniversalCRT.Debug" Version="10.0.19041.0" /> in another section, but I am feeling that is build time things maybe.

Unless someone can say the dependencies are bad in some way, this is what we will have and then once our dependencies are ready to be VCLibs-free, we can remove/comment out in the template for the general public.

@mattleibow
Copy link
Member

And to make a comment on the Release/Debug differences... This is still a thing, but there is no way to do this in the manifests.

It will need to be an additional step, but since Win2D is getting fixed in the future - and when you are running a debug app you also probably have VS or even just the VC Runtime installed.

@mattleibow mattleibow changed the base branch from main to release/6.0.3xx-rc2 April 20, 2022 17:00
@mattleibow mattleibow modified the milestones: 6.0.300-rc.3, 6.0.300-rc.2 Apr 20, 2022
@mattleibow mattleibow self-assigned this Apr 20, 2022
@mattleibow mattleibow modified the milestones: 6.0.300-rc.2, 6.0.300-rc.3 Apr 21, 2022
@mattleibow mattleibow changed the base branch from release/6.0.3xx-rc2 to main April 21, 2022 14:43
@mattleibow mattleibow enabled auto-merge (squash) April 22, 2022 20:11
@mattleibow mattleibow merged commit 3b713c3 into main Apr 22, 2022
@mattleibow mattleibow deleted the msix-work branch April 22, 2022 20:44
jfversluis added a commit that referenced this pull request May 2, 2022
mattleibow pushed a commit that referenced this pull request May 3, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) platform/windows 🪟
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants