"Cannot get service name" because options for InstallContext need '-' prefix, not '/'.
まだ誰も着手していません。
評価
調査の方向性
まず、CreateTransactedInstaller から渡されるオプションを InstallContext がどのように解析するかを追跡します。特に -assemblypath の値と、報告されているサービス名の失敗を確認します。スラッシュ接頭辞とダッシュ接頭辞での動作を再現し、そのうえで意図された接頭辞の動作を明らかにし、プロジェクトで利用可能な関連するテストまたはドキュメントで結果をカバーします。
索引モデルが issue の本文から書いたものです。
説明
I just ported some software from .NET FrameWork to .NET Core and gratefully used this Nuget package to allow it to install itself as Windows service. I wanted to minimize the amount of work so I didn't want to re-architect my service to the new Worker Service architecture, at least for now.
That didn't work: the install failed with "Cannot get service name" and then rolled back.
It turns out that the problem was that I used a slash '/' instead of a dash '-'.
I don't know if the slash was officially supported in the .NET FrameWork code; the code I'm working on was based on some sample code on the Internet about 10 years ago. So I don't know if I should request that '/' be an alternate prefix character to '-'. I just wanted to post this as an issue because it took me a long time to figure this out, and maybe this is useful for others who run into the same situation.
Fragment of my code after correcting the problem:
private static TransactedInstaller CreateTransactedInstaller(Type T)
{
TransactedInstaller result = new TransactedInstaller();
// NOTE: the path option must start with '-', not '/'. The path must be the .exe file, not a .dll file.
string path = "-assemblypath=" + System.Diagnostics.Process.GetCurrentProcess().MainModule.FileName;
result.Installers.Add(new InstallerConsoleModule(T, null)); // Constructor checks the type
result.Context = new InstallContext(null, new[] { path });
return result;
}
- 主要言語
- C#
- スター
- 26
- フォーク
- 12
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
flamencist/Core.System.Configuration.Install のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
flamencist/Core.System.Configuration.Install#11 · リアクション 2 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
flamencist/Core.System.Configuration.Install#9 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
flamencist/Core.System.Configuration.Install#8 · コメント 3 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
flamencist/Core.System.Configuration.Install#1 · コメント 3 件 · リアクション 1 件 ·
flamencist/Core.System.Configuration.Install の issue をすべて見る
似ている issue
-
type/automation type/tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
t/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
ci-failure-cause test-failure
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
area:auth FE mvp P3
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
klasolsson81/jobbliggaren#1788 ·