Remove limit on Service Name in System.ServiceProcess RRS feed

  • Question

  • I wrote a utility to check specific services and see if they are stopped. The utility restarts the services, if needed. I noticed that for services with long names, the code threw an exception. Long story short, I decompiled the System.ServiceProcess DLL and saw that in both the 2.0 and 4.0 versions of the DLL, the ValidateServiceName method has a length check using an integer value of 80.

    Will these libraries ever get updated to support longer names? I believe the current Windows limit is 256 characters.

    Wednesday, February 25, 2015 5:14 PM


  • Hello Darkwater234,

    It seems it's ture that there is a limit for Service Name with max length 80. I looked through the whole namespace and I only find this related class:https://msdn.microsoft.com/en-us/library/system.serviceprocess.servicebase.maxnamelength(v=vs.110).aspx ServiceBase.MaxNameLength Field, but maybe this field will not help within the method and I haven't find a related method to modify this.

    Do you mind to send a report on uservoice:


    I think if we cannot find the way we'd better submit a report on the above site.

    Best regards,

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Proposed as answer by Fred Bao Friday, March 6, 2015 7:14 AM
    • Marked as answer by Fred Bao Monday, March 9, 2015 6:04 AM
    Thursday, February 26, 2015 8:01 AM