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

Unable to publish unpackaged WinUI3 application #4901

Open
daltzctr opened this issue Nov 19, 2024 · 4 comments
Open

Unable to publish unpackaged WinUI3 application #4901

daltzctr opened this issue Nov 19, 2024 · 4 comments

Comments

@daltzctr
Copy link

Describe the bug

Attempting to publish an unpackaged MAUI application with 1.6 WASDK and .NET 9 results in the following obscure error message:

WindowsAppSDKSelfContained requires a supported Windows architecture.

The command I'm using to publish is linked below.

dotnet publish myapp.csproj -c Release -f net9.0-windows10.0.19041.0 -p:WindowsPackageType=None -p:SelfContained=true -p:WindowsAppSDKSelfContained=true -p:RuntimeIdentifierOverride=win-x64

Steps to reproduce the bug

I can't reproduce this out of the box, but I have no idea where to look at building a repro for this.

Expected behavior

Compiles

Screenshots

No response

NuGet package version

None

Packaging type

Unpackaged

Windows version

No response

IDE

Other

Additional context

Windows App SDK version: 1.6.240923002

@manodasanW
Copy link
Member

To confirm, does your project set RuntimeIdentifier based on RuntimeIdentifierOverride?

@daltzctr
Copy link
Author

Specifying an explicit RID with -p:RuntimeIdentifier=win-x64 gets me a bit further with new errors.

Unable to find package Microsoft.NETCore.App.Runtime.Mono.win-x64 with version (= 9.0.0)
    - Found 102 version(s) in nuget.org [ Nearest version: 9.0.0-preview.7.24405.7 ]
    - Found 102 version(s) in NuGet official package source [ Nearest version: 9.0.0-preview.7.24405.7 ]
    - Found 0 version(s) in Microsoft Visual Studio Offline Packages
    - Found 0 version(s) in C:\Program Files\dotnet\library-packs

@char8t
Copy link

char8t commented Nov 21, 2024

For me it does work to publish an unpackaged WinUI3 app only when -p:WindowsPackageType=None is not set.
My .csproj looks like this:

<Project Sdk="Microsoft.NET.Sdk">

	<PropertyGroup>
		<OutputType>WinExe</OutputType>
		<TargetFramework>net9.0-windows10.0.19041.0</TargetFramework>
		<ApplicationManifest>app.manifest</ApplicationManifest>
		<Platforms>x64</Platforms>
		<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
		<ImplicitUsings>true</ImplicitUsings>
		<Nullable>enable</Nullable>
		<UseWinUI>true</UseWinUI>
		<EnableMsixTooling>true</EnableMsixTooling>
		<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
		<SelfContained>true</SelfContained>
	</PropertyGroup>

	<ItemGroup>
		<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26100.1742" />
		<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.241114003" />
	</ItemGroup>

</Project>

With this i can publish my app with simply doing dotnet publish .\FooApp.csproj -r win-x64 -o publish.

@char8t
Copy link

char8t commented Nov 21, 2024

@daltzctr For your Unable to find package Microsoft.NETCore.App.Runtime.Mono.win-x64 with version (= 9.0.0) error. The MonoVM desktop packages are not available anymore starting with .NET 9 Preview 7: https://learn.microsoft.com/en-us/dotnet/core/compatibility/deployment/9.0/monovm-packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants