azure - 无法将面向 net451 或 net46 的 ASP.net core RC2 部署到 Azure Web App

标签 azure asp.net-core

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

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

The specified CGI application encountered an error and the server terminated the process.

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

Azure 记录器给了我

Failed to start process with commandline '%LAUNCHER_PATH% %LAUNCHER_ARGS%', Error Code = '0x80070002'.

我尝试在网络中将 dotnet 替换为 %LAUNCHER_PATH% 并将 %LAUNCHER_ARGS% 替换为 myapp.exe .config 但仍然出现同样的错误。

这是我的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%" ]
  }
}

谢谢

最佳答案

看来更新我的 web.config 以指定 processPath 就成功了。

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

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

关于azure - 无法将面向 net451 或 net46 的 ASP.net core RC2 部署到 Azure Web App,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37780855/

相关文章:

javascript - 使用 Javascript 中的 App Insights TrackEvent 将自定义复杂属性发送到遥测到 Azure 门户?

azure - 无法使用现有存储帐户创建 Azure Scheduler

Azure DevOps 变量组未在 Azure 函数配置中应用

azure - 尝试为用户在azure Active Directory中创建Graph api获取应用程序权限,但获取权限失败

c# - 如何在新创建的 .NET Core 2.0 Web 应用程序中以 .NET Standard 2.0 为目标?

.net - 如何使用区域在 razor 组件库中使用 blazor 服务器端?

c# - serilog通过.net核心中的记录器引用为对象建立索引

azure - Office365 OAuth API 返回错误 "AADSTS90093: Does not have access to consent"

wcf - 如何在 dot net core 2.1 项目中增加 WCF 服务的超时值

asp.net - WS-Federation 登录 Asp.NET 5 MVC 6 ADFS