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

.NET MAUI Windows target publishing/archiving #4329

Closed
jfversluis opened this issue Jan 26, 2022 · 58 comments
Closed

.NET MAUI Windows target publishing/archiving #4329

jfversluis opened this issue Jan 26, 2022 · 58 comments

Comments

@jfversluis
Copy link
Member

jfversluis commented Jan 26, 2022

TL;DR

  • Publishing a .NET MAUI Windows app (both .NET MAUI and .NET MAUI Blazor) to an msix works, see bullet 4 below
    • Running it on a non-dev machine seems to work fine for a regular .NET MAUI app, but not for a .NET MAUI Blazor app
  • Publishing to an exe (not self-contained) works but don't take the published folder files, take the build artifacts, see bullet 3 below for all the details
  • Self-contained/sideloaded apps do not seem to work in any variation at this time
  • This is all through the command-line, UI support in Visual Studio is not there (yet)

Description

I have been trying to see if publishing a Windows app through .NET MAUI works at the moment. There are a few different variations, most don't work, but I have been able to produce a working msix file.

Ideally I would think dotnet publish would be supported. However if we look at the csproj file we see that we need MSBuildRuntimeType == full. So the only way to achieve anything right now is by using msbuild.

Disclaimer: my knowledge on Windows apps isn't all that great, so there might be things in here that don't even make sense in this context. I found some options through Google Bing and decided to try them out, here are the results.

Questions

  • Option 4 seems to work. Is this the expected way? Apart from not having a nice UI to do this from.
    • Can we also create packages to publish to the store this way?
  • Should there be a way to just distribute the exe as a single file?
    • Is that supported? If not, will that be supported?
  • I've also been seeing appx being mentioned. Is that the "old" msix? Or should we somehow also be able to produce appx files?

Background

1. Basic command (doesn't work)

msbuild_basic.binlog.zip

The most obvious command then is msbuild /restore /t:Publish /p:TargetFramework=net6.0-windows10.0.19041 /p:configuration=release. This completes successfully, however the resulting published app won't work. You can double-click the main exe, but nothing comes up. Also, the build artifacts in the release folder show the same behavior (why that is important we will see later).

In the Windows Event Viewer, I see this entry after I tried to start the app:

Application: MauiApp23.exe
CoreCLR Version: 6.0.121.56705
.NET Version: 6.0.1
Description: The process was terminated due to an unhandled exception.
Exception Info: System.DllNotFoundException: Unable to load DLL 'Microsoft.ui.xaml.dll' or one of its dependencies: The specified module could not be found. (0x8007007E)
   at MauiApp23.WinUI.Program.XamlCheckProcessRequirements()
   at MauiApp23.WinUI.Program.Main(String[] args) in C:\Users\joverslu\source\repos\MauiApp23\MauiApp23\obj\Release\net6.0-windows10.0.19041\win10-x64\Platforms\Windows\App.g.i.cs:line 28

Sure enough the mentioned DLL Microsoft.ui.xaml.dll is not present amongst the huge amount of files both in the build artifacts and the publish folder.

2. Adding -p:PublishSingleFile=true (doesn't work)

msbuild_singlefile.binlog.zip

Command: msbuild /restore /t:Publish /p:TargetFramework=net6.0-windows10.0.19041 /p:configuration=release -p:PublishSingleFile=true

With this command the publish folder only contains a couple of files, which I guess makes sense. The build artifacts still is a huge list of files. However, running still results in nothing happening. The Event Viewer shows a somewhat similar entry, but lacks the Microsoft.ui.xaml.dll filename this time.

Application: MauiApp23.exe
CoreCLR Version: 6.0.121.56705
.NET Version: 6.0.1
Description: The process was terminated due to an unhandled exception.
Exception Info: System.DllNotFoundException: Dll was not found.
   at MauiApp23.WinUI.Program.XamlCheckProcessRequirements()
   at MauiApp23.WinUI.Program.Main(String[] args) in C:\Users\joverslu\source\repos\MauiApp23\MauiApp23\obj\Release\net6.0-windows10.0.19041\win10-x64\Platforms\Windows\App.g.i.cs:line 28

3. Adding -p:WindowsAppSDKSelfContained=true (somewhat works)

msbuild_windowsappsdk.binlog.zip

Command: msbuild /restore /t:Publish /p:TargetFramework=net6.0-windows10.0.19041 /p:configuration=release -p:WindowsAppSDKSelfContained=true /p:Platform=x64

Then I somewhere found the WindowsAppSDKSelfContained option and decided to try that. Initially it fails, because it seems this option does not support AnyCPU: The platform 'AnyCPU' is not supported for SelfContained mode.

I added the x64 platform through the Visual Studio Configuration Manager Then adding the /p:Platform=x64 option made it complete successfully.

Here is where things get interesting. There are now a big number of files in the publish folder, but running the exe still does not work. There is an event logged in the Event Viewer identical to option 1.

However! If I now navigate up a folder and just look at the build artifacts and run the exe there, it works! The difference seems to be that there are a number of files in the build artifacts that don't end up in the publish folder. Running a compare between the two folders, these are the files that seem to be different:

	            	C:\Users\joverslu\source\repos\MauiApp23\MauiApp23\bin\x64\Release\net6.0-windows10.0.19041\win10-x64\
	    New File  			AppxManifest.xml
	    New File  			CoreMessagingXP.dll
	    New File  			dcompi.dll
	    New File  			dwmcorei.dll
	    New File  			DwmSceneI.dll
	    New File  			DWriteCore.dll
	    New File  			marshal.dll
	    New File  			MauiApp23.build.appxrecipe
	    New File  			Microsoft.DirectManipulation.dll
	    New File  			Microsoft.InputStateManager.dll
	    New File  			Microsoft.Internal.FrameworkUdk.dll
	    New File  			Microsoft.UI.Composition.OSSupport.dll
	    New File  			Microsoft.UI.Input.dll
	    New File  			Microsoft.UI.Text.winmd
	    New File  			Microsoft.UI.Windowing.Core.dll
	    New File  			Microsoft.UI.Xaml.Controls.dll
	    New File  			Microsoft.UI.Xaml.Controls.pri
	    New File  			Microsoft.ui.xaml.dll
	    New File  			Microsoft.UI.Xaml.Internal.dll
	    New File  			Microsoft.UI.Xaml.Phone.dll
	    New File  			Microsoft.ui.xaml.resources.19h1.dll
	    New File  			Microsoft.ui.xaml.resources.common.dll
	    New File  			Microsoft.UI.Xaml.winmd
	    New File  			Microsoft.Web.WebView2.Core.dll
	    New File  			Microsoft.Web.WebView2.Core.winmd
	    New File  			Microsoft.Windows.ApplicationModel.DynamicDependency.winmd
	    New File  			Microsoft.Windows.ApplicationModel.Resources.dll
	    New File  			Microsoft.Windows.ApplicationModel.Resources.winmd
	    New File  			Microsoft.Windows.ApplicationModel.WindowsAppRuntime.winmd
	    New File  			Microsoft.Windows.AppLifecycle.winmd
	    New File  			Microsoft.Windows.System.Power.winmd
	    Older     			Microsoft.WindowsAppRuntime.Bootstrap.dll
	    New File  			Microsoft.WindowsAppRuntime.dll
	    New File  			Microsoft.WindowsAppRuntime.Insights.Resource.dll
	    New File  			MRM.dll
	    New File  			WinUIEdit.dll
	    New File  			wuceffectsi.dll

When this option is combined with the -p:PublishSingleFile=true we get a singe file in the publish folder which won't run, however if we copy it back to the build artifacts folder that also runs. So it would seem that the DLLs it's missing also don't end up in the single file.

Another weird thing with this option is; the app runs, but I can't move the window! You can resize the window, but you can't move it for whatever reason.

4. Adding /p:GenerateAppxPackageOnBuild=true (WORKS!)

Command: msbuild /restore /t:Publish /p:TargetFramework=net6.0-windows10.0.19041 /p:configuration=release /p:GenerateAppxPackageOnBuild=true /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="{your thumbprint}" /p:PackageCe
rtificatePassword="{your password}" (also tried /t:Build)

This generates some files in the AppPackages folder that wasn't there before which contains an msix file. That won't let me install because of a certificate error it seems.

I went to find how I should sign my msix file and found that I had to create a self-signed certificate and then I could add a couple of extra parameters to also add the sign the MSIX and then trust that cert manually... AND IT WORKS!

We now have an msix file that can install/update/run the app 🎉

image

Other

  • I have also tried the /p:SelfContained=true option which doesn't seem to have any influence. I also tried different variations of all the options above, but none of them seemed to work.
  • I have tried doing a right-click > Publish which I got somewhat to work, but seems not fully prepared for this scenario just yet. So I am assuming that Visual Studio does not support this scenario in any way right now and all needs to be done through the command-line.
  • I needed to manually edit the Package.appxmanifest file because double-clicking it would give me an error (see below). For a regular UWP app, the editor opens and works fine.
    image

Related Resources

Also See

@Sweekriti91
Copy link
Collaborator

Adding this here, we had to figure this out as well, and this is the gist of how I setup the GitHub Actions pipeline : https://gist.github.com/Sweekriti91/75d019ea832e800aee860e54fe7da7c5

@kofinn
Copy link

kofinn commented Jan 26, 2022

Hi,

I have tried your workaround, but it keeps failing with this error
NETSDK1005: Assets file 'C:\Users\****\source\repos\MauiApp1\MauiApp1\obj\project.assets.json' doesn't have a target 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.

I have tried to fiddle with MauiApp1.csproj, but no luck so far

dotnet build /restore /t:Publish /p:TargetFramework=net6.0-windows10.0.19041 /p:configuration=release /p:GenerateAppxPackageOnBuild=true /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="8BAF63DD1A3E291D5BDE640289A0F4DC8F4A7371" /p:PackageCertificatePassword="Heslo"
Microsoft (R) Build Engine version 17.1.0-preview-21610-01+96a618ca5 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored C:\Users\****\source\repos\MauiApp1\MauiApp1\MauiApp1.csproj (in 610 ms).
  Determining projects to restore...
  Restored C:\Users\****\source\repos\MauiApp1\MauiApp1\MauiApp1.csproj (in 259 ms).
  You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview
C:\Program Files\dotnet\sdk\6.0.200-preview.22055.15\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(267,5): error NETSDK1005: Assets file 'C:\Users\****\source\repos\MauiApp1\MauiApp1\obj\project.assets.json' doesn't have a target 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:\Users\****\source\repos\MauiApp1\MauiApp1\MauiApp1.csproj]

Build FAILED.

@jfversluis
Copy link
Member Author

Note that my command starts with msbuild not dotnet build. That's key here 😊

@kofinn
Copy link

kofinn commented Jan 26, 2022

Note that my command starts with msbuild not dotnet build. That's key here 😊

Now it is working, thank you

@igalfsg
Copy link

igalfsg commented Jan 26, 2022

Thank you! This really helped. I was able to install and run it but only on my dev machine, when I moved it to my non-dev machine it didn't work. Which makes me think that some of the .net SDKs were not added to the application.

Has anyone been able to run it in another machine without .net SDKs installed?

Update, even tried to install VS22 preview and it still didn't work on the non dev machine

@jfversluis jfversluis removed the t/bug Something isn't working label Jan 27, 2022
@jfversluis
Copy link
Member Author

jfversluis commented Jan 27, 2022

@igalfsg that's interesting, I will try that. If you go into the Event Viewer, do you see any entries there that might give you a clue on why it's not working? I think the idea of an msix file is that it installs the SDK needed, right?

Edit: just tried it myself on a Windows 10 machine that is not a dev machine. MSIX runs without a problem and installs the prerequisites needed.

@igalfsg
Copy link

igalfsg commented Jan 27, 2022

Interesting, that it works for you, I will try a different machine? Forgot to mention the event viewer on my first comment. That was the weirdest part, event viewer said the install was fine and everything was successful.

@WetMonitor
Copy link

@jfversluis Thank you so much for looking into it. I am trying to setup a release MSIX( or APPX,) and while they installed successfully, they wouldn't run (like nothing happens if you go to start menu → start the app). I am wondering if I setup my certificate wrong, or I just didn't configure app bundle config wrong. I am just not sure. I am going to give @Sweekriti91's gist Github Action a try and see if it will build Blazor Maui app → MSIX correctly (@Sweekriti91 Thanks for this gist, it is handy for someone who lacks experiences with github action like me!)

@jfversluis
Copy link
Member Author

@WetMonitor would you be able to look in the Event Viewer if there is an entry there with more info?

I think I've seen an issue with the custom font that is registered with the default .NET MAUI template, but when I tried to reproduce it later I couldn't.

Do you still have the font in there? Could it be that?

@WetMonitor
Copy link

WetMonitor commented Jan 27, 2022

@jfversluis
In the solution explorer: I do see this:
image

If I take rename the bundled APPX file to ZIP and look into its content, I still see the fonts:
image

As for event viewer... Let me try (keep in mind, it was installed with APPX, not MSIX- I'm in the process of trying to build one atm)
image

Log Name:      Application
Source:        Application Error
Date:          1/27/2022 9:58:18 AM
Event ID:      1000
Task Category: (100)
Level:         Error
Keywords:      Classic
User:          N/A
Computer:      WinDev2112Eval
Description:
Faulting application name: HCalibrator.exe, version: 1.0.3.4, time stamp: 0x61735063
Faulting module name: Microsoft.ui.xaml.dll, version: 3.0.0.2111, time stamp: 0xde84111e
Exception code: 0xc000027b
Fault offset: 0x0000000000338198
Faulting process id: 0x7cc
Faulting application start time: 0x01d813a776128933
Faulting application path: C:\Program Files\WindowsApps\HCalibrator_1.0.3.4_neutral__tkystdaa0hc36\HCalibrator.exe
Faulting module path: C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.0_0.319.455.0_x64__8wekyb3d8bbwe\Microsoft.ui.xaml.dll
Report Id: be0e1c50-198a-493c-824e-7de6935b07fd
Faulting package full name: HCalibrator_1.0.3.4_neutral__tkystdaa0hc36
Faulting package-relative application ID: App
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Application Error" />
    <EventID Qualifiers="0">1000</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>100</Task>
    <Opcode>0</Opcode>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2022-01-27T17:58:18.0187155Z" />
    <EventRecordID>1492</EventRecordID>
    <Correlation />
    <Execution ProcessID="504" ThreadID="0" />
    <Channel>Application</Channel>
    <Computer>WinDev2112Eval</Computer>
    <Security />
  </System>
  <EventData>
    <Data>HCalibrator.exe</Data>
    <Data>1.0.3.4</Data>
    <Data>61735063</Data>
    <Data>Microsoft.ui.xaml.dll</Data>
    <Data>3.0.0.2111</Data>
    <Data>de84111e</Data>
    <Data>c000027b</Data>
    <Data>0000000000338198</Data>
    <Data>7cc</Data>
    <Data>01d813a776128933</Data>
    <Data>C:\Program Files\WindowsApps\HCalibrator_1.0.3.4_neutral__tkystdaa0hc36\HCalibrator.exe</Data>
    <Data>C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.0_0.319.455.0_x64__8wekyb3d8bbwe\Microsoft.ui.xaml.dll</Data>
    <Data>be0e1c50-198a-493c-824e-7de6935b07fd</Data>
    <Data>HCalibrator_1.0.3.4_neutral__tkystdaa0hc36</Data>
    <Data>App</Data>
  </EventData>
</Event>

Edit: I'm going to try and see if I can get MSIX version working now.

@jfversluis
Copy link
Member Author

Ah so this is a .NET MAUI Blazor app? That one doesn't seem to work for some reason :(

@WetMonitor
Copy link

@jfversluis Correct. It's indeed a .NET MAUI Blazor app. I don't know if that makes any difference?

If you want to RDP into my WinDev2112Eval machine to take a closer look or to troubleshoot this, feel free to holla me (I can be found DootNetEvaluation maui discord channel.)

@jfversluis
Copy link
Member Author

Yeah that does make a difference for some reason. Not sure why though. So if you have anything you discover in that regard I would be curious to know!

@igalfsg
Copy link

igalfsg commented Jan 27, 2022

Mine is also Blazor, that might be the problem for me too. Adding @danroth27 so Blazor team has visibility into this issue.

@danroth27
Copy link
Member

@mkArtakMSFT Looks like we need someone to look into this .NET MAUI Blazor deployment issue.

@burtonrodman
Copy link

burtonrodman commented Jan 27, 2022

Having similar issues with a Maui/Blazor app. I have figured out this much in terms of building the msix by msbuild at the command line:
msbuild MauiApp1.sln /p:AppxBundlePlatforms="x64" /p:Configuration=Release /p:UapAppxPackageBuildMode=SideloadOnly /p:AppxBundle=Always /p:AppxPackageSigningEnabled=true /p:PackageCertificateKeyFile="C:\source\scratch\MauiApp1\MauiApp1_TemporaryKey.pfx" /p:PackageCertificateThumbprint="<thumbprint>" /p:PackageCertificatePassword=password /p:AppxPackageDir="C:\AppxPackages\\" /p:GenerateAppxPackageOnBuild=true

When I install the app on a non-dev machine, nothing appears and I get the following in Windows Event Viewer:
Warning:
Category: Microsoft.Maui.Dispatching.Dispatcher
EventId: 0

Replaced an existing DispatcherProvider with one from the service provider.

Error: Application Error
Faulting application name: MauiApp1.exe, version: 1.0.0.0, time stamp: 0x61954b73
Faulting module name: KERNELBASE.dll, version: 10.0.19041.1387, time stamp: 0x0b9a844a
Exception code: 0xc000027b
Fault offset: 0x000000000010b302
Faulting process id: 0x3f1c
Faulting application start time: 0x01d813a51b209c6c
Faulting application path: C:\Program Files\WindowsApps\5A0A5845-24F4-42B5-89CB-EF2910E3F746_1.0.0.1_neutral__ps0531bcx2kxr\MauiApp1.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report Id: 6b0bc9ba-6f60-4fcb-8004-82b9afe47433
Faulting package full name: 5A0A5845-24F4-42B5-89CB-EF2910E3F746_1.0.0.1_neutral__ps0531bcx2kxr
Faulting package-relative application ID: App

@PaulAndersonS
Copy link

@jfversluis I tried your solution and im able to generate the app package. But in cake file using the below code im able to generate the app package but it failed after generation with the error as below.

Cake:
MSBuild(@"..\mauisample12.sln",GetMSBuildSettings().
WithRestore().
WithProperty("GenerateAppxPackageOnBuild", "True").
WithProperty("AppxPackageSigningEnabled", "True").
WithProperty("AppxPackageDir", @"..\AppxPackages").
WithProperty("PackageCertificateThumbPrint", "3BF68F487E272D344F5E7DD3D112D57A2EDC3837"));

Error:
(_GenerateAppxSymbolPackage target) ->
C:\Users\xxx.nuget\packages\microsoft.windowsappsdk\1.0.0\build\Microsoft.Build.Msix.Packaging.targets(341
,5): error MSB6011: Invalid parameters passed to the Microsoft.Build.Msix.Symbols.WinAppSdkCheckFastlinkPdb task. [D:\G
ithub\mauisample12\mauisample12\mauisample12.csproj]

@danroth27
Copy link
Member

I opened #5024 to specifically track the .NET MAUI Blazor publishing issue.

@jfversluis
Copy link
Member Author

@PaulAnderson02 here is the solution to the error you've been seeing: microsoft/microsoft-ui-xaml#6746

Seems like something is missing on your build host :)

@isaacrlevin
Copy link

@danroth27 @jfversluis @Eilon any thoughts on my comment?

@mattleibow
Copy link
Member

The fastlink error is because I think we are missing some msvc dependency or runtime. Try installing the uwp workload.

It is this one
https://microsoft.visualstudio.com/OS/_workitems/edit/36792859

I believe there is a fix somewhere near.

@jfversluis
Copy link
Member Author

jfversluis commented Mar 7, 2022

@danroth27 @jfversluis @Eilon any thoughts on my comment?

I've spoken about it briefly with @danroth27 who mentioned the impact might be limited because WebView2 is apparently installed by a lot of other products so chances are pretty big it should already be there. However, for the best experience we want to make sure of course. I think he was going to look into it.

Maybe this has something to do with it as well? #5086

@isaacrlevin
Copy link

@danroth27 @jfversluis @Eilon any thoughts on my comment?

I've spoken about it briefly with @danroth27 who mentioned the impact might be limited because WebView2 is apparently installed by a lot of other products so chances are pretty big it should already be there. However, for the best experience we want to make sure of course. I think he was going to look into it.

Maybe this has something to do with it as well? #5086

I can only speak as someone who rolled out a WPF App using BlazorWebView and had about 10 users report needing to install the runtime (I had not realized it wasn't packaged so I didn't mention it in the repo) so I think there may be an assumption that people "already have it", which is an assumption I had. Regardless, it would be ideal to ship the Nuget package with all the dependencies it has rather than pushing the responsibility to end users.

@danroth27
Copy link
Member

Hi @isaacrlevin. We are currently advocating using the evergreen model for WebView2 with .NET MAUI. MAUI developers using WebView2 will need to ensure that WebView2 is installed on the machine as part of their app setup using either the online or offline techniques described in the WebView2 docs. We are discussing with the WebView2 team how to make appropriate samples & docs available for how to do this with .NET MAUI apps.

@isaacrlevin
Copy link

Hi @isaacrlevin. We are currently advocating using the evergreen model for WebView2 with .NET MAUI. MAUI developers using WebView2 will need to ensure that WebView2 is installed on the machine as part of their app setup using either the online or offline techniques described in the WebView2 docs. We are discussing with the WebView2 team how to make appropriate samples & docs available for how to do this with .NET MAUI apps.

Thanks @danroth27! I went through the docs and even some of the samples the WebView2 team has for Installer apps for instance, and my ideal scenario is that there would be both a standalone doc as well as a repo with how to "ship" apps with BlazorWebView (that would obviously be accurate for WinForms, WPF and MAUI). Publishing packages to the Microsoft Store is already challenging currently for .NET Core 3.1 and up apps (MSBUILD, different deployment types, etc.) and including WebView2 adds another wrinkle for devs. Just my .02, you can ignore it ;)

@MichaelPeter
Copy link

MichaelPeter commented Mar 13, 2022

Hello @danroth27, as the creator of the #5086 pull request and the issue #3861, working with everygreen versions has some limitations. Like in my scenario I want to ship the Edge Canary version to use preview features like WebGPU, which are not available in the everygreen version but only in Canary previews and will not be for the next year or two?

And when I deploy a BlazorWebView application and it works for only 90% of my users as reported out of the box it is problematic.

But more importaintly for BlazorWebView would be to be able to define your own environment, since sometimes you need to set special flags like --custom-devtools-frontend to disable or modify the devtools. Or --enable-unsafe-webgpu for WebGPU.

Thank you for your time!

@danroth27
Copy link
Member

@MichaelPeter Thanks for this feedback! We do anticipate that we will need to support fixed version distribution of the browser control. It was scoped out for the initial release of Blazor Hybrid support due to time and resource constraints. Your feedback does help us understand how quickly we need to address this scenario. Please be sure to 👍 the related issues and comment with your scenarios and requirements.

@knocte
Copy link
Contributor

knocte commented Apr 3, 2022

Thanks for letting us know! The Assets thing should be something that only happens in a transitioning scenario from earlier previews, for newly created project it shouldn't be an issue.

How early @jfversluis ? I still was able to reproduce in #3542 from a template that I got on the 30th of Jan (it referenced Assets\appiconfgSplashScreen.png, and I cannot check now if this is still the case because I'm suffering another VSPreview bug: no templates appear whatsoever when I click on "Create new project").

@jfversluis
Copy link
Member Author

Thanks for letting us know! The Assets thing should be something that only happens in a transitioning scenario from earlier previews, for newly created project it shouldn't be an issue.

How early @jfversluis ? I still was able to reproduce in #3542 from a template that I got on the 30th of Jan (it referenced Assets\appiconfgSplashScreen.png, and I cannot check now if this is still the case because I'm suffering another VSPreview bug: no templates appear whatsoever when I click on "Create new project").

I think templates around that time would still have it. You can run dotnet new -i Microsoft.Maui.Templates to install or update the templates and those should be all good

@emorell96
Copy link

Maybe a silly question but how do you set the version number when using msbuild? I keep getting 1.0.0.1 every time even if I have <Version>1.0.2</Version> in the project file.
I also tried using a Directory.Build.props file like in ASP.NET Core but that doesn't work either. Thank you!

image

@emorell96
Copy link

Also why when I publish using option 4 when I have an icon set up using MauiIcon I end up with my icon and the .NET icon mixed:

image

@danies8
Copy link

danies8 commented Apr 12, 2022

I tried the third approach and get this error:
"C:\Users\danis\source\repos\MauiApp15\MauiApp15\MauiApp15.csproj" (Publish target) (1:19) ->
(MergeWindowsAppSDKManifests target) ->
C:\Users\danis.nuget\packages\microsoft.windowsappsdk\1.0.0\build\Microsoft.WindowsAppSDK.SelfContained.targets(19,5): error MSB3073: The command ""C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x86\mt.
exe" -nologo -manifest Platforms\Windows\app.manifest Platforms\Windows\app.manifest C:\Users\danis.nuget\packages\microsoft.windowsappsdk\1.0.0\manifests\Microsoft.InteractiveExperiences.manifest C:\Users\danis.
nuget\packages\microsoft.windowsappsdk\1.0.0\manifests\Microsoft.WindowsAppSdk.Foundation.manifest C:\Users\danis.nuget\packages\microsoft.windowsappsdk\1.0.0\manifests\Microsoft.WindowsAppSdk.WinUI.manifest -out:
Microsoft.WindowsAppSdk.manifest" exited with code 3. [C:\Users\danis\source\repos\MauiApp15\MauiApp15\MauiApp15.csproj]

0 Warning(s)
1 Error(s)

@jfversluis
Copy link
Member Author

We have official docs now on how to publish to an MSIX at least. We have a couple of loose ends (and issues to track them) open to finish up some other things but I think we can close this one for now.

@danies8
Copy link

danies8 commented Apr 21, 2022

How I create a a certificate with thumbprint in app store?
I create blank MAUI solution and publish according to:
https://docs.microsoft.com/en-us/dotnet/maui/windows/deployment/overview
and got this error:
"C:\Users\danis\Desktop\MauiAppTest\MauiAppTest\MauiAppTest.csproj" (Publish target) (1:19) ->
(_GenerateAppxPackageFile target) ->
C:\Users\danis.nuget\packages\microsoft.windowsappsdk\1.0.1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(471,5): error APPX0102: A certificate with thumbprint 'DA2D59B390EA13AC6E151EB273E5F1DD3E3D7FB3'
that is specified in the project cannot be found in the certificate store. Please specify a valid thumbprint in the project file. [C:\Users\danis\Desktop\MauiAppTest\MauiAppTest\MauiAppTest.csproj]
C:\Users\danis.nuget\packages\microsoft.windowsappsdk\1.0.1\buildTransitive\Microsoft.Build.Msix.Packaging.targets(471,5): error APPX0107: The certificate specified is not valid for signing. For more information
about valid certificates, see http://go.microsoft.com/fwlink/?LinkID=241478. [C:\Users\danis\Desktop\MauiAppTest\MauiAppTest\MauiAppTest.csproj]

@jfversluis
Copy link
Member Author

@danies8 you'll have to follow the instructions to create a certificate and make sure the thumbprints match.

If you want to roll out to the store you actually don't even need to sign your msix as it will be signed by the Microsoft Store.

@danies8
Copy link

danies8 commented Apr 24, 2022

Hi jfversluis,
I build my app and create msix when I install it I got this error, why ?
image

@danies8
Copy link

danies8 commented Apr 28, 2022

Can you please provide an answer?

@Eilon
Copy link
Member

Eilon commented Apr 28, 2022

Can you please provide an answer?

This is a closed issue so I recommend filing a new issue with details of how to reproduce, etc.

@dotnet dotnet locked as resolved and limited conversation to collaborators May 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Status: Done
Development

No branches or pull requests