7

Yesterday I installed an update (Visual Studio 2013 Update 2) to Visual Studio 2013 and since then it has not worked properly.

The update was taking quite a long time so I let it run overnight, and when I returned to my workstation this morning, I was unable to load the WebForm projects in our solution. The error it gives when I attempt to reload the projects is The IIS Express applicationHost.config file contains invalid entries and must be corrected before you can open project WebSite.

I'm not the one on our team that configures the IIS server, so I don't think I have access to the applicationHost.config file, and I don't think it has changed any since yesterday anyways. I am the only one in my team having issues opening out projects, so I am convinced it is my environment and specifically the update I installed yesterday.

I've uninstalled and reinstalled Visual Studio 2013 to no avail.

raumkrieger
  • 262
  • 10
  • 18
  • I did finally resolve the issue, but I neglected to post an answer here and now I don't remember exactly how, which is why I'm posting as a comment instead of an answer. I believe I found a default `.config` file somewhere (I think it was a web.config file, but it's possible it was an applicationHost.config file) and it was empty. I deleted it and upon re-opening Visual Studio recreated the file properly. I was then able to open projects normally. – raumkrieger Jul 07 '14 at 19:16

8 Answers8

16

This happens due to corrupt applicationHost.config file.

Instead of re-installing visual studio,

Go to C:\inetpub\history and copy applicationHost.config file to My Documents\IISExpress\config\

This should solve your problem.

Aditya Bokade
  • 1,518
  • 1
  • 24
  • 43
  • 1
    I fixed it but couldn't remember exactly how. That was it, thanks! – raumkrieger Aug 21 '14 at 17:17
  • @raumkrieger God's grace, god bless. – Aditya Bokade Aug 22 '14 at 00:25
  • 6
    In my case, there was no `C:\inetpub\history\applicationHost.config` but searching from `C:\` for `applicationHost.config` found it in `C:\Program Files (x86)\IIS Express\config\templates\PersonalWebServer`. Copying that file into `.vs\config` and overwriting what was there solved it – AKW Oct 24 '16 at 17:41
  • In my case, I have to copy the all three files (applicationhost.config, aspnet.config, redirection.config) to solve my problem. – Tom Sep 22 '18 at 11:35
7

I had the similar occurrence for a specific project only for VS 2015.

I went to the respective project folder .vs\config drive and deleted the applicationhost.config file. Then reloaded the project, and it created a new application host file and reloaded successfully.

Randeep Singh
  • 938
  • 2
  • 11
  • 31
2

its so funny

in windows 10 this problem happened because of oneDrive application.

if your oneDrive application is off, please run it first and reload project again.

it seem oneDrive lock this files

Cawboy
  • 43
  • 1
  • 7
1

Go to the path in the message error: At my case is C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config

path on error

And rename the file web.config to web_old.config.

At Solution Explorer try reload your project again.

Good look!

1

Go To C:\Program Files (x86)\IIS Express\config\templates\PersonalWebServer

Copy all the files from the above location to the locationC:\Users\User_Name\Documents\IISExpress\config

Running Rabbit
  • 2,219
  • 13
  • 37
  • 58
0

You can copy the folder "C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config" from another computer.

This should fix this problem in Visual Studio 2017

slfan
  • 8,209
  • 115
  • 61
  • 73
Ebrahim
  • 1
  • 1
0

I had the same issue error occur. I simply deleted the files found within the \IISExpress\config folder and reloaded the project by closing and opening Visual Studio.

Hope these solutions help everyone else!

0

it sounds like there are two causes. in some cases the files do have a content issue. In this case simply deleting the \config folder files solves the problem as they are recreated.

A second root cause seems to be t the ability of VS to WRITE to the file. In this case , the error message is misleading. You feel good about deleting files and copying files, while this really wont help you.

Between this site and the ms support site, i noticed many posts have to do w/ VS not being able to write to the <%user profile>\documents\iis express\config folder

Ive read a couple posts the mentioned encrypted drives. @Cawboy mentioned OneDrive.

I spent hours deleting files and retrying, then finally had this eureka moment.

In my case, the IIS EXpress folder was marked readonly. In properties, i simply unchecked that box.

My advice would be to investigate that folder.

  • make sure its not read only
  • if its a possibility for you , you might add a Security Setting to let EVERYONE have fullcontrol to that folder.
greg
  • 1,341
  • 1
  • 14
  • 24