Search code examples
visual-studioiis-express

Add Web Site to Visual Studio solution without using IISExpress


In Visual Studio Ultimate 2013 and Visual Studio Community 2015, I have a solution which has several Projects and a Web Site.

Today when opening the solution the projects loaded but the Web Site failed to load. I removed it and tried adding it back in again but I get an error saying:

Configuring IIS Express failed with the following error:
Filename: redirection.config
Error: Cannot read configuration file

My "Documents\IISExpress" folder is mapped to a network drive which has some permissions issues, however this has always been the case including when I created the Web Site originally and I don't want to use IISExpress because it's hosted through IIS.

How do I add the Web Site back in without Visual Studio wanting to access IISExpress?


Solution

  • To get around this I ended up creating a new Project within my Visual Studio Solution. The same error message appears and the new project wasn't included in the solution. I edited the .csproj file in notepad and removed the key ProjectTypeGuids. I then copied the files from the Web Site folder into the new Project, and added the project to my solution with "Add" > "Existing Project".

    I also checked that UseIISExpress was set to false, and entered my IIS details within the WebProjectProperties section.