IndexOutOfRangeException в MessageSecurityOverHttpElement при создании клиента WCF из ссылки на службуC#

Место общения программистов C#
Ответить
Anonymous
 IndexOutOfRangeException в MessageSecurityOverHttpElement при создании клиента WCF из ссылки на службу

Сообщение Anonymous »

У меня есть обычная ссылка на службу WCF, созданная с помощью «Добавить ссылку на службу» в приложении, используемом тысячами людей.

Экземпляр клиента создается с использованием new MyServiceClient() и он работает в 99% случаев, но для некоторых пользователей он может завершиться сбоем из-за исключения IndexOutOfRangeException. Мне не удалось воспроизвести, но из моих отчетов об ошибках кажется, что это может произойти только тогда, когда приложение настроено на запуск с Windows, поэтому может ли быть какое-то состояние гонки с какой-либо базовой службой Windows при запуске?

Exception (-2146233080):
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Collections.ArrayList.ArrayListEnumeratorSimple.MoveNext()
at System.Configuration.PropertyInformationCollection..ctor(ConfigurationElement thisElement)
at System.ServiceModel.Configuration.MessageSecurityOverHttpElement.ApplyConfiguration(MessageSecurityOverHttp security)
at System.ServiceModel.Configuration.NonDualMessageSecurityOverHttpElement.ApplyConfiguration(NonDualMessageSecurityOverHttp security)
at System.ServiceModel.Description.ConfigLoader.LookupBinding(String bindingSectionName, String configurationName, BindingCollectionElement bindingCollectionElement, Binding defaultBinding)
at System.ServiceModel.Description.ConfigLoader.LookupBinding(String bindingSectionName, String configurationName, ContextInformation context)
at System.ServiceModel.Description.ConfigLoader.LoadChannelBehaviors(ServiceEndpoint serviceEndpoint, String configurationName)
at System.ServiceModel.ChannelFactory.ApplyConfiguration(String configurationName, Configuration configuration)
at System.ServiceModel.ChannelFactory.InitializeEndpoint(String configurationName, EndpointAddress address)
at System.ServiceModel.ChannelFactory`1..ctor(String endpointConfigurationName, EndpointAddress remoteAddress)
at System.ServiceModel.ConfigurationEndpointTrait`1.CreateSimplexFactory()
at System.ServiceModel.ClientBase`1.CreateChannelFactoryRef(EndpointTrait`1 endpointTrait)
at System.ServiceModel.ClientBase`1.InitializeChannelFactoryRef()


















Подробнее здесь: https://stackoverflow.com/questions/574 ... ng-wcf-cli
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «C#»