Solved

Help with using application settings in vb.net

Posted on 2012-04-11
7
354 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 166 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 84 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 83 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
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
LVL 20

Assisted Solution

by:BuggyCoder
BuggyCoder earned 166 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 84 total points
ID: 37833785
0
 
LVL 7

Assisted Solution

by:vbigham
vbigham earned 83 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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

733 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