Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / web / ASP.NET

Fixing the ASP.NET Error “The web application project is configured to use IIS. The web server could not be found” error for Visual Studio 2013

0.00/5 (No votes)
1 Dec 2016Ms-PL3 min read 30.8K  
Fixing an ASP.NET error for Visual Studio 2013

We have got this ugly error from Visual Studio when we attempt to open up an ASP.NET Web Application project. Different sources provide similar solutions, but none of them worked for me. Here is why, and how my particular error was resolved.

I frequently rebuild my PC. When I do, my source code and other data reside in other hard disks or partitions and remain unaffected, while the OS and the software bits get re-installed. Nowadays, a lot of apps have this built-in thing where it synchronizes settings using their own cloud services. This means when my system is back online, all my settings are back too, without needing to go through all the Options / Settings screens again and setting up things just the way I like them to be.

That said, there is one thing none of these “syncs” can guarantee. That is that you install the same combination of components for your OS and other software across the rebuilds.

In my particular scenario, I run a DNS server with IIS and other stuff on my PC. Because I can leverage DNS for my applications, I do not use the usual “Default Web Site” with lots of virtual directories scenario to build, run and host my websites. Instead, I use sub domains with rooted site paths. For example, my profile website is at http://sujay.sarma.in and has its own disk folder. This blog is at: http://blog.sujay.sarma.in and has its own disk folder that has nothing to do with the profile website.

Recently, after a rebuild (was running out of space on the system partition), when I tried to open up a few projects from Visual Studio, I was greeted with the ominous error message:

The web application project ________ is configured to use IIS. The web server _______ could not be found.

It is not that this is a unique error message. Search for it on Google and you will find tons of results. However, going through them, you see that they all have one thing in common — all of them (like this StackOverflow.com question) are for the virtual directory scenario that I do not use. Hence, those solutions would not work for me. However, on that particular thread, this reply by Scott Silvi got me thinking. What if it was not a settings issue, but a component that I needed to install? So I fired up PowerShell (Server Manager takes way too long for this) and…

PS:\> Get-WindowsFeature Web*

This prints out an indented list of features of the IIS web server. Scrolling through the list, I could see that among other things, the component “IIS 6 WMI Compatibility” was not installed.

In troubleshooting any scenario, it is better to try one thing at a time and if it doesn’t work, undo and move to the next thing than to try twenty things and not know what fixed the issue. Also, keep a record of the issues faced and how they were resolved (I keep this blog!!!) so that it can come in handy for yourself and others later on.

Again from PowerShell:

PS:\> Install-WindowsFeature Web-WMI

“Web-WMI” is the PowerShell name for the “IIS 6 WMI Compatibility” component. You can see this name in the middle column of the listing.

After the feature was installed, I fired up Visual Studio again and tried to load the project. Hey presto! It worked.


Software environment used in this scenario: Windows Server 2012 R2 with IIS, Visual Studio 2013 with Update 4.

License

This article, along with any associated source code and files, is licensed under The Microsoft Public License (Ms-PL)