【问题标题】:An error occurred while attempting to determine the process id of dotnet.exe which is hosting your application. One or more errors occurred尝试确定托管应用程序的 dotnet.exe 的进程 ID 时发生错误。出现一个或多个错误
【发布时间】:2017-01-05 15:02:41
【问题描述】:

我知道关于这个主题有一百万个问题,但没有一个解决方案对我有帮助。

我在我的解决方案中实现 IdentityServer,每次尝试运行它时都会收到此错误:

当我按下在 IISExpress 上进行调试时,它就会发生。 我在某处读到该问题与 .NET Core 有关,如果您关闭 VS2015,删除 package.lock.json,那么该解决方案对我没有帮助。

有没有办法查看这个问题的更多细节?这个错误根本不是暗示性的,是一些日志文件还是什么?

我所有的参考资料看起来都不错:

这是我的 package.json:

{
  "dependencies": {
    "Microsoft.NETCore.App": {
      "version": "1.0.0",
      "type": "platform"
    },
        "Microsoft.AspNetCore.Diagnostics": "1.1.0",
        "Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
        "Microsoft.AspNetCore.Mvc": "1.1.0",
        "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
        "Microsoft.AspNetCore.Routing": "1.1.0",
        "Microsoft.AspNetCore.Server.IISIntegration": "1.1.0",
        "Microsoft.AspNetCore.Server.Kestrel": "1.1.0",
        "Microsoft.AspNetCore.StaticFiles": "1.1.0",
        "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
        "Microsoft.Extensions.Configuration.Json": "1.1.0",
        "Microsoft.Extensions.Logging": "1.1.0",
        "Microsoft.Extensions.Logging.Console": "1.1.0",
        "Microsoft.Extensions.Logging.Debug": "1.1.0",
        "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.0",
        "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.*",
        "IdentityServer4": "1.0.0-rc5"
  },

  "tools": {
    "BundlerMinifier.Core": "2.0.238",
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final"
  },

  "frameworks": {
    "netcoreapp1.0": {
      "imports": [
        "dotnet5.6",
        "portable-net45+win8"
      ]
    }
  },

  "buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true
  },

  "runtimeOptions": {
    "configProperties": {
      "System.GC.Server": true
    }
  },

  "publishOptions": {
    "include": [
      "wwwroot",
      "web.config"
    ]
  },

  "scripts": {
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}

也许我遗漏了一些使用 IISExpress 所必需的参考资料?我根本不知道可能是什么问题。有没有人经历过类似的事情?

【问题讨论】:

标签: .net-core


【解决方案1】:

我不知道您是否在项目中使用 SSL。如果是,那么 Doug 提供的链接将解决问题。如果不是,请按照以下步骤解决问题:

  1. 打开项目属性
  2. 打开调试菜单
  3. 取消选中启用 SSL 并重写应用网址(http://localhost:5000 或您使用的任何端口。确保 'http' 中没有 's'!)
  4. Ctrl+S(保存文件)
  5. 关闭所有 Chrome 或 IE 实例
  6. 在 VS 中重新打开您的项目。
  7. 现在,运行您的项目。 (点击 IIS Express)
  8. 仅此而已。

希望它对你有用。

【讨论】:

  • 感谢一百万
【解决方案2】:

我需要 https,所以这对我有用:

  1. 进入添加/删除程序并修复 IISExpress,这将重新安装 IIS 证书
  2. 打开项目属性
  3. 打开调试菜单取消选中启用 SSL 并 重写 App Url(http://localhost:5000 或您使用的任何端口 使用。确保“http”中没有“s”!)
  4. Ctrl+S(保存文件)
  5. 启动应用程序
  6. 停止应用程序
  7. 打开项目属性并再次启用 ssl
  8. Ctrl+S(保存文件)
  9. 编辑 Properties 文件夹下的 launchSettings.json,确保所有端口都设置正确并且所有 url 都有 https
  10. 保存 launchSettings.json 并再次启动您的网站

【讨论】:

    猜你喜欢
    • 2017-04-19
    • 1970-01-01
    • 2016-01-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多