Solved

Help with using application settings in vb.net

Posted on 2012-04-11
7
347 Views
Last Modified: 2012-04-12
Hi,

I hope that someone is able to help. Please find uploaded word document for reference.
I have been reading a tutorial online about accessing application settings.
However when i try to access my variable "debugmodeon":

My.Settings.debugmodeon

I receive the following error - Error      1      
'debugmodeon' is not a member of 'LabourEntryScreen.My.MySettings'.      

I am sure its something simple that i have missed out.

Regards,

Ross
appSettings.docx
0
Comment
Question by:ross13
7 Comments
 
LVL 20

Assisted Solution

by:BuggyCoder
BuggyCoder earned 166 total points
Comment Utility
Assuming name of your settings file is Settings.settings, use this:-

My.Settings.Default.debugmodeon

Open in new window

0
 
LVL 14

Assisted Solution

by:binaryevo
binaryevo earned 84 total points
Comment Utility
Looks like your trying to say debugmodeon() which is incorrect it should be

Dim s as String = My.Settings.debugmodeon

Open in new window


This tutorial should be able to help you:

http://www.codeproject.com/Articles/12252/Application-settings-in-VB-NET-2-0-and-Visual-Stud
0
 
LVL 17

Assisted Solution

by:nepaluz
nepaluz earned 83 total points
Comment Utility
Where is this failing? Is it in the debuger or when you deploy? Also, if after you deploy, how are you deploying the application?
0
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 20

Assisted Solution

by:BuggyCoder
BuggyCoder earned 166 total points
Comment Utility
i am sorry, you need to use this instead, Just Remove My and simply do this to access your variable:-

Settings.Default.debugmodeon

Open in new window

0
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 84 total points
Comment Utility
0
 
LVL 7

Assisted Solution

by:vbigham
vbigham earned 83 total points
Comment Utility

Open in new window

If you locate the Settings.Designer.vb file under the "My Project" folder, you should be able to find the generated property.  If I add one it looks like this:

        <Global.System.Configuration.ApplicationScopedSettingAttribute(), _
         Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
         Global.System.Configuration.DefaultSettingValueAttribute("True")> _
        Public ReadOnly Property IsDebugModeOn() As Boolean
            Get
                Return CType(Me("IsDebugModeOn"), Boolean)
            End Get
        End Property

Open in new window


If it is showing up, but still in error..  I don't know maybe there is some kind of conflict in your project with the My namespace..  

You should still be able to access it by fully qualifying the path to the MySettings default object like this:

        Global.LabourEntryScreen.My.MySettings.Default.IsDebugModeOn

Open in new window

0
 

Author Closing Comment

by:ross13
Comment Utility
Cheers. That's it working.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Launch Process with NOT as Administrator 15 65
Problem to go to Web page 2 48
Format column on datatable 7 14
XML & .net 5 16
Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now