IIS仅在.net46发布.netcore时找不到web.config

时间:2016-09-01 01:06:38

标签: c# azure asp.net-core asp.net-core-mvc

当我发布使用ASP.NET核心Web应用程序(.NET Framework)模板构建的.net46 MVC项目时,我收到了HSC500错误。查看流日志时,我可以看到消息:

  • IIS收到了请求;但是,在处理请求期间发生了内部错误。此错误的根本原因取决于哪个模块处理请求以及发生此错误时工作进程中发生的情况。
  • IIS无法访问Web站点或应用程序的web.config文件。如果NTFS权限设置不正确,则会发生这种情况。
  • IIS无法处理网站或应用程序的配置。
  • 经过身份验证的用户无权使用此DLL 。
  • 请求被映射到托管处理程序,但未安装.NET可扩展性功能。

我的project.json文件如下:

{
    "dependencies": {
    "AutoMapper": "5.0.2",
    "AutoMapper.EF6": "0.5.0",
    "BlueStar.Core": "1.0.0-*",
    "BlueStar.Data": "1.0.0-*",
    "BlueStar.Data.EntityFramework": "1.0.0-*",
    "BlueStar.Domain": "1.0.0-*",
    "EntityFramework": "6.1.3",
    "EntityFramework.Extended": "6.1.0.168",
    "Microsoft.ApplicationInsights.AspNetCore": "1.0.0",
    "Microsoft.AspNetCore.Diagnostics": "1.0.0",
    "Microsoft.AspNetCore.Mvc": "1.0.0",
    "Microsoft.AspNetCore.Razor.Tools": {
      "version": "1.0.0-preview2-final",
      "type": "build"
    },
    "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0",
    "Microsoft.AspNetCore.Server.Kestrel": "1.0.0",
    "Microsoft.AspNetCore.StaticFiles": "1.0.0",
    "Microsoft.Extensions.Configuration.EnvironmentVariables": "1.0.0",
    "Microsoft.Extensions.Configuration.Json": "1.0.0",
    "Microsoft.Extensions.Logging": "1.0.0",
    "Microsoft.Extensions.Logging.Console": "1.0.0",
    "Microsoft.Extensions.Logging.Debug": "1.0.0",
    "Microsoft.Extensions.Options.ConfigurationExtensions": "1.0.0",
    "Microsoft.VisualStudio.Web.BrowserLink.Loader": "14.0.0"
    },

    "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": {
    "net461": { }
  },

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

  "publishOptions": {
    "include": [
      "wwwroot",
      "Views",
      "Areas/**/Views",
      "appsettings.json",
      "web.config"
    ]
  },

  "scripts": {
    "prepublish": [ "bower install", "dotnet bundle" ],
    "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ]
  }
}

0 个答案:

没有答案