Hi
I have created 2 custom Providers by inheriting from ProviderBase, and
I have configured the web.config with the required section. One
provider uses direct queries, the second one stored procedures;
however, always the same (default) Provider is being used, and I have
NEVER changed the web.config file so far - the application is a C# Web
Service.
Everything works fine, the Provider is instantiated several times
during the day, and the DB is successfully accessed with no problems.
But there is one issue that I cannot understand... every "once in a
while", apparently randomly, I get an error, exactly when calling the
System.Web.Configuration.ProvidersHelper.InstantiateProvider() method:
"Collection was modified after the enumerator was instantiated."
Some other times, I get: "Value cannot be null. Parameter name: Please
configure the connectionString property for this provider.".
In both cases, it seems the web.config file cannot be read properly...
or it looks like it has been somehow modified. However, I am
definitely sure that nothing nor nobody has ever changed the
web.config, or any other file in the web service, during the
execution.
This errors happens when the web service is called at the same time by
two clients, so when the provider is instantiated by two different
callers in a very short range of time.
Do you have any suggestion? How could I avoid this error?

Reply via email to