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

  • Home
  • SEARCH
  • 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 308845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:41:16+00:00 2026-05-12T07:41:16+00:00

The following code throws an exception… private void EnsureDiskSpace() { using (IsolatedStorageFile file =

  • 0

The following code throws an exception…

private void EnsureDiskSpace()
{
    using (IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForSite())
    {
        const long NEEDED = 1024 * 1024 * 100;

        if (file.AvailableFreeSpace < NEEDED)
        {
            if (!file.IncreaseQuotaTo(NEEDED))
            {
                throw new Exception();
            }
        }
    }
}

But this code does not (it displays the silverlight “increase quota” dialog)…

private void EnsureDiskSpace()
{
    using (IsolatedStorageFile file = IsolatedStorageFile.GetUserStoreForSite())
    {
        const long NEEDED = 1024 * 1024 * 100;

        if (file.Quota < NEEDED)
        {
            if (!file.IncreaseQuotaTo(NEEDED))
            {
                throw new Exception();
            }
        }
    }
}

The only difference in the code is that the first one checks file.AvailableFreeSpace and the second checks file.Quota.

Are you not allowed to check the available space before requesting more? It seems like I’ve seen a few examples on the web that test the available space first. Is this no longer supported in SL3? My application allows users to download files from a server and store them locally. I’d really like to increase the quota by 10% whenever the user runs out of sapce. Is this possible?

  • 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-05-12T07:41:16+00:00Added an answer on May 12, 2026 at 7:41 am

    It turns out that both code blocks work… unless you set a break point. For that matter, both code blocks fail if you do set a break point.

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

Sidebar

Ask A Question

Stats

  • Questions 506k
  • Answers 506k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Thanks to another question, I replaced the beinning with: from… May 16, 2026 at 3:35 pm
  • Editorial Team
    Editorial Team added an answer AJAH is someone's attempt to come up with a new… May 16, 2026 at 3:35 pm
  • Editorial Team
    Editorial Team added an answer The answer to my question was IN my question h.add_certificate(keyfile,… May 16, 2026 at 3:35 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

The following code throws an exception in Powershell V1 (Excel 2007): $E = New-Object
The following simple code throws exception: entityManager.createQuery(SELECT c FROM Customer c); But if I
The following code throws a StaleStateException exception when the Order.OrderItems property (an IList) is
The following code always throws exception .... DataServiceContext ctx = account.CreateCloudTableClient().GetDataServiceContext(); var val =
Can someone tell me why the following code intermittently throws an exception ? I
i am using debugger following is my code when i give input for date
Using Python, what's the correct way to set a file to be read-only when
In my code I am using a UISegmentedControl as a button with only ONE
I have .Net 2.0 Windows form containing combobxes. I have written following code to
The following code is throwing OutofMemoryError on Linux 3.5 enterprise box running jdk1.6.0_14 but

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.