"Cannot get service name" because options for InstallContext need '-' prefix, not '/'.
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Bắt đầu bằng việc lần theo cách InstallContext phân tích các tùy chọn được truyền vào bởi CreateTransactedInstaller, đặc biệt là giá trị của -assemblypath và lỗi liên quan đến tên dịch vụ đã được báo cáo. Tái hiện hành vi với các tiền tố dấu gạch chéo và dấu gạch ngang, sau đó xác định hành vi tiền tố dự kiến và kiểm chứng kết quả bằng bài kiểm thử hoặc tài liệu liên quan hiện có trong dự án.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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;
}
- Ngôn ngữ chính
- C#
- Star
- 26
- Fork
- 12
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của flamencist/Core.System.Configuration.Install
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
flamencist/Core.System.Configuration.Install#11 · 2 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
flamencist/Core.System.Configuration.Install#9 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
flamencist/Core.System.Configuration.Install#8 · 3 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
flamencist/Core.System.Configuration.Install#1 · 3 bình luận · 1 reaction ·
Tất cả issue của flamencist/Core.System.Configuration.Install
Issue tương tự
-
copilot documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Broken Text debugger displayĐang mởneeds triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
spectreconsole/spectre.console#2221 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
godotengine/godot-docs#12428 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
.NET triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 73/100
microsoft/semantic-kernel#14526 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày