Service is being created with executable path pointing to DLL instead of EXE
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- csharp
調査の方向性
ManagedInstallerClass.InstallHelper と、issue に示されている ServiceInstaller のセットアップから始め、Assembly.GetExecutingAssembly().Location と Environment.ProcessPath を使用して .NET 6 のインストールを再現します。ライブラリがサービスのバイナリパスをどのように導出しているかを追跡し、サービスが意図した実行可能ファイルを起動するように構成した状態で正常にインストールして、修正を検証します。
索引モデルが issue の本文から書いたものです。
説明
We have a service installation code which works just fine with .NET Frameworks 4.8 Console application based on ServiceBase:
ManagedInstallerClass.InstallHelper(new string[] { Assembly.GetExecutingAssembly().Location });
using System.ComponentModel;
using System.Configuration.Install;
using System.ServiceProcess;
namespace TestServiceInstall
{
[RunInstaller(true)]
public class TestServiceInstaller : Installer
{
public TestServiceInstaller()
{
ServiceProcessInstaller processInstaller = new ServiceProcessInstaller();
ServiceInstaller serviceInstaller = new ServiceInstaller();
// set the privileges
processInstaller.Account = ServiceAccount.LocalSystem;
serviceInstaller.DisplayName = GlobalVar.SERVICE_NAME;
serviceInstaller.StartType = ServiceStartMode.Automatic;
serviceInstaller.DelayedAutoStart = true;
serviceInstaller.ServicesDependedOn = new string[] { "Tcpip" };
// must be the same as what was set in Program's constructor
serviceInstaller.ServiceName = GlobalVar.SERVICE_NAME;
// installer code here
this.AfterInstall += new InstallEventHandler(ServiceInstaller_AfterInstall);
this.Installers.Add(processInstaller);
this.Installers.Add(serviceInstaller);
}
void ServiceInstaller_AfterInstall(object sender, InstallEventArgs e)
{
ServiceController sc = new ServiceController(GlobalVar.SERVICE_NAME);
sc.Start();
}
}
}
We tried to migrate to .NET 6.0 and use this library to install the service in a same way we used to, but what happens is service binary path changed from EXE file to DLL file and we can't figure out how to point it to the EXE file.
We've tried changing Assembly.GetExecutingAssembly().Location to Environment.ProcessPath but it gives us the following error:
System.BadImageFormatException: Bad IL format. The format of the file '%EXE path here%' is invalid..
So the question is how can we use this library to install a windows service pointing to EXE file instead of DLL?
- 主要言語
- C#
- スター
- 26
- フォーク
- 12
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
flamencist/Core.System.Configuration.Install のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 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 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
flamencist/Core.System.Configuration.Install#1 · コメント 3 件 · リアクション 1 件 ·
flamencist/Core.System.Configuration.Install の issue をすべて見る
似ている issue
-
priority-0
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
StackExchange/StackExchange.Redis#3249 ·
-
[Feat] 조합 영역 구분선 개선 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
type/automation type/tech-debt
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100