简体   繁体   中英

Close the app.config file after reading

My "app" is being hijacked by a monitoring service. After it dies, for some reason the app.config file is considered still in use, so I can't make changes.

The only thing I can do is rename the existing file, and save a new file with the old name.

This is not an interactive app, so I want to simply want to use notepad to make changes in the file between runs.

Here is what I would try:

  • Use Unlocker to figure out what service or process holds a handle to your file and "unlock" it
  • Try ProcessExplorer . In menu go to Find > Find handle or DLL , search for your .config file and figure out what process is "taking a lock" on the file

Once you figure out what's causing this, check if you can somehow add an exception for your file, so that it's not trying to open this config file - very unlikely but an AV process may do that. Other solutions is to kill a misbehaving 3rd party app and start it once you finished editing config file.

Double check that your app was actually killed and no longer runs. Use process explorer or default task manager (or any other similar tool on non-Windows OS).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM