HTTP error 500.19 - Cannot read configuration file

前端 未结 13 2225
醉梦人生
醉梦人生 2021-02-02 09:37

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

相关标签:
13条回答
  • 2021-02-02 10:05

    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.

    0 讨论(0)
  • 2021-02-02 10:07

    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

    0 讨论(0)
  • 2021-02-02 10:09

    Go to the project dir:

    ..\\{ProjectDir}\\.vs\\{ProjectName}\\config
    

    Then delete the applicationhost.config file and recompile your solution.

    That's all.

    0 讨论(0)
  • 2021-02-02 10:11

    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.

    1. First close your VS and remove .vs/ folder inside your solution directory
    2. Reopen VS and click Create Virtual Directory inside the project properties (Web tab) - VS will register the site again and create corresponding folder inside %USERPROFILE%\My Documents\My Web Sites\
    0 讨论(0)
  • 2021-02-02 10:13

    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.

    0 讨论(0)
  • 2021-02-02 10:19

    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.

    0 讨论(0)
提交回复
热议问题