ASP.Net核心无法在IIS上发布。错误502.5:0x80004005:c0000135

时间:2017-01-30 23:50:13

标签: iis asp.net-core

早上好,

我开发了一个使用VS 2015发布的新的ASP.Net Core网站,该网站在我的本地IIS上发布时可以在preprod中运行,但在我公司的IIS服务器上发布时却没有。 在我的IT管理员处,我们已经完成了此处列出的所有不同步骤:https://docs.microsoft.com/en-us/aspnet/core/publishing/iis并尝试了解决方案:ASP.NET Core 1.0 on IIS error 502.5

  • 安装出现的捆绑包1.1.0的ASP.Net核心窗口 现在在模块中
  • 重新启动IIS
  • 检查用户标识是否可以访问dotnet.exe 应用程序池
  • 检查可以在PATH设置中访问dotnet.exe
  • 检查.UseIISIntegration()是否是我的program.cs

但我们仍有错误

failed to start process with commandline '"dotnet" .\WebApplication.dll', ErrorCode = '0x80004005 : c0000135.

我的Web.config是:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.webServer>
    <handlers>
      <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".\WebApplication3.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
  </system.webServer>
</configuration>

我的appsettings.json:

{
  "ConnectionStrings": {
    "DefaultConnection": "XXXXXXXXXXXXXXXX"
  },
  "Logging": {
    "IncludeScopes": false,
    "LogLevel": {
      "Default": "Debug",
      "System": "Information",
      "Microsoft": "Information"
    }
  }
}

和我的project.json:

    {
  "userSecretsId": "aspnet-WebApplication3-XXX",

  "dependencies": {
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.EntityFrameworkCore.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.VisualStudio.Web.CodeGenerators.Mvc": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.AspNetCore.Authentication.Cookies": "1.1.0",
    "Microsoft.AspNetCore.Diagnostics": "1.1.0",
    "Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Identity.EntityFrameworkCore": "1.1.0",
    "Microsoft.AspNetCore.Mvc": "1.1.1",
    "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.EntityFrameworkCore.SqlServer": "1.1.0",
    "Microsoft.EntityFrameworkCore.SqlServer.Design": {
      "version": "1.1.0",
      "type": "build"
    },
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.1.0",
    "Microsoft.Extensions.Configuration.Json": "1.1.0",
    "Microsoft.Extensions.Configuration.UserSecrets": "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.NETCore.App": {
      "version": "1.1.0",
      "type": "platform"
    },
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.1.0"
  },

  "tools": {
    "BundlerMinifier.Core": "2.2.306",
    "Microsoft.AspNetCore.Razor.Tools": "1.0.0-preview2-final",
    "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final",
    "Microsoft.EntityFrameworkCore.Tools": "1.0.0-preview2-final",
    "Microsoft.Extensions.SecretManager.Tools": "1.0.0-preview2-final",
    "Microsoft.VisualStudio.Web.CodeGeneration.Tools": {
      "version": "1.0.0-preview2-final",
      "imports": [
        "portable-net45+win8"
      ]
    }
  },

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

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

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

  "publishOptions": {
    "include": [
      "wwwroot",
      "**/*.cshtml",
      "appsettings.json",
      "web.config"
    ]
  },
  "scripts": {
    "prepublish": [ "bower install", "dotnet bundle" ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}

你还有其他建议吗? c0000135会建议什么?

干杯

西尔

2 个答案:

答案 0 :(得分:0)

我遇到了同样的错误,通过安装Microsoft Visual C++ 2015 Redistributable Update 3来修复。

之后我又收到了一个错误:

  

无法从[?9]加载dll,HRESULT:0x80070057

     

找到了库hostfxr.dll,但从C:\ Program Files \ dotnet \ host \ fxr \ 2.0.7 \ hostfxr.dll加载

已安装KB2999226KB3118401 - 但没有帮助。我使用的是Windows Server 2008 R2。

Prerequisites for .NET Core on Windows

答案 1 :(得分:0)

为解决此问题,我将这些行添加到了.csproj文件中

<PropertyGroup>
       <PublishWithAspNetCoreTargetManifest>false</PublishWithAspNetCoreTargetManifest>
</PropertyGroup>

这对我有用。

相关问题