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

Cannot publish freshly created MAUI app as documented #6831

Closed
Dbquity opened this issue May 4, 2022 · 3 comments
Closed

Cannot publish freshly created MAUI app as documented #6831

Dbquity opened this issue May 4, 2022 · 3 comments
Labels
area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) platform/windows 🪟 s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working

Comments

@Dbquity
Copy link

Dbquity commented May 4, 2022

Description

Documented steps to publish a MAUI app for Windows fails.

repro sln here: https://github.com/Dbquity/MauiApp10

Steps to Reproduce

  1. create a fresh MAUI App with the add project UI in Visual Studio 2022 Community - Preview version 17.2 Preview 6
  2. Follow the instructions here: https://docs.microsoft.com/en-us/dotnet/maui/windows/deployment/overview
  3. observe this output from executing the described msbuild command:
...
Build FAILED.

"C:\Code\Maui\MauiApp10\MauiApp10.sln" (Publish target) (1:2) ->
"C:\Code\Maui\MauiApp10\MauiApp10.csproj" (Publish target) (2:18) ->
(ResolvePackageAssets target) ->
  C:\Program Files\dotnet\sdk\6.0.300-preview.22204.3\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolut
ion.targets(267,5): error NETSDK1005: Assets file 'C:\Code\Maui\MauiApp10\obj\project.assets.json' doesn't have a targe
t for 'net6.0-windows10.0.19041'. Ensure that restore has run and that you have included 'net6.0-windows10.0.19041' in
the TargetFrameworks for your project. [C:\Code\Maui\MauiApp10\MauiApp10.csproj]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.99

Version with bug

Release Candidate 2 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows 10

Did you find any workaround?

Yes. Choosing the Release profile and Windows Machine as target in the Visual Studio UI and then building the project successfully produces a .msix - notice the extra .0 in the target framework identifier net6.0-windows10.0.19041.0:

Build started...
1>------ Build started: Project: MauiApp10, Configuration: Release Any CPU ------
1>You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
1>MauiApp10 -> C:\Code\Maui\MauiApp10\bin\Release\net6.0-windows10.0.19041.0\win10-x64\MauiApp10.dll
1>MauiApp10 -> C:\Code\Maui\MauiApp10\bin\Release\net6.0-windows10.0.19041.0\win10-64\AppPackages\MauiApp10_1.0.0.1_Test\MauiApp10_1.0.0.1_x64.msix
1>MauiApp10 -> bin\Release\net6.0-windows10.0.19041.0\win10-x64\AppPackages\MauiApp10_1.0.0.1_Test\MauiApp10_1.0.0.1_x64.msixsym
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

Relevant log output

No response

@Dbquity Dbquity added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels May 4, 2022
@Dbquity
Copy link
Author

Dbquity commented May 4, 2022

@Dbquity
Copy link
Author

Dbquity commented May 4, 2022

It seems the version of the .NET 6 SDK, 6.0.300-preview.22204.3, that installs with VS 2022 Preview - version 17.2 Preview 6 is not in sync with MAUI RC2 on how to identify the Windows target framework:
The former uses net6.0-windows10.0.19041, the latter adds a .0: net6.0-windows10.0.19041.0

@Eilon Eilon added the area-publishing Issues with the app packaging/publishing process (ipk/apk/msix/trimming) label May 4, 2022
@jfversluis
Copy link
Member

This is mostly an issue in the docs at this point. The TFM has been updated in our templates but not in the docs. The TargetFramework in the publish command should match the one in your csproj. I have updated the docs to use dotnet publish and also added the new TFM, including a note that you should double-check that the TMF identifiers are the same.

@ghost ghost locked as resolved and limited conversation to collaborators Jun 4, 2022
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 🪟 s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants