1

アプリをダウンロードしてクライアントで実行するために実際にWebサーバーを使用するWPFアプリケーションがあります...新機能が追加されたらすぐにリリースするときに、そのアプリケーションのステージング環境も作成しました/バグ修繕。

app.config がハッシュされているため、ステージングから本番環境に昇格する合理的な方法が見つかりませんでした...そのため、ポイント (DB/サービス) を編集して変更することはできません...

私の実際の方法は、ステージング用に公開し、公開バージョンを 1 つ増やし、本番用に公開することです...しかし、これは非常にイライラします....私は 2 倍の作業をしなければならないので...何か提案はありますか?

ありがとう

4

1 に答える 1

1

私たちのチームは、1 年前に同じ状況に遭遇しました。次の手順に従って状況を解決しました。

  • 最新の ClickOnce アプリケーション バージョンを確認します。
  • *.deploy 拡張子を削除します。
  • 必要な *.config ファイルの変更。
  • 「Mage.exe」と証明書を使用してマニフェスト ファイル (*.manifest) を更新する (参照: MSDN );
  • 'Mage.exe' を使用して、アプリケーション バージョン ディレクトリとルート ディレクトリにある配置マニフェスト (*.application) を更新します。
  • *.deploy 拡張子を追加し直します。

これは、Mage を呼び出すための短いコード サンプルですが、それほど複雑ではありません。

// Compose the arguments to start the Mage tool.
string arguments = string.Format(
@"-update ""{0}"" -appmanifest ""{1}"" -certfile ""{2}""",
deploymentManifestFile.FullName,
applicationManifestFile.FullName,
_certificateFile);

// Add password to the list of arguments if necessary.
arguments += !string.IsNullOrEmpty(_certificateFilePassword) ? string.Format(" -pwd {0}", _certificateFilePassword) : null;

// Start the Mage process and wait it out.
ProcessStartInfo startInfo = new ProcessStartInfo(_mageToolPath, arguments);
startInfo.UseShellExecute = false;
startInfo.CreateNoWindow = true;
startInfo.RedirectStandardOutput = true;
Process mageProcess = Process.Start(startInfo);
mageProcess.WaitForExit();

// Show all output of the Mage tool to the current console.
string output = mageProcess.StandardOutput.ReadToEnd();

// Determine the update of the manifest was a success.
bool isSuccesfullyConfigured = output.ToLower().Contains("successfully signed");
于 2013-11-05T07:32:40.370 に答える