5

Installed VS2017 RC - Started New Project ASP.NET Core Web Aplication(.Net CORE), selected Individual User Accounts as Authentication type. Try to run code generated with no changes and got the following error: Error occurred when trying to configure IIS Express for project... Error: ../.vs/config/applicationhost.config Error: cannot write configuration file

Looked at that file and it appears that it should have been writable.

FYI using VS2015 Update 3 everything builds and runs as expected including IIS Express.

Rick
  • 988
  • 2
  • 13
  • 23

3 Answers3

14

I have encountered the same issue but deleting .vs folder worked for me.

kemakino
  • 1,041
  • 13
  • 33
9

I was having this issue, but only after the recent updated to Visual Studio 2017 RC (12/12/16).

I searched for a good hour and really didn't find anything, so I simply downloaded the latest IIS Express (v10) and it seems to have corrected the issues for 2017, but also for 2015 that started after the update as well.

IIS Express Download

FunnyNjK
  • 112
  • 1
  • 1
    I just tried this and the error changed to "The AspNetCoreModule which is required to host .NET Core projects in IIS does not appear to be installed" – Martín Coll Feb 10 '17 at 01:46
  • @MartínColl I have the same problem as you did. Any solution? – Max Dec 18 '17 at 08:19
  • Please look at [this answer](https://stackoverflow.com/a/51756931/3341032), it worked for me – Mariusz Jan 03 '20 at 09:59
2

EFS (Encryption File System) is known to cause file access problems. Ensure that EFS is turned off in your project directory.

More information: https://blog.danielsmon.com/2017/04/03/cant-write-to-applicationhost-config/

F Snyman
  • 499
  • 1
  • 5
  • 6