In one of my ASP.NET apps, all of a sudden I am unable to run it in Visual Studio 2013 due to the error displayed below. It appears that it is trying to open the web.config from
Here is a solution i have found.
https://gyorgybalassy.wordpress.com/2015/03/06/i-asked-for-a-vs-folder-and-the-vs-team-gave-it-to-me/
(1)Find the applicationhost.config file in |YourSolution|\.vs\config
(2)Modify the VirtualDirectory PhysicalPath To your project.
(3)Restart solution. Start project.
(4)If it's still not working, try to check setting in your IISExpress config. If there is not site setting, copy And paste the setting to |UserOnYourComputer|\Documents\IISExpress\config\applicationhost.config
(5)Change the id to other id which not be used in IISExpress applicationhost.config.
(6)Start your project.
In my case I deleted all folders in D:\My Documents\My Web Sites\ before Then I caught the error There is a file .vs\config\applicationhost.config in my solution folder It contains reference to the deleted folder. So, I deleted applicationhost.config and then pressed 'Create Virtual Directory' button in my project property Web page. It was recreated the file and the folder
Go to the project dir:
..\\{ProjectDir}\\.vs\\{ProjectName}\\config
Then delete the applicationhost.config
file and recompile your solution.
That's all.
I had this issue when I moved the project folder to the new machine. The problem is that the VS has the site registered in its config file (applicationhost.config
) inside .vs/
folder but did not create folder inside %USERPROFILE%\My Documents\My Web Sites\
. If you just click Create Virtual Directory inside the project properties (Web tab) it will not be enough.
.vs/
folder inside your solution directory%USERPROFILE%\My Documents\My Web Sites\
Delete .VS folders that Visual studio created. It might be hidden in your project structure. Unhide the folders and look for .vs folder and delete that folder and rebuild the application.
After all this answers I find my solution. Delete te WebSite in the IIS and recriate. Why? Because I had create de website before installed the framework 4.5 and URL Rewrite.