从VS 2019运行VS 2017项目?

时间:2019-08-23 07:53:04

标签: asp.net asp.net-mvc visual-studio-2019

我是Asp.Net的新手。 我使用VS 2017创建了一个项目(较早),该项目运行良好(最近使用)。

最近,我将VS 2017更新为VS 2019;现在使用VS 2019,我的项目没有运行。

我以前的项目(PersonDetails)位于C:\Users\HP\source\repos\PersonDetails目录中,该目录包含以下文件和文件夹:

  • .vs
  • 包装
  • PersonDetails
  • PersonDetails.sln

现在,当我尝试在VS 2019中运行项目时,在浏览器上它显示以下错误

  

HTTP错误403.14-禁止       Web服务器被配置为不列出此目录的内容。

Most likely causes:
A default document is not configured for the requested URL, and directory browsing is not enabled on the server.

Things you can try:
If you do not want to enable directory browsing, ensure that a default document is configured and that the file exists.
Enable directory browsing.
Go to the IIS Express install directory.
Run appcmd set config /section:system.webServer/directoryBrowse /enabled:true to enable directory browsing at the server level.
Run appcmd set config ["SITE_NAME"] /section:system.webServer/directoryBrowse /enabled:true to enable directory browsing at the site level.
Verify that the configuration/system.webServer/directoryBrowse@enabled attribute is set to true in the site or application configuration file.

Detailed Error Information:
Module     DirectoryListingModule
Notification       ExecuteRequestHandler
Handler    StaticFile
Error Code     0x00000000
Requested URL      http://localhost:49236/
Physical Path      C:\Users\HP\source\repos\PersonDetails\PersonDetails
Logon Method       Anonymous
Logon User     Anonymous

More Information:
This error occurs when a document is not specified in the URL, no default document is specified for the Web site or application, and directory listing is not enabled for the Web site or application. This setting may be disabled on purpose to secure the contents of the server.
View more information »

此外,当我在VS 2019中构建新项目时,它可以正常运行。 新项目(第一个)位于C:\Users\HP\source\repos\first目录中,该目录包含以下文件:

.vs

bin

obj

properties

appsettings.Developement.json

appsettings.json

first.csproj

first.sln

Program.cs

Startup.cs

为了在VS 2019中运行项目(PersonDetails),可能会进行哪些修改?

感谢那些愿意提供帮助的人。 :-)

1 个答案:

答案 0 :(得分:0)

我不知道我是否正确理解了您的问题。我以前也遇到过同样的问题。请单击您的第一个项目(.sln文件),然后选择使用vs 2019打开。之后,单击解决方案资源管理器中的所有项目,然后选择重新加载它们。 重新加载所有这些文件后,请单击您的主项目,然后选择设置为开始。

相关问题