dev*_*ric 16 deployment iis iis-8 visual-studio-2015 asp.net-core
我创建了一个新的ASP.NET5 Beta 8 Web应用程序.
我将它发布到我的本地文件系统并将这些文件复制到我的服务器,即Windows Server 2012 R2
在服务器上的IIS 8.5中,我创建了一个应用程序,该应用程序使用使用Process Model - > Identity as LocalSystem的应用程序池.
我指向复制的已发布应用程序的wwwroot子文件夹的路径
我的web.config
<configuration>
<system.webServer>
<handlers>
<add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
</handlers>
<httpPlatform processPath="..\approot\web.cmd" arguments="" stdoutLogEnabled="false" stdoutLogFile="..\logs\stdout.log" startupTimeLimit="3600"></httpPlatform>
</system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)
直接在服务器上运行URL或单击IIS中的"浏览"
http://localhost/WebApplication1
Run Code Online (Sandbox Code Playgroud)
我收到以下错误
HTTP错误500.19 - 内部服务器错误
无法访问请求的页面,因为页面的相关配置数据无效.
我正在使用Visual Studio 2015 ASP.NET 5 Beta8 Web应用程序模板中的默认web.config,所以我只能认为它可能是.net版本.
我使用MSDN方法确定安装了哪个版本的.NET 4,它对应于.NET Framework 4.5.1
在我的project.json我有
"frameworks": {
"dnx451": { }
},
Run Code Online (Sandbox Code Playgroud)
我在发布时将其编译为Win CLR
当我转到部署目录中的approot文件夹时,我可以运行web.cmd Web服务器,然后通过创建的端口访问我的网站.
http://localhost:5000/
Run Code Online (Sandbox Code Playgroud)
这个网站工作正常.
如果我查看我的IIS服务器角色安装组件
ASP.NET 4.5已安装.
应用程序池是正确的.
ASP.NET 4网站使用相同的应用程序池在IIS中正确运行
我的问题1.为什么IIS说web.config无效?2.如何让IIS 5 Beta 8站点在IIS中运行?
Lex*_* Li 14
HttpPlatformHandler是一个先决条件,因此您需要安装它,
[更新:对于RC2及更高版本,需要一个新模块而不是HttpPlatformHandler,https://github.com/aspnet/Announcements/issues/164 ]
ASP.NET 5 Beta 8中的托管模型已更改,现在依赖于IIS HttpPlatformHandler.
您会注意到wwwroot文件夹中的web.config或您的应用程序包含对它的引用.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>
<httpPlatform processPath="%DNX_PATH%" arguments="%DNX_ARGS%" stdoutLogEnabled="false" startupTimeLimit="3600"/>
</system.webServer>
Run Code Online (Sandbox Code Playgroud)
以上%DNX_PATH%转换为"..\approot\web.cmd"
现在可以使用配置为转发到ASP.NET 5 Kestrel服务器的IIS HttpPlatformHandler来实现在IIS中托管ASP.NET 5应用程序.HttpPlatformHandler是一个本机IIS模块,需要由运行IIS的服务器上的管理员安装(安装程序:x86,x64).它也已包含在用于IIS Express本地开发的beta8 Web工具更新中.此本机IIS模块管理启动外部应用程序主机进程(在本例中为dnx.exe)以及从IIS到托管进程的请求路由.
您可以使用Microsoft Web Platform安装程序安装HttpPlatformHandler,也可以在Microsoft IIS站点的链接下载链接上单独安装x86/x64安装程序.
请注意:HttpPlatformHandler仅支持IIS 8 +.因此,这意味着对于IIS 7.5附带的Windows Server 2008 R2等较旧的操作系统,您将无法使用IIS来承载ASP.NET 5网站,因为这些版本不支持HttpPlatformHandler.