-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Publishing an unpackaged Windows app fails by default #5881
Comments
Related to #5884 |
This should fix it #5896 |
Linked to #3166 |
I'm re-opening this issue because this scenario doesn't fully work. #5896 fixed the above error, but past that it still runs into an error:
Digging into this error, it appears the problem is that setting The reason this happens is because of these targets in WinUI: <!-- By default, add CRT package dependencies for WAP-free and UAP apps. Previously, this was done to satisfy
CRT linkage for WinUI 3 binaries. With Hybrid CRT, that's no longer needed, but we retain this behavior
to avoid breaking existing projects. At deployment time, it's very likely that a target device will already
have Microsoft.VCLibs and Microsoft.VCLibs.Desktop FWPs installed. But apps can still opt out of referencing
these FWPs by setting WinUISDKReferences='false'. -->
<PropertyGroup Condition="'$(WinUISDKReferences)'=='' and ('$(TargetPlatformIdentifier)'=='UAP' or '$(WindowsPackageType)'!='')">
<WinUISDKReferences>true</WinUISDKReferences>
</PropertyGroup>
<ItemGroup Condition="'$(WinUISDKReferences)'=='true' and
('$(OutputType)' == 'Exe' or
'$(OutputType)' == 'AppContainerExe' or
'$(MSBuildProjectExtension)'=='.wapproj' or
('$(OutputType)'=='WinExe' and '$(EnablePreviewMsixTooling)'=='true'))">
<SDKReference Include="Microsoft.VCLibs, Version=14.0" />
<SDKReference Include="Microsoft.VCLibs.Desktop, Version=14.0" />
<SDKReference Include="Microsoft.UniversalCRT.Debug, Version=$(TargetPlatformVersion)" Condition="'$(Configuration)' == 'Debug'" />
</ItemGroup> Since It is only compiled on .NET Framework. I believe this is a bug in the WinUI targets. The reason it doesn't happen by default is because <PropertyGroup>
<!--
The below table describes the available options for packaging and what they mean.
These are controlled through the WindowsPackageType property.
| WindowsPackageType | App Model Type | Produces .msix | Has Identity |
|======================|=================|================|==============|
| None | Win32 | No | No |
| MSIX | Win32 | Yes | Yes |
| Sparse | Win32 | No | Yes |
If there exists a Package.appxmanifest file, then we'll default into MSIX.
If there is no Package.appxmanifest, then the default is None.
-->
<WindowsPackageType Condition="'$(WindowsPackageType)'=='' and Exists('Package.appxmanifest')">MSIX</WindowsPackageType>
<WindowsPackageType Condition="'$(WindowsPackageType)'==''">None</WindowsPackageType>
<!-- Need to set to 'true' so that VS enables the 'Project -> Publish' menu and the
.appxmanifest designer -->
<WindowsAppContainer Condition="'$(WindowsPackageType)'=='MSIX'">true</WindowsAppContainer>
</PropertyGroup> Since |
Description
Trying to publish an unpackaged Windows app raises an error that a AppxManifest is specified.
Steps to Reproduce
dotnet new maui
dotnet publish -f net6.0-windows10.0.19041.0 -c Release -p:WindowsPackageType=None
Version with bug
Unknown/Other (please specify)
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
All Windows
Did you find any workaround?
No response
Relevant log output
cc @mattleibow
The text was updated successfully, but these errors were encountered: