?
Solved

Help with using application settings in vb.net

Posted on 2012-04-11
7
Medium Priority
?
356 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 20

Assisted Solution

by:BuggyCoder
BuggyCoder earned 664 total points
ID: 37832182
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 336 total points
ID: 37832197
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 332 total points
ID: 37832199
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
Containers & Docker to Create a Powerful Team

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

 
LVL 20

Assisted Solution

by:BuggyCoder
BuggyCoder earned 664 total points
ID: 37832235
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 70

Accepted Solution

by:
Éric Moreau earned 336 total points
ID: 37833785
0
 
LVL 7

Assisted Solution

by:vbigham
vbigham earned 332 total points
ID: 37834273

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
ID: 37836960
Cheers. That's it working.
0

Featured Post

Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses

765 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