Итак, я создал службу на C # и пытаюсь установить ее с помощью следующей команды:
C:\WINDOWS\Microsoft.NET\Framework64\v2.0.50727\installutil.exe MyService.exe >> installLog.txt
Не работает. Когда я смотрю файл installLog.txt, я получаю следующее:
Microsoft (R) .NET Framework Installation utility Version 2.0.50727.3053
Copyright (c) Microsoft Corporation. All rights reserved.
Exception occurred while initializing the installation:
System.BadImageFormatException: Could not load file or assembly 'file:///C:\MyService.exe' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded..
Тот же подход отлично работает для установки другой сборки. Я чувствую, что это может быть потому, что тот, который не работает, был написан для .NET 4.0, а тот, который работает, - для 3.5.
Есть ли у кого-нибудь опыт решения этой проблемы?