【问题标题】:Can't deploy ASP.net core RC2 targeting net451 or net46 to Azure Web App无法将面向 net451 或 net46 的 ASP.net 核心 RC2 部署到 Azure Web App
【发布时间】:2016-06-13 01:54:39
【问题描述】:

当我以 net451 或 net46 框架为目标时,我似乎无法将我的 asp.net core RC2 应用程序部署到 Azure。

当我尝试访问我的应用程序时,我收到以下错误

指定的 CGI 应用程序遇到错误,服务器终止了进程。

当我部署到本地 IIS 时一切正常。

Azure 记录器提供给我

无法使用命令行“%LAUNCHER_PATH% %LAUNCHER_ARGS%”启动进程,错误代码 =“0x80070002”。

我尝试在 web.config 中将 %LAUNCHER_PATH% 替换为 dotnet%LAUNCHER_ARGS% 替换为 myapp.exe,但仍然出现相同的错误。

这是我的 project.json

{
  "dependencies": {
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final"
  },

  "tools": {
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": {
      "version": "1.0.0-preview1-final",
      "imports": "portable-net45+win8+dnxcore50"
    }
  },

  "frameworks": {
    "net46": {}
  },

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

  "runtimeOptions": {
    "gcServer": true
  },

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

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

谢谢

【问题讨论】:

  • 检查对应的事件日志,看看是否有什么有趣的地方。通过将stdoutLogEnabled 设置为truestdoutLogPath 设置为\\?\%home%\LogFiles\stdout 来打开日志记录,然后查看日志中的内容。看看我的帖子,其中提供了解决问题的步骤blog.3d-logic.com/2016/06/08/…
  • 谢谢 Pawel,我已经编辑了我的问题以显示您的建议结果。
  • 您是否尝试再次下载发布配置文件?

标签: azure asp.net-core


【解决方案1】:

似乎更新我的 web.config 以指定 processPath 就可以了。

我还必须删除之前的发布尝试才能正常工作。

<aspNetCore processPath=".\myapp.exe" arguments="" forwardWindowsAuthToken="false" stdoutLogEnabled="true"  stdoutLogFile="\\?\%home%\LogFiles\stdout"/>

【讨论】:

    【解决方案2】:

    我检查了@Pawel 建议的日志,症状相同。 日志包含 FileNotFoundException,已通过向 project.json 添加两个依赖项解决。

    "dependencies": {
      ...
      "System.IO.FileSystem.Watcher": "4.0.0-rc2-24027",
      "System.IO.FileSystem": "4.0.1-rc2-24027"
    },
    

    问题是reported here

    【讨论】:

      【解决方案3】:

      Azure 不支持 net461,使用更好的 net451。

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

      为 .NETFramework 发布 SkyIsTheLimit,Version=v4.5.1/win7-x64

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-03-03
        • 1970-01-01
        • 2016-10-17
        • 2019-12-26
        相关资源
        最近更新 更多