Когда я создаю новую службу Windows в Visual Studio 2010, я получаю сообщение об использовании InstallUtil и net start для запуска службы.
Я пробовал следующие шаги:
- Создать новый проект File -> New -> Project -> Windows Service
- Название проекта: TestService
- Создать проект как есть (конструктор Service1, OnStart, OnStop)
- Откройте командную строку, запустите «C: \ Windows \ Microsoft.NET \ Framework \ v4.0.30319 \ InstallUtil.exe» TestService.exe.
- Запустите net start TestService.
Результат шага 4
Запуск транзакционной установки.
Начало этапа установки.
Просмотрите содержимое файла журнала для прогресса сборки C: \ Users \ myusername \ Documents \ Visual Studio 2010 \ Projects \ TestService \ TestService \ obj \ x86 \ Debug \ TestService.exe.
Файл находится по адресу C: \ Users \ myusername \ Documents \ Visual Studio 2010 \ Projects \ Tes tService \ TestService \ obj \ x86 \ Debug \ TestService.InstallLog.
Установка сборки 'C: \ Users \ myusername \ Documents \ Visual Studio 2010 \ Projects \ TestS ervice \ TestService \ obj \ x86 \ Debug \ TestService.exe'.
Затронутые параметры:
logtoconsole =
logfile = C: \ Users \ myusername \ Documents \ Visual Studio 2010 \ Projects \ TestService \ T estService \ obj \ x86 \ Debug \ TestService.InstallLog
путь к сборке = C: \ Users \ myusername \ Documents \ Visual Studio 2010 \ Projects \ TestServ ice \ TestService \ obj \ x86 \ Debug \ TestService.exe
В сборке C: \ Users \ myusername \ Documents \ Visual Studio 2010 \ Projects \ TestService \ TestSe rvice \ obj \ x86 \ Debug \ TestService.exe не найдено общедоступных установщиков с атрибутом RunInstallerAttribute.Yes.
Фаза установки завершена успешно, и начинается фаза фиксации.
Просмотрите содержимое файла журнала для прогресса сборки C: \ Users \ myusername \ Documents \ Visual Studio 2010 \ Projects \ TestService \ TestService \ obj \ x86 \ Debug \ TestService.exe.
Файл находится в C: \ Users \ myusername \ Documents \ Visual Studio 2010 \ Projects \ Tes tService \ TestService \ obj \ x86 \ Debug \ TestService.InstallLog.
Фиксация сборки 'C: \ Users \ myusername \ Documents \ Visual Studio 2010 \ Projects \ TestS ervice \ TestService \ obj \ x86 \ Debug \ TestService.exe'.
Затронутые параметры:
logtoconsole =
logfile = C: \ Users \ myusername \ Documents \ Visual Studio 2010 \ Projects \ TestService \ T estService \ obj \ x86 \ Debug \ TestService.InstallLog
путь к сборке = C: \ Users \ myusername \ Documents \ Visual Studio 2010 \ Projects \ TestServ ice \ TestService \ obj \ x86 \ Debug \ TestService.exe
В сборке C: \ Users \ myusername \ Documents \ Visual Studio 2010 \ Projects \ TestService \ TestSe rvice \ obj \ x86 \ Debug \ TestService.exe не найдено общедоступных установщиков с атрибутом RunInstallerAttribute.Yes.
Удалите файл InstallState, потому что нет установщиков.
Фаза фиксации завершена успешно.
Транзакционная установка завершена.
Результат этапа 5
Имя службы недействительно.
Дополнительную помощь можно получить, набрав NET HELPMSG 2185.