"Please correct before proceeding." - Web.config error
Visual StudioVisual Studio Problem Overview
I attempted to launch a website project locally but received the below message in an error dialog:
> Please correct before proceeding.(You might rename the current web.config and add a new one).
Typically this error is preceded by a general description of the cause, this one was not. Knowing odd, out-of-the-blue, problems such as these are typically related to corrupt IDE generated files. I tried deleting the .suo
, .vssscc
and other generated files from the solution and project directories but the problem continued.
Visual Studio Solutions
Solution 1 - Visual Studio
This happened to me today after getting latest. I resolved by closing and reopening the solution, rebuild, then run. All is well...
Solution 2 - Visual Studio
I actually resolved this by making sure the Web.config file wasn't an open document inside VS 2015. In other words, close the Web.config file wherever it might be open, and make sure your Team Explorer isn't causing any problems, like an unexpected change or staged change...rebuild the sln and run...
Solution 3 - Visual Studio
Close vs2017 and open it again worked for me
Solution 4 - Visual Studio
just open web.config and run again.I've had this problem and I resolved by this solution .
Solution 5 - Visual Studio
I fixed the problem using a solution I found for a different IDE-related issue (original answer here). Run the following in an elevated command prompt:
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe" /setup
Note: You'll need to adjust the path for your version of Visual Studio (original version mapping answer here):
- Visual Studio 2005 = 8
- Visual Studio 2008 = 9.0
- Visual Studio 2010 = 10.0
- Visual Studio 2012 = 11.0
- Visual Studio 2013 = 12.0
- Visual Studio 2015 = 14.0
Solution 6 - Visual Studio
This issue came to me after merging some code in version control using RTC tools. When I saw whyoz answer I noticed that web.config wasn't opened anywhere. It could be RTC locking the file or something like this. So, I simply restarted Visual Studio and it became normal again.
Solution 7 - Visual Studio
I ran into this issue today after doing a branch merge using the VS19 built-in Git tools. The config file was correct; I even used a schema validator based on KD2ND's answer in https://stackoverflow.com/questions/2084154/how-can-i-validate-dot-net-application-config-fileex-app-exe-config-on-consol.
I cleaned the solution, unloaded it, and reloaded it, and everything worked fine. I didn't even need to restart studio.
Based on others' answers, this appears to be related to code merging in the IDE. It's a weird problem but it's a relief that the solution (once found) is simple.
Solution 8 - Visual Studio
As an FYI, in VS 2019 the solution is to close the tabs, and the solution and Visual Studio, then restart Visual Studio. This has worked for me.
Solution 9 - Visual Studio
In VS 19 Enterprise, the Solution for me was:
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\devenv.exe" /setup
Based on the merked answer from alan.
Solution 10 - Visual Studio
in Microsoft Visual Studio 2019 : Just neeed to close project, thenn open+ clean+rebuild and everything work
Solution 11 - Visual Studio
I had just opened the web.config file and then pressed CTRL K + D. it will make the formatting good of the file. and then run the application. it worked for me.
Even if you undo the above changes then also it works. it is weird somehow.