そこで、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..
同じアプローチは、別のアセンブリをインストールする場合にも問題なく機能します。失敗したのは.NET4.0用に書かれていて、動作するのは3.5にあるからかもしれません。
誰かがこの問題の経験がありますか?