Upon trying to edit our web.config file on our SharePoint 2010 Enterprise server via "wss\VirtualDirectories\80", Visual Studio started up to load the file for editing and then threw an error, something like an "unknown exception", and then refused to load the config file. Subsequently, the \80 folder shows that the web.config file no longer exists there! It's not in the recycle bin and is not found in any of the sub-folders under \80. Obviously this breaks the entire SharePoint farm connection. Is there any way to recover the web.config file?

1 Answer 1


First thing, You should always keep a backup of web.config and shouldn't touch it unless you know what you are doing.

If your web application isn't customized then just create another web application in CA which will create a new web in IIS too a and virtual directory for it. You can copy newly created Web application's web.config to create a web.config for your old web application. It happened to me so many times.

Web.Config is just xml document with elements that you can use for web application's configuration for example if you want to see full trace errors, so building a new one from scratch shouldn't be rocket science until you know what exactly you want.

This file also contains safe controls entries which you will need to add if there's any control that needs to in it. I have seen IIS manager making backup copies of web.config on my development server and web application's virtual directory if you could find it.

  • See, the thing is that there were backups and those were wiped out as well. I knew exactly what I wanted to change in the file (set executionTimeout in httpHandlers tag), so it wasn't an issue of me changing the wrong thing in the file. It seems to be an inexplicable glitch with VisualStudio not allowing the file to be edited in the first place. Strangely, trying to replace the config file from another server's web.config results in a 403 Not Logged In error. I'll try your suggestion but in the future I will back up the file in a non-\80 folder as well as try with a different editor!
    – Alex
    Apr 30, 2013 at 23:47
  • Oh yeah getting file from another WFE would be a good idea too, but right now I am not 100% sure as what things one should be looking at to change, I will check it on my environment in morning time and will let you know then. for the error, do you want to try this, serverfault.com/questions/272474/… Apr 30, 2013 at 23:52
  • I'll have to see what the exact error was, but thank you very much for the suggestions. Currently trying to restore the config file from a server backup image.
    – Alex
    May 1, 2013 at 0:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.