user3839756
user3839756

Reputation: 813

How can I run my windows service as 64 bit

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

Answers (2)

Maksym Voronytskyi
Maksym Voronytskyi

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.

enter image description here

Upvotes: 10

nvoigt
nvoigt

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

Related Questions