Invalid Cross-Thread

4 posts, 0 answers
  1. Nelson
    Nelson avatar
    62 posts
    Member since:
    Apr 2011

    Posted 08 Jun 2011 Link to this post


    I use in my application RadUpload from telerik.

    I have no problem, when upload small multi files, however when I want upload two big files, he give me a Invalid Cross-Thread exception.

    You can see in the image.

    Note that I have this MaxFileSize="10000000" MaxUploadSize="10000000" and the files are smaller than that.

    And if the first file is the smallest one, and the second the big one, he can upload without a problem.

    Any help?
  2. Nelson
    Nelson avatar
    62 posts
    Member since:
    Apr 2011

    Posted 09 Jun 2011 Link to this post


    I already fix the problem. All I did was increase the buffer size and that way works good.
  3. Mariusz
    Mariusz avatar
    24 posts
    Member since:
    Mar 2011

    Posted 09 Nov 2011 Link to this post

    I have the same problem. Two files with sizes above 5MB throw cross-thread exception (just when first file upload is about to be finish)

    Changing the buffer size does affect the issue, however if i put too large number into buffer size i get some other errors.

    Wiersz: 56
    Błąd: Unhandled Error in Silverlight Application
    Code: 4004   
    Category: ManagedRuntimeError      
    Message: System.ArgumentNullException: Value cannot be null.
    Nazwa parametru: key
       w System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
       w System.Collections.Generic.Dictionary`2.FindEntry(TKey key)
       w System.Collections.Generic.Dictionary`2.ContainsKey(TKey key)
       w Telerik.Windows.Controls.RadUpload.OnFileUploadCompleted(Object sender, EventArgs e)    

    Now the buffer size is like 13107200B and I would like to keep it that way or even decrease it. But what if someone uploads a file that would exceed bs quota?

  4. Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 14 Nov 2011 Link to this post

    Hi Rafal,

    I wasn't able to reproduce the exception on our side and this is why I wanted to ask you if you can send a support ticket with a solution where it can be reproduced. This way we will be able to further investigate the case.

    Also, since you're uploading large files you may need to configure your server to be able to accept larger chunks of data. You can do this from the web.config file by setting a larger maxRequestLength with the following code:
            <httpRuntime  maxRequestLength="10000000" executionTimeout="3600" />
            <compilation debug="true" targetFramework="4.0" />
    You can find more info here. Please let us know how it goes.

    Tina Stancheva
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top