Reputation: 813
I have a windows service. In the Properties I have the platform target set as X64. In my csproj file I have changed all instances of prefer32bit to false. I am installing the service with installutil.exe when I install and run my service it runs as 32 bit. I am currently building in debug mode. What am I missing here?
Upvotes: 9
Views: 9686
Reputation: 518
I will recommend to use sc.exe util https://technet.microsoft.com/en-gb/library/bb490995.aspx. It will install windows service depending on platform target framework information you choose in Visual Studio.
Upvotes: 10
Reputation: 77374
You need to use the 64bit version of installutil.exe
to install for 64bit. The normal 32bit version cannot do this.
You can find it in
%WINDIR%\Microsoft.NET\Framework64\ $VERSION \InstallUtil.exe
instead of
%WINDIR%\Microsoft.NET\Framework\ $VERSION \InstallUtil.exe
Upvotes: 14