
UWP アプリケーションを配布しようとしているのですが、少し奇妙な問題が発生しました。
- アプリケーションは自動更新機能を使用してVisual Studioから構築され、
.appinstaller
ファイルと関連するMSIXバンドルなどが生成されます。 - これらの成果物は配布のためにAzure App Serviceにアップロードされます
- ファイルをダウンロードして実行すると
.appinstaller
エラーが発生しますError in parsing the app package.
- 特に役に立ちません - アプリは、以下の場所にインストールされている証明書で署名されています。
Trusted Publishers
web.config
サーバー上のファイルは、MIME タイプを正しくマップするように設定されています。
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.webServer>
<staticContent>
<mimeMap fileExtension=".appx" mimeType="application/appx" />
<mimeMap fileExtension=".msix" mimeType="application/msix" />
<mimeMap fileExtension=".appxbundle" mimeType="application/appxbundle" />
<mimeMap fileExtension=".msixbundle" mimeType="application/msixbundle" />
<mimeMap fileExtension=".appinstaller" mimeType="application/appinstaller" />
</staticContent>
</system.webServer>
</configuration>
PowerShell (管理者権限なし) からインストールを
Add-AppxPackage -Appinstaller https://[test].azurewebsites.net/[appname].appinstaller
正しく実行すると、アプリがインストールされ、正常に動作します。Fiddler を使用して、UI 経由でインストールするとサーバーから 412 エラーが発生することを確認しました。
リクエスト:
GET https://[test].azurewebsites.net/[appname]_1.0.0.0_Test/[appname]_1.0.0.0_x64.msixbundle HTTP/1.1
Connection: Keep-Alive
Accept-Encoding: gzip, deflate
If-Match: W/"086c9a4cfd51:0"
Range: bytes=10878976-11010047
If-Unmodified-Since: Mon, 20 May 2019 20:42:56 GMT
Host:[test].azurewebsites.net
応答:
HTTP/1.1 412 Precondition Failed
Content-Length: 86
Content-Type: text/html
Last-Modified: Mon, 20 May 2019 20:42:56 GMT
Accept-Ranges: bytes
ETag: W/"086c9a4cfd51:0"
Server: Microsoft-IIS/10.0
X-Powered-By: ASP.NET
Date: Mon, 20 May 2019 20:21:12 GMT
The request was not completed due to preconditions that are set in the request header.
- PowerShell クライアントは、
If-Unmodified-Since
またはIf-Match
ヘッダーを送信しないようです。
GET https://[test].azurewebsites.net/[appname]_1.0.0.0_Test/[appname]_1.0.0.0_x64.msixbundle HTTP/1.1
Connection: Keep-Alive
Range: bytes=11079260-11145819
User-Agent: App Virt Client/1.0
Host: [test].azurewebsites.net
上記を踏まえると、
.appinstaller
IIS でUWP をホストするための明らかなサーバー構成が欠けているのでしょうか?- UI経由で UWP アプリケーションをサイドロードする場合、既知の問題はありますか
.appinstaller
? - 前提条件が問題の原因かどうかをテストするために、前提条件を無視するように IIS を構成する方法はありますか?
編集:
ログファイル ( AILog.txt
) が見つかりました:
[Tue May 21 15:40:17 2019]{10188} Manifest Info -> Package is Not Headless
[Tue May 21 15:40:17 2019]{10188} Manifest Info -> Package is Not a Modification Package
[Tue May 21 15:40:17 2019]{10188} ERROR: AppsInfo -> Error: [0x80004005]
編集2:
多くの調査を経て、比較的変更の少ない動作するビルドが完成しました。
EnableDotNetNativeCompatibleProfile
(私はこれを に設定しましたtrue
)RuntimeIdentifiers
(これらを .csproj ファイルに追加しました)- VS2019ではなくVS2017からビルドする
消去法によって、どれが犯人であるかが特定されることを期待します。