#VS2017 – ASP.Net, IIS Express, #OneDrive and the error “The IIS Express applicationHost.config file contains invalid entries and must be corrected before you can open project”


In recent months OneDrive has enabled a new feature that is great [Files On Demand]. If you have terabytes of information in OneDrive, this is a great way to optimize space and synchronization between multiple devices..


Well, another feature that has OneDrive for a while is to automatically synchronize som of the information of your Windows Profile between different devices. For example, if you use 2 devices with the same OneDrive account, you can configure the account so that all the files that you have on your Desktop and in your Documents are synchronized between these devices.


In my case, I usually develop on a PC with enough power and then I have my “crappy SurPro4” for demos and other sessions. I have enabled the option to synchronize the Desktops for a long time, and I think it will be a good idea to synchronize the also my Documents between this 2 machines.

Well, While I’m practicing a couple of sessions on Azure and Amazon Alexa I realized that when I opened a Web project on my Surface Pro 4 and when trying to load the same in Visual Studio 2017, I found this error


Microsoft Visual Studio


The IIS Express applicationHost.config file contains invalid entries and must be corrected before you can open project [$ProjectName].

Filename: redirection.config

Error: Cannot read configuration file




This got me on the nerves for a while, because the values in this file were correct. However, Visual Studio 2017 could not load ASP.Net projects. In a moment of lucidity, I realized that these files were not being loaded from [% USER_PATH] but from OneDrive


And of course, it seems that IIS Express doesn’t get along with Onedrive. At this time the solution went through

  • Cancel the synchronization of the document folder
  • Configure my projects to use IIS instead of IIS Express

As the 2nd option is always much more practical at the time of work, I choose this one.  I’ve done this and everyone’s happy!

Happy Coding!

Greetings @ Toronto

El Bruno



Leave a comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: