re:
!I don't understand your response at all. Don't modify web.config at all?
He didn't say that at all.
He said "If you don't want your ASP.NET application to recycle, don't modify web.config".
If you modify web.config, your ASP.NET application *will* recycle.
re:
!Where do you suggest me to connection strings?
!Har coded in some .cs files?
No, but you could have a helper config file named connections.config, for example.
<connectionStrings configSource="connections.config"/>
To enable the configuration to be recognized on any change to "connections.config",
edit machine.config, in the <configSectionssection, and edit <section name="connectionStrings" ... >,
adding : restartOnExternalChanges="true"
That'd make it :
<section name="connectionStrings" type="System.Configuration.AppSettingsSection, System.Configuration,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" restartOnExternalChanges="true"
requirePermission="false" />
Juan T. Llibre, asp.net MVP
asp.net faq :
http://asp.net.do/faq/
foros de asp.net, en español :
http://asp.net.do/foros/
======================================
"Raymon Du" <rd**@yahoo.comwrote in message news:ey**************@TK2MSFTNGP06.phx.gbl...
>I don't understand your response at all. Don't modify web.config at all? Where do you suggest me to connection
strings? Har coded in some .cs files? It's a common practice to store connection strings into web.config then change
them for switching to defferent environments. But ASP.Net runtime throws exceptions if connection strings are changed
in my case.
"Mark Rae [MVP]" <ma**@markNOSPAMrae.netwrote in message news:O5****************@TK2MSFTNGP04.phx.gbl...
>"Raymon Du" <rd**@yahoo.comwrote in message news:ut**************@TK2MSFTNGP04.phx.gbl...
>>I am getting the following exception every time I modified web.config, the only way to fix it is to recycle
application pool or restart IIS, but I don't want to do that all the times. TIA
Modifying web.config will cause an ASP.NET application to recycle... There are some really convoluted (and totally
pointless) exceptions to this, which are best avoided...
If you don't want your ASP.NET application to recycle, don't modify web.config... Store dynamic variables somewhere
else...
--
Mark Rae
ASP.NET MVP
http://www.markrae.net