locked
ado.net data services - Index was out of range RRS feed

Answers

  • If I do the same thing in a fresh project/website I don't get this.

    Any ideas?

    Here's the whole error:

    Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index]
       System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) +64
       System.ThrowHelper.ThrowArgumentOutOfRangeException() +15
       System.Collections.Generic.List`1.get_Item(Int32 index) +7495292
       System.ServiceModel.Web.WebServiceHost.AddAutomaticWebHttpBindingEndpoints(ServiceHost host, IDictionary`2 implementedContracts, String multipleContractsErrorMessage) +82
       System.ServiceModel.Web.WebServiceHost.OnOpening() +203
       System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +229
       System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +121
       System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479
    
    [ServiceActivationException: The service '/aspBLOBTest/WebDataService.svc' cannot be activated due to an exception during compilation.  The exception message is: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index.]
       System.ServiceModel.AsyncResult.End(IAsyncResult result) +11527290
       System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194
       System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176
       System.ServiceModel.Activation.HttpHandler.ProcessRequest(HttpContext context) +23
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
    
    Tuesday, August 11, 2009 10:38 PM

All replies

  • If I do the same thing in a fresh project/website I don't get this.

    Any ideas?

    Here's the whole error:

    Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index

    Source Error:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index]
       System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) +64
       System.ThrowHelper.ThrowArgumentOutOfRangeException() +15
       System.Collections.Generic.List`1.get_Item(Int32 index) +7495292
       System.ServiceModel.Web.WebServiceHost.AddAutomaticWebHttpBindingEndpoints(ServiceHost host, IDictionary`2 implementedContracts, String multipleContractsErrorMessage) +82
       System.ServiceModel.Web.WebServiceHost.OnOpening() +203
       System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) +229
       System.ServiceModel.HostingManager.ActivateService(String normalizedVirtualPath) +121
       System.ServiceModel.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath) +479
    
    [ServiceActivationException: The service '/aspBLOBTest/WebDataService.svc' cannot be activated due to an exception during compilation.  The exception message is: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index.]
       System.ServiceModel.AsyncResult.End(IAsyncResult result) +11527290
       System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result) +194
       System.ServiceModel.Activation.HostedHttpRequestAsyncResult.ExecuteSynchronous(HttpApplication context, Boolean flowContext) +176
       System.ServiceModel.Activation.HttpHandler.ProcessRequest(HttpContext context) +23
       System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
    
    Tuesday, August 11, 2009 10:38 PM
  • If I do the same thing in a fresh project/website I don't get this.
    So is it working now with a new project, or are you still getting that error consistently?


    It's hard to tell what is throwing the IndexOutOfRangeException, but I don't see anything specific to ADO.NET Data Services in the call-stack. If it is still happening, can you send me a zipped version of your project at 'mmeehan' at microsoft?

    Matt Meehan, ADO.NET Data Services (Astoria)
    Wednesday, August 12, 2009 4:08 PM
    Moderator
  • I faced the same problem a while ago when deploying ADO.Net Data Services within Web Application.

    The workaround is quite simple:
    1. In Web Application Project properties, set Virtual Path attribute to "/"
    2. If you use Publish Web Site wizard, do NOT use "Allow this precompiled site to be updatable" option.

    There are some additional issues related to IIS Bindings, however, the aforementioned workaround works fine with custom ports (not 80)


    Additional workaround is just to use WCF Service Application project to host ADO.Net Data Service.


    Hopefully :)
    • Edited by Mark ZENIT Thursday, September 3, 2009 11:39 AM Another workaround
    Thursday, September 3, 2009 11:08 AM
  • I'm getting this in a project that has been running just fine for 10 days. I am more than a little suspicious that the error is being thrown on a column that was newly added to the table, and the row is one which existed before the column was added. (Although other columns that were added at the same time are not throwing this error.)
    Wednesday, September 23, 2009 8:45 PM