E
Eric Sabine
This situation requres many exes to be sitting on a network share. I would
like all of these to use the same app.config file, which will be stored in
the same location on the network. A quick test though gave me this
exception:
System.InvalidOperationException: The key 'ConnectionString' does not exist
in the appSettings configuration section.
at System.Configuration.AppSettingsReader.GetValue(String key, Type type)
at test_appconfig.Form1.FromApplicationConfig(String Key) in
F:\VB.NET\junk\test_appconfig\test_appconfig\Form1.vb:line 62
The program '[2808] test_appconfig.exe' has exited with code 0 (0x0).
What's the best way to share the app.config in this common network folder?
Thanks, Eric
Public Function FromApplicationConfig(ByVal Key As String) As String
Try
Dim reader As New AppSettingsReader
Return CStr(reader.GetValue(Key, GetType(String)))
Catch ex As Exception
MessageBox.Show(ex.Message.ToString & vbCrLf & _
ex.Source.ToString & vbCrLf & _
ex.StackTrace.ToString, "Function: FromApplicationConfig Exception",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End Try
End Function
like all of these to use the same app.config file, which will be stored in
the same location on the network. A quick test though gave me this
exception:
System.InvalidOperationException: The key 'ConnectionString' does not exist
in the appSettings configuration section.
at System.Configuration.AppSettingsReader.GetValue(String key, Type type)
at test_appconfig.Form1.FromApplicationConfig(String Key) in
F:\VB.NET\junk\test_appconfig\test_appconfig\Form1.vb:line 62
The program '[2808] test_appconfig.exe' has exited with code 0 (0x0).
What's the best way to share the app.config in this common network folder?
Thanks, Eric
Public Function FromApplicationConfig(ByVal Key As String) As String
Try
Dim reader As New AppSettingsReader
Return CStr(reader.GetValue(Key, GetType(String)))
Catch ex As Exception
MessageBox.Show(ex.Message.ToString & vbCrLf & _
ex.Source.ToString & vbCrLf & _
ex.StackTrace.ToString, "Function: FromApplicationConfig Exception",
MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
End Try
End Function