A default document is not configured for the requested URL, and directory browsing is not enabled on the server

前端 未结 12 897
时光说笑
时光说笑 2020-12-13 03:37

I have just deployed my asp.net mvc-2 website to a server (using dotnetpanel). But getting this error

A default document is not configured for the requested          


        
12条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-13 04:20

    This can also occur if you do something stupid (like I did) and place the api url in the "Project Url" (e.g. http://localhost:59088/api/Product) on the Project Properties->Web tab instead of specifying it in the "Specific Page" text box. This causes Visual Studio to go ahead and create an APP called ProjectName/api/Product, and this will expect a default page. The only way to undo this is to go to C:\Program Files (x86)\IIS Express and use appcmd.exe to delete it like so

    >.\appcmd.exe delete APP "ProjectName/api/Product"
    

提交回复
热议问题