Quantcast
Viewing all articles
Browse latest Browse all 12583

Configuration system failed to initialize

Hi,

I am using .NET 4.5 with VS2012. I have a solution with windows service project and a class library project (FileMove). Both are written in C#.

My app.config in windows service has following configuration

<ThreadCollection>		<thread assembly="FileMove" startHour="1" startMinute="0" stopHour="23" stopMinute="0" runInterval="1" trace="" />	</ThreadCollection>

and my windows service uses following code to read the configuration:

_threadConfigurations = (ConfigurationServiceSection)ConfigurationManager.GetSection("ThreadCollection")

Idea is to call FileMove application as thread from windows service. 

Then I installed the windows service using installutil.exe. Service got installed and started successfully but throwing following error when its execute the above code.

Error 'Configuration system failed to initialize' occured  in System.Configuration   at System.Configuration.ConfigurationManager.PrepareConfigSystem()
   at System.Configuration.ConfigurationManager.GetSection(String sectionName)




Viewing all articles
Browse latest Browse all 12583

Trending Articles