Share via


Creation of the virtual directory http://localhost:89328/ failed. Cannot write configuration file (\vs\config\applicationhost.config)

Question

Monday, January 28, 2019 3:21 PM

Hi,

I am unable to create new/open existing website on my computer. The error I get is:

Creation of the virtual directory http://localhost:%port%/ failed with the error:

Filename: \?\C:\Projects\any-path%\vs\config\applicationhost.config

Error: Cannot write configuration file.

You will need to manually create this virtual directory in IIS before  you can open this project.

The web should use IIS Express.

I have searched few forum threads on this error but nothing worked for me. After this error is thrown, applicationhost.config is normally created. There should be no problem with security, rights,...

When I copy whole project folder from my co-worker (he has same directory structure for development) ... same error.

Is anyone able to help?

Thank You very much for any ideas.

All replies (1)

Tuesday, January 29, 2019 7:39 AM | 3 votes

Hi Mirek,

Thank you for posting in MSDN forum!

 

Refer to the error message, please have a look at this similar issue and follow the steps as below to troubleshoot:

  1. Close Visual Studio and rename the applicationhost.config file located in the ".vs\config" directory of your root project directory then reloaded the web project.
  2. If not works, open the created file named applicationhost.config in Notepad.
  3. Searched the open file for the filename in your error message
  4. Amended the physicalPath value to point to the valid path of the project's config file.
  5. Saved the applicationhost.config file, and try again.

Best Regards,

Sara

MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact [email protected]