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 9208879
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:42:46+00:00 2026-06-18T00:42:46+00:00

I am trying to overwrite the content of a file but it keeps throwing

  • 0

I am trying to overwrite the content of a file but it keeps throwing access denied

System.IO.Stream s2 = await Windows.ApplicationModel.Package.Current.InstalledLocation.OpenStreamForWriteAsync("Assets\\xyz.txt", Windows.Storage.CreationCollisionOption.ReplaceExisting);
System.IO.StreamWriter sw = new StreamWriter(s2);

How can i make it work?? The exception is

System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  at System.IO.WindowsRuntimeStorageExtensions.<OpenStreamForWriteAsyncCore>d__10.MoveNext()
  --- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
  at System.IO.WindowsRuntimeStorageExtensions.<OpenStreamForWriteAsyncCore>d__10.MoveNext()
  --- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
  at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
  at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
  at
  • 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-18T00:42:47+00:00Added an answer on June 18, 2026 at 12:42 am

    You can’t write to the area where the package is installed, by the looks of it. From "App packages and deployment":

    Windows Store app deployment

    The Windows Store app model is a declarative state-driven process that provides all installation and update data and instructions for an app in a single package. In this declarative model, deployment operations are reliable. The files shipped in the package are immutable, which means that they haven’t been modified since they were delivered to the computer. Because the package owner doesn’t need to write custom actions and code, the number of failure points are reduced.

    If you need to update the assets for all users, it sounds like you should just publish a new version, e.g. via the isolated storage API.

    If you need to write user-specific data, you’ll need to pick a different location.

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

Sidebar

Related Questions

Actually i'm trying to stream a CSV file. I set the encoding to windows-1252
I have an application where I am trying to implement a safe file overwrite
I am trying to read content from a .txt file and I want to
I am trying to download a file from FTP via my app. But neither
I am trying to parse a plain text file using Tika but getting inconsistent
I'm trying to lock a file with Java in Windows environment with FileLock and
I'm trying create a simple audio stream server like a concept proof, but I'm
I'm trying to use jquery load function, but I can't get the whole content
Im trying to get my menu inflater to link to my layout file, but
I am using Rails 3.1.3 with active admin gem. I am trying overwrite the

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.