Better exception when performance counter instance name limit is reached

Fixes #2352
yes

On 14 October 2014 17:31, Simon Cropp <notifications@github.com> wrote:

> In src/NServiceBus.Core/Monitoring/PerformanceCounterHelper.cs:
>
> >          public static PerformanceCounter InstantiateCounter(string counterName, string endpointName)
> >          {
> > +            if (endpointName.Length > SByte.MaxValue)
> > +            {
> > +                throw new Exception(string.Format("The endpoint name ('{0}') is too long (longer then {1}) to register as a performance counter instance name. Please reduce the endpoint name.", endpointName, (int)SByte.MaxValue));
>
> is the cast required in (int)SByte.MaxValue ?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Particular/NServiceBus/pull/2467/files#r18812624>.
>