无法将ASP.net核心RC2定位到net451或net46到Azure Web App

时间:2016-06-13 01:54:39

标签: azure asp.net-core

当我定位net451或net46框架时,我似乎无法将我的asp.net核心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%" ]
  }
}

由于

3 个答案:

答案 0 :(得分:2)

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

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

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

答案 1 :(得分:0)

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

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

问题是reported here

答案 2 :(得分:0)

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

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

发布适用于.NETFramework的SkyIsTheLimit,版本= v4.5.1 / win7-x64

相关问题