无法在我的机器上 运行 特定 ASP.NET 项目。 Rider 和 VS2019

Can't run a specific ASP.NET project on my machine. Both Rider and VS2019

Cannot send a DEBUG request to IIS Express (exception: An error occurred while sending the request., reason: System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> 
System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a receive. ---> 
System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> 
System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.Net.Sockets.Socket.EndReceive(IAsyncResult asyncResult) at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult) 
--- End of inner exception stack trace --- at System.Net.Sockets.NetworkStream.EndRead(IAsyncResult asyncResult) at System.Net.Connection.ReadCallback(IAsyncResult asyncResult) 
--- End of inner exception stack trace --- at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult) at System.Net.Http.HttpClientHandler.GetResponseCallback(IAsyncResult ar) 
--- End of inner exception stack trace --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at JetBrains.ReSharper.Host.Features.IisIntegration.IisExpressHost. d__14.MoveNext()). It may indicate an invalid "applicationUrl" parameter in your launchSettings.json. Please check your settings.

我从 Rider 那里收到的错误消息 运行。 VS2019 没有给出错误消息,但我只是用它来测试它是 IDE 还是项目。

解决方案里面的项目都是用netcoreapp2.2.

我已将范围缩小到我认为 Rider 尝试为项目设置 SSL 时出现的错误。

不确定还可以包括什么,如果有我可以包括的东西或我可以指向的文件让我知道。

运行 项目而不是调试允许我通过转到 URL 访问该站点,但显然这远非理想,因为我需要调试工具。

想通了。所以在我的例子中,发生这种情况是因为 Rider 有自己的 SSL 证书,在我的机器上未安装的本地项目 运行 上设置 SSL 时会使用该证书。但是,错误消息并未给出任何指示。

要安装它需要的 ASP.NET 核心证书,请执行以下操作(来自 here 的说明)。

  1. 命中Ctrl+T
  2. 单击“操作”选项卡
  3. 搜索“设置证书”
  4. 点击“设置 ASP.NET 核心开发人员证书”