Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2007

Tip: Looking for answers? Try searching our database.

'SomeValue' is not a member of 'MySettings'

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Monty - 25 Oct 2007 05:02 GMT
[VS2005, VB.Net, ASP.Net, XP SP2]

Hello, I have a class that exposes several values like so:

Public Shared ConnString As String

The class, originally enough, is named "Settings". If I interrogate a value
of this object in the immediate window, I get the following exchange:

?Settings.ConnString
'ConnString' is not a member of 'MySettings'.

I'm not sure why it thinks I'm trying to access "MySettings". Also, when
typing the first line (above) into the immediate window, I get the correct
intellisense for my settings object. So what's the deal with "MySettings"?
TIA.
Walter Wang [MSFT] - 25 Oct 2007 06:47 GMT
Hi Monty,

Based on my understanding, you probably are using Web Application Project
mode instead of the Web Site mode and created Application Settings in your
project, the Settings Designer will generate a property named Settings in a
module, the Settings property is a singleton that returns a type of
My.MySettings that generated from your settings. For example:

Namespace My
   <Global.Microsoft.VisualBasic.HideModuleNameAttribute(),  _
    Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _
    Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute()>  _
   Friend Module MySettingsProperty
       
       
<Global.System.ComponentModel.Design.HelpKeywordAttribute("My.Settings")>  _
       Friend ReadOnly Property Settings() As
Global.WebApplication1.My.MySettings
           Get
               Return Global.WebApplication1.My.MySettings.Default
           End Get
       End Property
   End Module
End Namespace

It's recommended to avoid use Settings as your class name.

References:

#Application Settings in VB.NET 2005
http://visualbasic.about.com/od/usingvbnet/a/appsettings_4.htm

#Using My.Settings in Visual Basic 2005
http://msdn2.microsoft.com/en-us/library/ms379611(vs.80).aspx

Hope this helps.

Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.