All pastes #235935 Raw Edit

Stuff

public text v1 · immutable
·published 2006-11-03 15:14 UTC
rendered paste body
using System;
using System.Configuration;
using System.Collections.Specialized;

namespace elh.Agent
{
	/// <summary>
	/// Description of config.
	/// </summary>
	public class config
	{
		private string m_webserviceurl;
		private NameValueCollection configsettings;
		
		public config()
		{
			configsettings = (NameValueCollection)ConfigurationSettings.GetConfig("appSettings");
			if(configsettings == null) Logger.write_message("NameValue is null!");
			m_webserviceurl = configsettings["WebServiceUrl"];
			if(m_webserviceurl == null) Logger.write_message("m_webserviceurl is null!");
		}
		
		public string WebServiceUrl { 
		
			get{ return m_webserviceurl; }
		}
	}
}



app.config:

<configuration>
  <appSettings>
    <add key="WebServiceUrl" value="http://mgolisch2/elh/elh.asmx" />
  </appSettings>
</configuration>



logfile:

m_webserviceurl is null!
   at System.Uri..ctor(String uriString)
   at System.Web.Services.Protocols.WebClientProtocol.set_Url(String value)
   at proxy..ctor(String webserviceurl) in c:\Dokumente und Einstellungen\mgolisch\Eigene Dateien\SharpDevelop Projects\elh-agent\proxy.cs:line 34
   at elh.Agent.eventlog_agent.monitorevents() in c:\Dokumente und Einstellungen\mgolisch\Eigene Dateien\SharpDevelop Projects\elh-agent\eventlog-agent.cs:line 98