473,385 Members | 1,798 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,385 software developers and data experts.

why web.config locks? please help, thanks!

I found my web.config file always in lock mode, when I tried to modify it, I
ofter got "Can not create web.config" error. I had to reboot my machine, and
before I accessed any site I can modify it. I think microsoft creates the
..NET structure so that user can modify config file easier without restart
service. I am not sure why my web.config works like that? Could someone
explain this to me? And is there a easier way I can modify the config file
without restarting service or machine.

Thanks!
Jul 21 '05 #1
3 1736
How are you trying to modify the web.config file? I am not to familiar with
the web.config file but I think it works in the same way as the app.config
file, meaning you can only read from it while your application is running.
So if this is a Web Service you may have to re-start the Web Service. So as
to why you have to re-start your computer..have you tried to stop the web
server/service first?

If you want to modify the file without re-starting the application you would
need to do something similar to this article:
http://www.devx.com/dotnet/Article/11616/0/page/1

It explains how you create a config file in memory while your application is
still running and then the changes are permanently pushed to the file when
the application closes. Note: this article talks about the app.config file
not the Web.Config but you might find it useful.

Ronny
"david" <wy*****@hotmail.com> wrote in message
news:OJ**************@TK2MSFTNGP11.phx.gbl...
I found my web.config file always in lock mode, when I tried to modify it, I ofter got "Can not create web.config" error. I had to reboot my machine, and before I accessed any site I can modify it. I think microsoft creates the
.NET structure so that user can modify config file easier without restart
service. I am not sure why my web.config works like that? Could someone
explain this to me? And is there a easier way I can modify the config file
without restarting service or machine.

Thanks!

Jul 21 '05 #2
First, thank you for your reply.

I think app.config is quite different from web.config, this is from the link
you gave to me.

Although both read the files at startup and cache the contents, if you
change a
Windows Forms configuration file, the changes don't take effect until the
next time
you start the application. In contrast, when you change an ASP.NET
applicationsconfiguration file, the framework recognizes the change
immediately.

I believe one of the important new feature of .NET is that you can change
the setting without restarting anything. It works fine on some of my
servers. it just not works on my home server.

"Ronny" <fl******@comcast.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
How are you trying to modify the web.config file? I am not to familiar with the web.config file but I think it works in the same way as the app.config
file, meaning you can only read from it while your application is running.
So if this is a Web Service you may have to re-start the Web Service. So as to why you have to re-start your computer..have you tried to stop the web
server/service first?

If you want to modify the file without re-starting the application you would need to do something similar to this article:
http://www.devx.com/dotnet/Article/11616/0/page/1

It explains how you create a config file in memory while your application is still running and then the changes are permanently pushed to the file when
the application closes. Note: this article talks about the app.config file
not the Web.Config but you might find it useful.

Ronny
"david" <wy*****@hotmail.com> wrote in message
news:OJ**************@TK2MSFTNGP11.phx.gbl...
I found my web.config file always in lock mode, when I tried to modify it,
I
ofter got "Can not create web.config" error. I had to reboot my machine,

and
before I accessed any site I can modify it. I think microsoft creates

the .NET structure so that user can modify config file easier without restart service. I am not sure why my web.config works like that? Could someone
explain this to me? And is there a easier way I can modify the config file without restarting service or machine.

Thanks!


Jul 21 '05 #3
As a side note about changing the app config file in a ASP.NET application.
yes the changes are read in after you make them but this is done by
restarting the application. Once this happens things like lost sessions can
happen.

"david" <wy*****@hotmail.com> wrote in message
news:#9**************@TK2MSFTNGP10.phx.gbl...
First, thank you for your reply.

I think app.config is quite different from web.config, this is from the link you gave to me.

Although both read the files at startup and cache the contents, if you
change a
Windows Forms configuration file, the changes don't take effect until the
next time
you start the application. In contrast, when you change an ASP.NET
applicationsconfiguration file, the framework recognizes the change
immediately.

I believe one of the important new feature of .NET is that you can change
the setting without restarting anything. It works fine on some of my
servers. it just not works on my home server.

"Ronny" <fl******@comcast.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
How are you trying to modify the web.config file? I am not to familiar with
the web.config file but I think it works in the same way as the app.config
file, meaning you can only read from it while your application is running. So if this is a Web Service you may have to re-start the Web Service. So

as
to why you have to re-start your computer..have you tried to stop the web server/service first?

If you want to modify the file without re-starting the application you

would
need to do something similar to this article:
http://www.devx.com/dotnet/Article/11616/0/page/1

It explains how you create a config file in memory while your application is
still running and then the changes are permanently pushed to the file

when the application closes. Note: this article talks about the app.config file not the Web.Config but you might find it useful.

Ronny
"david" <wy*****@hotmail.com> wrote in message
news:OJ**************@TK2MSFTNGP11.phx.gbl...
I found my web.config file always in lock mode, when I tried to modify it,
I
ofter got "Can not create web.config" error. I had to reboot my machine, and
before I accessed any site I can modify it. I think microsoft creates

the .NET structure so that user can modify config file easier without restart service. I am not sure why my web.config works like that? Could
someone explain this to me? And is there a easier way I can modify the config

file without restarting service or machine.

Thanks!



Jul 21 '05 #4

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

Similar topics

25
by: n3crius | last post by:
hi, i just got a web host with asp.net , seemed really cool. aspx with the c# or vb IN the actual main page run fine, but when i use codebehind and make another source file ( a .cs) to go with...
5
by: david | last post by:
I found my web.config file always in lock mode, when I tried to modify it, I ofter got "Can not create web.config" error. I had to reboot my machine, and before I accessed any site I can modify it....
7
by: praveen | last post by:
Hi When does DB2 go for an IS (Intent Share) lock? IS mode is defined as a mode in which "The lock owner can read data in the locked table, but cannot update this data. Other applications can...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.