Is Configuration.Appsettings Thread safe

  • Thread starter Thread starter Bijoy
  • Start date Start date
B

Bijoy

We seem to be having a lovely problem while trying to
fetch Keyvalues in the Appsettings section from the
Web.config, our program uses threading ( We fetch each
table in a Dataset of a Separate thread)

It breaks on the line whose code looks quite simple
though
connectionString=ConfigurationSettings.AppSettings
["connectionString"];


BELOW IS THE STACK TRACE

_stackTraceString " at
System.Configuration.ConfigurationRecord.Evaluate(String
configKey)
at
System.Configuration.ConfigurationRecord.ResolveConfig
(String configKey)
at System.Configuration.ConfigurationRecord.GetConfig
(String configKey)
at
System.Configuration.DefaultConfigurationSystem.System.Con
figuration.IConfigurationSystem.GetConfig(String
configKey)
at System.Configuration.ConfigurationSettings.GetConfig
(String sectionName)
at
System.Configuration.ConfigurationSettings.get_AppSettings
()
at System.Configuration.AppSettingsReader..ctor()
at App.DalHelper.Helper.GetConnection(String module)
in c:\my
documents\workouts\revise\dalhelper\datahelper.cs:line
100" string
 
i believe, but not 100 percent sure, that the configurationsettings class is
owned by the main thread so you would possibly need to invoke and not
directly call the method. may be wrong though
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top