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
Solved

Help with using application settings in vb.net

Posted on 2012-04-11
7
353 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
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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

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…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 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