尝试使用 MSIX 发布 .Net Maui 应用程序,但未生成“应用程序安装文件”(.appinstaller) 及其所有内容。我正在使用 Visual Studio 发布方法(包括 SideLoading),右键单击项目并按“发布”。
使用 Windows 10。我的应用程序的 TargetPlatformMinVersion:
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
Run Code Online (Sandbox Code Playgroud)
以下是我遵循的步骤:
右键单击该项目并选择发布,然后以下图像来自向导。
结果:
在最后一张幻灯片中,捆绑设置为“否”,所需的操作系统为空白,我不知道这是否是问题,但如果是问题,我该如何解决这个问题。
然后我按“复制并关闭”,但 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>
Run Code Online (Sandbox Code Playgroud) 第一次尝试 PHP 并尝试运行基本的 PHP 程序。
我遵循的步骤:
<html>
<head></head>
<body>
<?php
echo "yeet";
?>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
结果是:
我想在剃刀页面中做这样的事情:
@if (currentwidth<x)
{
le code
}
else
{
le other code
}
Run Code Online (Sandbox Code Playgroud)
我添加了 javascript 文件并将其连接到一个实用程序服务,该服务在我获得静态宽度(我测试过)时起作用。
js:
export function getCurrentWidth() {
return window.addEventListener("resize", () => {
window.innerWidth;
});
}
Run Code Online (Sandbox Code Playgroud)
实用服务方法:
public async Task<double> GetCurrentWidth()
{
var m = await GetModule();
var result = await m.InvokeAsync<double>("getCurrentWidth");
return result;
}
Run Code Online (Sandbox Code Playgroud)
剃刀文件:
double width;
protected async override Task OnInitializedAsync()
{
width = await utilityService.GetCurrentWidth();
}
Run Code Online (Sandbox Code Playgroud)
因此,问题是我无法从 OnInitailzedAsync 调用它,因为该函数仅触发一次,因此我需要一个不断检查 GetCurrentWIdth() 方法以检查调整大小的函数。
在 blazor 中是否有其他方法可以做到这一点,或者我可以使用什么方法/提前谢谢您。