尝试使用MSIX发布.Net Maui应用程序,但是没有生成'APP INSTALLER文件‘(.appinstaller)及其所有内容。我使用的是发布的Visual方法(包括SideLoading),在该方法中,右键单击项目并按“发布”。
使用Windows10.我的应用程序的TargetPlatformMinVersion:
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>以下是我遵循的步骤:
右键单击该项目并选择“发布”,然后以下图像来自向导。




结果:

在最后一张幻灯片中,Bundle设置为No,而所需的操作系统设置为空,我不知道这是否是问题所在,但如果是的话,我该如何解决这个问题。
然后我按Copy并关闭,但是C:\Dev\Installer中没有生成安装程序文件和MSIX包文件。它是空的,但是应该有一个包和一个安装程序文件,我可以用它来将更新推到用户已经安装的应用程序中。
我的项目中的生成设置:
<GenerateAppInstallerFile>True</GenerateAppInstallerFile>
<AppxPackageSigningEnabled>True</AppxPackageSigningEnabled>
<PackageCertificateKeyFile>..._TemporaryKey.pfx</PackageCertificateKeyFile>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<AppxSymbolPackageEnabled>False</AppxSymbolPackageEnabled>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppInstallerUri>C:\Dev\Installer</AppInstallerUri>
<HoursBetweenUpdateChecks>0</HoursBetweenUpdateChecks>发布于 2022-09-08 06:26:33
我也有同样的问题。我遵循了发布向导,没有生成.appinstaller文件和index.html文件,而包含MSIX文件和所有其他内容的文件夹正在按预期生成。
我开始认为这是Visual的一个bug,所以我希望一个新的版本能够解决这个问题。
现在,我通过创建自己的.appinstaller文件并将其放入安装程序位置,成功地使其工作。我知道这不是一个最终的解决方案,因为它要求我每次部署新版本时都手动更新.appinstaller文件。不过,至少我能够让客户端应用程序自动更新。
下面是该文件的一个示例:
<?xml version="1.0" encoding="utf-8"?>
<AppInstaller
xmlns="http://schemas.microsoft.com/appx/appinstaller/2017/2"
Version="1.0.0.0"
Uri="uri where this file is stored (including the file name), i.e. the installer location" >
<MainPackage
Name="Application GUID found in project's properties"
Publisher="This has to match exactly what is the subject in your second screenshot, e.g. CN=John Doe"
Version="Your package version"
ProcessorArchitecture="x64"
Uri="The location of the generated MSIX file of the latest version" />
<UpdateSettings>
<OnLaunch
HoursBetweenUpdateChecks="0" />
<AutomaticBackgroundTask />
</UpdateSettings>
</AppInstaller>一旦我准备好部署一个新版本,我就按照相同的发布向导生成包含MSIX文件的文件夹,然后我需要用正确的版本和MSIX URI手动更新上面的代码。
注意:我在.NET MAUI默认应用程序上测试了这一点,因为我只想弄清楚如何部署和推送更新,更复杂的应用程序可能需要在应用程序安装程序文件中提供更多信息。
发布于 2022-08-05 06:20:23
要发布应用程序,打开Developer Command Prompt for VS 2022 Preview终端并导航到.NET MAUI应用程序项目的文件夹。运行dotnet发布命令如下:
dotnet publish -f net6.0-windows{version} -c Release发布构建并打包应用程序,将签名包复制到bin\Release\net6.0-windows10.0.19041.0\win10-x64\AppPackages\文件夹。哪里是以项目和版本命名的文件夹。在这个文件夹中有一个msix文件,这是应用程序包。
有关更多细节,您可以参考此链接。
https://stackoverflow.com/questions/73237410
复制相似问题