473,324 Members | 2,193 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Getting Access Violation every time I modified web.config

Hi,

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

Jun 27 '08 #1
4 1136
"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

Jun 27 '08 #2
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

Jun 27 '08 #3
"Raymon Du" <rd**@yahoo.comwrote in message
news:ey**************@TK2MSFTNGP06.phx.gbl...

[top-posting corrected]
>>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...

I don't understand your response at all.
OK.
Don't modify web.config at all?
Yes, that's right. DON'T MODIFY WEB.CONFIG AT ALL!
Where do you suggest me to [store] connection strings?
In web.config - as many as you need.
Hard coded in some .cs files?
Absolutely not.
It's a common practice to store connection strings in web.config then
change them for switching to different environments.
It most certainly isn't!!! Web.config is not designed for this sort of
behaviour, as you've discovered... Web.config is designed for storing
application-specific data and metadata WHICH NEVER CHANGES while the
application is running.
But ASP.Net runtime throws exceptions if connection strings are changed in
my case.
Yes, that's correct. Because web.config is not designed to be used in this
way...

Why do you need to modify your connection string(s) while your web
application is running?
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Jun 27 '08 #4
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



Jun 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: F. Prefect | last post by:
Hello, (sorry for reposting this.) We are having the following scenario: A ASP.NET Application (C#) is using a managed C++ assembly, which is a thin wrapper around an old C++ lib. (We are...
3
by: Shailesh Humbad | last post by:
I figured out what was causing the "Access is Denied" error when calling functions from referenced DLLs in my service. I've tried to be very detailed, so bear with me. It turns out that...
9
by: Geraldine Hobley | last post by:
Hello I'm getting the above mentioned error in my applicatio I have a datagrid bound to a datasource like s MyDatagrid.DataSource = Mydataset.Tables(Order) - this all works fine However I...
1
by: Polaris431 | last post by:
I've spent 8 hours trying to get my ASP.NET app to work but to no avail. I am running ASP.NET 2.0 on a Windows 2003 server. I am using IIS 6.0. When I run my application, I get the error...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.