|
-
Oct 4th, 2006, 04:34 AM
#1
Thread Starter
Lively Member
Conversion from VB.NET 2002 to VB.NET 2005 - Reading Configuration Files
I have just managed to persuade our company to invest in the Professional edition of Visual Studio 2005, to replace our existing installation of VS2002.
I'm having a number of conversion issues, which are leaving me a bit confused. All of my applications are windows-based, are built using VB2002, and are built to read default settings from an XML configuration file.
In the old days, I would "IMPORT" the System.Configuration library. From there, I would reference the appropriate config file setting using the following syntax:
<variablename> = ConfigurationSettings.AppSettings("<SettingName>")
However, when I try to compile an application that I've just converted from VS2002 to VS2005, I get the following error:
'Public Shared Function GetConfig(sectionName As String) As Object' is obsolete: 'This method is obsolete, it has been replaced by System.Configuration!System.Configuration.ConfigurationManager.GetSection'
However, when I try to alter the code, it throws up syntax errors. Can someone tell me what the correct code should be for this?
Wise man once said: "Don't ever get married, just find a woman you don't like and buy her a house".
According to ancient Chinese proverb, "Man with hole in pocket feels cocky all day". 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|