Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8840367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:26:58+00:00 2026-06-14T10:26:58+00:00

I have the following code where I’m trying to download 3 different files from

  • 0

I have the following code where I’m trying to download 3 different files from the users SkyDrive Account.

I’m using the SkyDrive API for Windows Phone development.

client.DownloadCompleted += new EventHandler<LiveDownloadCompletedEventArgs>(OnDownloadCompletedVI);
client.DownloadAsync(fileIdVehicleItems);


client.DownloadCompleted += new EventHandler<LiveDownloadCompletedEventArgs>(OnDownloadCompletedHI);
client.DownloadAsync(fileIdHistoryItems);


client.DownloadCompleted += new EventHandler<LiveDownloadCompletedEventArgs>(OnDownloadCompletedRI);
client.DownloadAsync(fileIdRepairItems);

When I run this, the only method that gets called is the OnDownloadCompletedVI. All the files that are being downloaded are running through this method which is causing an error.

What am I doing incorrectly?

Update

I have the following method, but I have 2 other similar methods that do the exact same thing except it loads different objects (based off of the downloaded files).

The error I’m currently receiving:

An exception of type ‘System.ArgumentException’ occurred in
mscorlib.ni.dll but was not handled in user code

    void OnDownloadCompletedVI(object sender, LiveDownloadCompletedEventArgs e)
    {
        if (e.Result != null)
        {
            using (var stream_vi = e.Result)
            {
                StreamReader SRVI = new StreamReader(stream_vi);
                string contentVI = "";
                contentVI = SRVI.ReadToEnd();

                StringReader rdr_vi = new StringReader(contentVI);

                XmlSerializer serializer = new XmlSerializer(typeof(ObservableCollection<vehicle>));

                ObservableCollection<vehicle> importedVehicles = new ObservableCollection<vehicle>();
                importedVehicles = (ObservableCollection<vehicle>)serializer.Deserialize(rdr_vi);

                StorageHelper.Save<ObservableCollection<vehicle>>(App.vehicleData, importedVehicles);
            }
            //e.Result.Close();
        }
        else
        {
            infoTextBlock.Text = "Error downloading file: " + e.Error.ToString();
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:26:59+00:00Added an answer on June 14, 2026 at 10:26 am

    Actually all three methods should be called. Of course, if the first method is called and throws an exception the other two won’t trigger.

    What you can do is either create a new client for each call, or download them in order, so when the OnDownloadCompletedVI method is complete, remove the event handler for OnDownloadCompletedVI and add the one for OnDownloadCompletedHI and then trigger the client.DownloadAsync(fileIdHistoryItems); at the end of the method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code for updating user's column public void UpdateLastModifiedDate(string username) { using
I have following code for loading image from url in xml parsing endElement method
I have following code for inserting data into database using PDO. It inserts data
I have following code using hibernate to throw a custom exception on error and
I have following code in my template: <div class=account> {% if request.user.is_authenticated %} <a
I have following code - methods to read XML files. But it works very
I have following code.. $query = SELECT quote, author FROM quotes ORDER BY id
I have following code for opening all files: int ret= open(zFile, flags, mode); posix_fadvise
I have following code var res = from c in model.Data select new object[]
I have following code import imp from my_module import MyClass import my_module imp.reload(my_module) print(MyClass

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.