12

I have installed Visual studio developer community version to practice coding. When I tried to create a new web project, I am facing issue like configuring IIS express failed, can not read the configuration file. I have tried all possible solutions like renaming the host file and closing and opening the visual studio. Nothing worked out. And I have tried to clone the project from git here also I am facing the same issue. Can someone please help me here.

Here is my error message.

enter image description here

habib
  • 2,366
  • 5
  • 25
  • 41
Sudhakar B.V.
  • 121
  • 1
  • 1
  • 3

6 Answers6

70
  1. Go: C:\Program Files (x86)\IIS Express\config\templates\PersonalWebServer
  2. Copy 3 files: applicationhost.config, aspnet.config và redirection.config
  3. Go to: Documents\IISExpress\config
  4. Paste and replace all 3 files
  5. Reload
Drave
  • 701
  • 5
  • 3
2

I solved the problem with help of Drave answer. But I put that 3 files into below address:

[my project]\.vs\config\

when I put that files into confing folder and I reloaded the project, problem solved.

tnx again from Drave answer

Hamed Rezaei
  • 370
  • 1
  • 3
  • 11
2

Here is another suggestion which seems a bit easier.

  1. Navigate to C:\Users\{{your user name}}\Documents\
  2. Rename the folder IISExpress to IISExpressold or something so that its archived
  3. Open your solution again.

It should open ok after these steps.

Jon Cianci
  • 61
  • 1
  • 8
1

In my case with VS2019 works:

  1. close VS2019
  2. remove [my project].vs\config\
  3. rename c:\Users[username]\OneDrive\Documents\IISExpress\config to _config
  4. rename c:\Users[username]\Documents\IISExpress\config\ to _config
  5. load the solution to VS2019
0

In my case, the OneDrive application is removing by default the content of "C:\Users\username\Documents\IISExpress\config" folder, so Visual Studio cannot copy the .config files into .vs folder on the solution directory.

I resolved it by ensuring the files are on this path, and disabled the backup option on Documents directory in the OneDrive settings.

0

As suggested by @silas my issue was with OneDrive as well. after disabling OneDrive sync on "Documents Folder" problem gets resolved. To be precise system was trying to access "C:\Users[user name]\Documents\IISExpress\config"