-
Apr 25th, 2006, 12:45 PM
#1
Thread Starter
Lively Member
Error Dim Reader as new system.configuration.AppSettingsReader()
I'm trying to do a lab exercise on configuration files. I enter the following in the Form1 constructor:
VB Code:
Dim Reader As New System.Configuration.AppSettingsReader
On compile, I get this error:
An unhandled exception of type 'System.Configuration.ConfigurationException' occurred in system.dll
Additional information: This is an unexpected token. The expected token is 'EQUALS'. Line 6, position 27.
Do you know what the problem is?
Thanks - Tom
-
Apr 25th, 2006, 12:59 PM
#2
Re: Error Dim Reader as new system.configuration.AppSettingsReader()
when do you receive the error? at complie time or when you actually run the app. if it's when you run the app start debugging and let us know or see the code that it's trying to run thats causing the error
-
Apr 25th, 2006, 01:09 PM
#3
Thread Starter
Lively Member
Re: Error Dim Reader as new system.configuration.AppSettingsReader()
The error occurs when I run it and it tries to execute the line
VB Code:
Dim Reader As New System.Configuration.AppSettingsReader
The error now says
An unhandled exception of type 'System.Configuration.ConfigurationException' occurred in system.dll
Additional information: Unrecognized configuration section appsettings
This is done in the constructor of Form1.
-
Apr 25th, 2006, 01:36 PM
#4
Re: Error Dim Reader as new system.configuration.AppSettingsReader()
You had mentioned how you were trying to "enter the following in the Form1 constructor". Well you dont use the Dim statement inside of constructors. Are you meaning inside of the New Sub? Or some other sub? Why don't you post the full code you have for that method, event, or sub...
Last edited by gigemboy; Apr 25th, 2006 at 01:39 PM.
-
Apr 25th, 2006, 01:49 PM
#5
Thread Starter
Lively Member
Re: Error Dim Reader as new system.configuration.AppSettingsReader()
VB Code:
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
Dim Reader As New System.Configuration.AppSettingsReader
Threading.Thread.CurrentThread.CurrentCulture = New _
Globalization.CultureInfo(CType(Reader.GetValue("Culture", _
GetType(String)), String))
Threading.Thread.CurrentThread.CurrentUICulture = New _
Globalization.CultureInfo(CType(Reader.GetValue("UICulture", _
GetType(String)), String))
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
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
|