Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

Solved: InstallUtil throws ArgumentOutOfRangeException when trying to install windows service.

$
0
0
This is just to help people troubleshoot the ArgumentOutOfRangeException problem when trying to install a windows service with installutil. It took me a good while to understand the reason of the install failure and I could not find anything about this on the web concerning this problem, so hopefully this will help others in the future so they don't waste as much time as I did.

If you get:

An exception occurred during the Install phase.
System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length

Then:

1) Go to the deisgner of your ProjectInstaller
2) Select the ServiceProcessInstaller
3) Go to the properties of the ServiceProcessInstaller.
4) If you see Account property set to user, change it to LocalSystem.
5) Rebuild your project.
6) Rerun installutil YourService.exe

Then the exception should be gone and the installation successful.

HTH

Sylvain Boissé Software Architect Noesis Innovation www.noesisinnovation.net

Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>