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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:20:45+00:00 2026-05-28T13:20:45+00:00

This is an offline app And I am simply trying to write back to

  • 0

This is an offline app And I am simply trying to write back to to the Settings.settings file.

In my project under Properties in the file named Settings.settings I add

Name: User, Type: string, Scope:User, Value:Default

After that in my App.xaml.cs file I attempt to read from and write to that value. I have no issue reading from that value, but it seems that it is not even an option to write back.

Here is my code:

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace StrainTracker
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        string userName= StrainTracker.Properties.Settings.Default.User;
        StrainTracker.Properties.Settings.Default.User = "SomethingSilly"; //line 16
        StrainTracker.Properties.Settings.Default.Save();                  //line 17
    }
}

Here are the errors generated by visual studio.

Error   1   Invalid token '=' in class, struct, or interface member declaration ..\Projects\StrainTracker\StrainTracker\App.xaml.cs 16  63  StrainTracker
Error   2   Invalid token '(' in class, struct, or interface member declaration ..\Projects\StrainTracker\StrainTracker\App.xaml.cs 17  55  StrainTracker
Error   3   'StrainTracker.Properties.Settings.Default' is a 'property' but is used like a 'type'   ..\Projects\StrainTracker\StrainTracker\App.xaml.cs 16  43  StrainTracker
Error   4   'StrainTracker.Properties.Settings.Default' is a 'property' but is used like a 'type'   ..\Projects\StrainTracker\StrainTracker\App.xaml.cs 17  43  StrainTracker

I can not for the life of me figure out what the issue is. Any thoughts?

  • 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-28T13:20:46+00:00Added an answer on May 28, 2026 at 1:20 pm

    Consider placing the code inside a constructor or some method:

    public partial class App : Application 
    {
        public App()
        { 
            string userName= StrainTracker.Properties.Settings.Default.User;
            StrainTracker.Properties.Settings.Default.User = "SomethingSilly";
            StrainTracker.Properties.Settings.Default.Save();
        }
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to build an offline web app for the iPad, and I
I have an have an html5 offline app. I am using the cache.manifest file
This past summer I was developing a basic ASP.NET/SQL Server CRUD app, and unit
I am trying to create a simple offline application for personal-use that uses a
I just need simple and working facebook app. I bought ssl for this and
I have a small offline app which you can create boxes dynamically and the
Just a quick hypothetical before I get too far on this project! When creating
Hi I'm designed a web app to be used offline at my company. People
I'm trying to publish to facebook from my program, but I'm getting: {error:{type:OAuthException,message:(#3) App
I'm trying to write a facebook application using Java tomcat with RestFB. the restfb

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.