I am trying to load existing c# web applications and getting below errors while loading any web project:
Creation of the virtual directory http://localhost:/ failed with the error: You do not have permission to access the IIS configuration file. Opening and creating web sites on IIS requires running Visual Studio under an Administrator account.. You will need to manually create this virtual directory in IIS before you can open this project.
The following error occurred when trying to configure IIS Express for project xxx.WebApi. You do not have permission to access the IIS configuration file. Opening and creating web sites on IIS requires running Visual Studio under an Administrator account.
I tried following, but in vain:
- Running VS 2017 pro as an administrator.
- I ensured that I have access to %systemroot%\System32\inetsrv\ and C:\Windows\System32\inetsrv\Config folders.
- I have installed all IIS compatibility windows features through control panel.
- Restarted IIS manager.
- Created virtual directories.
- Changed registry path of HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal from u:\ to C:\Users\MyUser\Documents.
- Uninstalled IIS Express 10.0 from control panel and reinstalled it through VS2017 installer by clicking – Individual components – cloud, database server – IIS Express.
- Repaired VS 2017.
- Got admin access on machine.
- Created new empty web project but getting same error while new console app runs without errors.
- Restarted machine after every installation related change.
All the solutions tried are mentioned on stackoverflow but are not working for me. Is there something trivial that I am missing? Please guide me to crack these IIS errors.