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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T17:10:10+00:00 2026-05-30T17:10:10+00:00

I am building a simple C# application that has to write the user input

  • 0

I am building a simple C# application that has to write the user input in a file.

My first problem is that i want the user to be able to set the path of the settings file, but i want the program to be able to read the settings file on the following starts.

My second problem is that if i use something like :

    File.WriteAllText(@"C:\Users\Public\settings.settings", message);

i get the following error :

    System.Security.SecurityException: Request for the permission of type 
    'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, 
    Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. at 
    System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& 
    stackMark, Boolean isPermSet)   at System.Security.CodeAccessPermission.Demand()
       at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, 
    Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions 
    options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy)
    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, 
    FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)

    at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, 
    FileShare share, Int32 bufferSize, FileOptions options)

     at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize)
    at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding)
    at System.IO.File.WriteAllText(String path, String contents, Encoding encoding)
    at IMDBGrabber.frmSettings.writeToFile(String p)
    The action that failed was: Demand

    The type of the first permission that failed was: System.Security.Permissions.FileIOPermission

    The Zone of the assembly that failed was: MyComputer

Any ideas ?

  • 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-30T17:10:11+00:00Added an answer on May 30, 2026 at 5:10 pm

    Right click on the project => properties and check the Security tab. Uncheck “Enable ClickOnce security settings” and try again.
    If the problem persists uncheck the only option from Signing tab as well.

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

Sidebar

Related Questions

I am building a simple application that has a few buttons that when clicked
I'm building a simple Todo List application where I want to be able to
I'm currently building a web application that has multiple user types, where users engage
I'm building a relatively simple class (ex: Person) for an ASP.NET application that has
I am building a simple C# application that allows the user to edit the
I'm building a simple application. It's a user interface to an online order system.
I'm building a simple web based forum application. I want to allow users to
I'm on the final stretch of my first simple iPhone application. I'm building an
I am learning Python by building a simple PyGTK application that fetches data from
I am building an application that has the functionality like 3 tabs created using

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.