简体   繁体   English

从 IIS 运行 ASP.NET MVC 6 Web API

[英]Running ASP.NET MVC 6 Web API from IIS

I create a MVC 6 Web API project that is running as expected from Visual Studio, when I'm however deploying to production I'm getting a我创建了一个 MVC 6 Web API 项目,该项目在 Visual Studio 中按预期运行,但是当我部署到生产时,我得到了一个

An error occured while starting the application启动应用程序时发生错误

error.错误。

在此处输入图片说明

I did the following on the production machine我在生产机器上做了以下工作

  • Installed ASP.NET 5 from https://get.asp.nethttps://get.asp.net安装 ASP.NET 5
  • Made sure that the production environment is running the same dnx version that the application was published with确保生产环境运行与发布应用程序相同的 dnx 版本
  • Installed HttpPlatformHandler 1.2已安装 HttpPlatformHandler 1.2
  • Set the application pool .NET CLR Version to No Managed Code将应用程序池 .NET CLR 版本设置为无托管代码
  • Pointed the root location to the wwwroot folder将根位置指向 wwwroot 文件夹

Is there anything else that I'm missing?还有什么我想念的吗?

When you run into 500 errors, remember that ASP.NET 5 application can be self hosted,当您遇到 500 个错误时,请记住 ASP.NET 5 应用程序可以自托管,

  • Open a command prompt打开命令提示符
  • Browse to the application directory浏览到应用程序目录
  • Type in web.cmd输入 web.cmd

I had some reference problems within my application that was listed in my command prompt which I subsequently fixed and everything worked as expected.我的应用程序中有一些参考问题列在我的命令提示符中,我随后修复了这些问题,一切都按预期工作。

500 can be thrown by different failures. 500 可以由不同的失败抛出。 Take a look on http://docs.asp.net/en/latest/publishing/iis.html what u've missed in your configuration.查看http://docs.asp.net/en/latest/publishing/iis.html您在配置中遗漏了什么。 And you should call it ASP.NET Core 1你应该称之为 ASP.NET Core 1

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM