System.Configuration.ConfigurationerrorsException > Configuration system failed to initialize > System.Configuration
at System.Configuration.ConfigurationManager.EnsureConfigurationSystem() at System.Configuration.ConfigurationManager.PrepareConfigSystem() at System.Configuration.ConfigurationManager.GetSection(String sectionName) at System.Configuration.PrivilegedConfigurationManager.GetSection(String sectionName) at System.Diagnostics.DiagnosticsConfiguration.GetConfigSection() at System.Diagnostics.DiagnosticsConfiguration.Initialize() at System.Diagnostics.DiagnosticsConfiguration.get_Sources() at System.Diagnostics.TraceSource.Initialize() at System.Net.Logging.InitializeLogging() at System.Net.Logging.get_On() at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase) at System.Net.WebRequest.Create(String requestUriString) at TestPGM.TestPGM.Module1.Main(String[] args)
I also included an attempted to get FilePath from System.Configuration.Configuration since I thought the problems might be related. Here is the error from that test:
test exeConfig
System.Configuration.ConfigurationerrorsException > An error occurred loading a configuration file: Illegal characters in path. > System.Configuration
at System.Configuration.ConfigurationSchemaErrors.ThrowIfErrors(Boolean ignoreLocal) at System.Configuration.BaseConfigurationRecord.ThrowIfParseErrors(ConfigurationSchemaErrors schemaErrors) at System.Configuration.Configuration..ctor(String locationSubPath, Type typeConfigHost, Object[] hostInitConfigurationParams) at System.Configuration.ClientConfigurationHost.OpenExeConfiguration(ConfigurationFileMap fileMap, Boolean isMachine, ConfigurationUserLevel userLevel, String exePath) at System.Configuration.ConfigurationManager.OpenExeConfigurationImpl(ConfigurationFileMap fileMap, Boolean isMachine, ConfigurationUserLevel userLevel, String exePath) at System.Configuration.ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel userLevel) at TestPGM.TestPGM.Module1.Main(String[] args)
What am I missing?
Try
_apiUrl = "http://www.google.com"
' wr = WebRequest.Create(_apiUrl)
Dim request As HttpWebRequest = WebRequest.Create(_apiUrl)
request.Timeout = 10000
Dim response As HttpWebResponse = request.GetResponse
Dim h1stream As System.IO.Stream = response.GetResponseStream
Dim h1 As String = String.Empty
Dim reader As New StreamReader(h1stream)
h1 += reader.ReadToEnd
Console.WriteLine(h1)
Catch ex As Exception
Console.WriteLine(ex.GetType.ToString + " > " + ex.Message + " > " + ex.Source + " <br> " & ex.StackTrace)
End Try
Dim xPath As String
Console.WriteLine("<br>test exeConfig<br>")
Try
Dim exeConfig As System.Configuration.Configuration = System.Configuration.ConfigurationManager.OpenExeConfiguration(System.Configuration.ConfigurationUserLevel.None)
xPath = exeConfig.FilePath
Catch ex As Exception
xPath = ""
Console.WriteLine(ex.GetType.ToString + " > " + ex.Message + " > " + ex.Source + "<br> " + ex.StackTrace)
End Try

New Topic/Question
Reply



MultiQuote



|