IISExpress 8 Cannot read configuration file redire

2019-01-06 13:03发布

I'm running Windows Server 2008 R2 (x64) with IISExpress8 and when navigating to

c:\Program Files (x86)\IIS Express>iisexpress.exe

it says:

Filename: redirection.config

Error: Cannot read configuration file

Any ideas where to start? I can't find anything...

标签: iis-express
21条回答
小情绪 Triste *
2楼-- · 2019-01-06 14:04

You don't need to close Visual Studio or rename anything.

  1. Open properties for %userprofile%\Documents
  2. Select Security > Advanced, change owner to yourself (again if you are already owner).
  3. Select "Replace owner on subcontainers and objects" and "Replace all child object permission entires with inherited permission entires from this object".
  4. Ok.
查看更多
小情绪 Triste *
3楼-- · 2019-01-06 14:05

I found that deleting one of the sites from the applicationhost.config file resolve this problem for me.

I used the following command from the %ProgramFiles(x86)%\IISExpress directory:

appcmd list site

then

appcmd delete site rogueSiteName

Especially there was a site name with a bracketed number suffix (e.g. "MySite(1)") that I deleted. I'm not sure yet if VS2013 just had an issue with the brackets or that two sites pointed to the same directory. Either way deleting it made VS happy again.

Background

I had been struggling with this issue for a couple of days and nothing seemed to help - not even the instructions given in the top answers here.

I had also tried moving the config folder as mentioned in http://www.iis.net/learn/extensions/introduction-to-iis-express/iis-80-express-readme. But although VS2013 recreated the directory structure and files in the new location the errors continued and running appcmd showed that it was still pointing at the old location by default.

Credits

Credit for where I found the commands to use goes to http://gyorgybalassy.wordpress.com/2013/12/02/cleaning-up-iis-express-configuration/

查看更多
仙女界的扛把子
4楼-- · 2019-01-06 14:06

Using Visual Studio 2013

I had to stop visual studio rename the whole config directory, Documents > IISExpress> Config then start a new web project, which fails but it recreates the config directory, then I rebooted and launched visual studio and everything worked!

I noticed this problem after copying a project between 2 computers, perhaps it was caused by a duplicate IISExpress port or something trivial.

查看更多
登录 后发表回答