Windows 2012 IIS ASP.NET 安装

简介:

from:http://blog.darkthread.net/post-2013-11-29-iis8-asp-net-setup.aspx

專案動用了SignalR 2.0,在我的Windows 2008R2開發機配合Chrome實測卻怎麼都無法開啟WebSocket傳輸,後來才發現SignalR支援WebSocket的必要條件:

1. 伺服器端: .NET 4.5 Framework + Windows 8 或 Windows 2012

2. 瀏覽器端: IE10+或其他瀏覽器

為上線預做準備,決定灌台Windows 2012R2 VM演練兼實測。Windows 2012R2介面修改不小,融入許多Windows 8風格,所幸Roles、Feature等觀念仍與Win2008一致,只差得花點時間熟悉新操作介面。

新增了IIS,也勾選了ASP.NET 4.5,心想這樣ASP.NET就安裝完成了。

clip_image001

在IIS管理工具使用Add Application掛上ASP.NET程式,但IIS管理員看起來怪怪的,右方只有IIS區,少了ASP.NET區。

clip_image002

瀏覽ASP.NET網頁,得到500.19錯誤:

HTTP Error 500.19 - Internal Server Error
The requested page cannot be accessed because the related configuration data for the page is invalid.
Error Code 0x80070021
Config Error This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".

clip_image003

依據過去的知識(參考: 91的文章),常是aspnet_regiis未正確註冊所致,試著註冊卻有新發現:

C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis -i
Microsoft (R) ASP.NET RegIIS version 4.0.30319.33440
Administration utility to install and uninstall ASP.NET on the local machine.
Copyright (C) Microsoft Corporation. All rights reserved.
Start installing ASP.NET (4.0.30319.33440).
This option is not supported on this version of the operating system. Administr
ators should instead install/uninstall ASP.NET 4.5 with IIS8 using the "Turn Win
dows Features On/Off" dialog, the Server Manager management tool, or the dism.e
xe command line tool. For more details please see http://go.microsoft.com/fwlink/?LinkID=216771.
Finished installing ASP.NET (4.0.30319.33440).

ASP.NET 4.5跟IIS8已不用aspnet_regiis這招了,要透過Feature管理新增才行,但是如第一張圖例所示,我明明已經裝過ASP.NET 4.5呀?

摸索了一陣子才搞懂,我在新增Role時少選了Application Server項目:

clip_image004

Application Role有個Web Server (IIS) Support,記得也要安裝。

clip_image005

加入Web Server (IIS) Support後,Web Server區會多出Application Developer項目,下面有ASP、ASP.NET 3.5、CGI... 等子項可以選擇。如果想啟用SignalR WebSocket傳輸,記得要勾選WebSocket Protocol。

clip_image006

幾經波折,WebSocket + SignalR終於合體完成!

【延伸閱讀】附上官方版的IIS8 ASP.NET安裝步驟




本文转自94cool博客园博客,原文链接:http://www.cnblogs.com/94cool/p/6748628.html,如需转载请自行联系原作者

相关文章
|
11月前
|
C++ Windows
.NET Framework安装不成功,下载`NET Framework 3.5`文件,Microsoft Visual C++
.NET Framework常见问题及解决方案汇总,涵盖缺失组件、安装失败、错误代码等,提供多种修复方法,包括全能王DLL修复工具、微软官方运行库及命令行安装等,适用于Windows系统,解决应用程序无法运行问题。
1576 3
|
8月前
|
开发框架 安全 .NET
Microsoft .NET Framework 3.5、4.5.2、4.8.1,适用于 Windows 版本的 .NET,Microsoft C Runtime等下载
.NET Framework是Windows平台的开发框架,包含CLR和FCL,支持多种语言开发桌面、Web应用。常用版本有3.5、4.5.2、4.8.1,系统可同时安装多个版本,确保软件兼容运行。
1942 0
Microsoft .NET Framework 3.5、4.5.2、4.8.1,适用于 Windows 版本的 .NET,Microsoft C Runtime等下载
|
Linux C++ Windows
【Azure 应用服务】Azure App Service(Windows)环境中如何让.NET应用调用SAP NetWeaver RFC函数
【Azure 应用服务】Azure App Service(Windows)环境中如何让.NET应用调用SAP NetWeaver RFC函数
401 0
【Azure 应用服务】Azure App Service(Windows)环境中如何让.NET应用调用SAP NetWeaver RFC函数
|
监控 Linux
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡
769 13
yum install -y net-snmp-devel 安装不成功 zabbix项目安装,Errors during downloading metadata for repository ‘extras-common’:问题解决方案-优雅草卓伊凡
|
区块链 C# Windows
PasteEx:一款.NET开源的Windows快捷粘贴神器
PasteEx:一款.NET开源的Windows快捷粘贴神器
352 17
|
Web App开发 C# Windows
一款.NET开源的Windows资源管理器标签页工具
一款.NET开源的Windows资源管理器标签页工具
339 5
|
弹性计算 开发框架 安全
基于云效 Windows 构建环境和 Nuget 制品仓库进行 .Net 应用开发
本文将基于云效 Flow 流水线 Windows 构建环境和云效 Packages Nuget 制品仓库手把手教你如何开发并部署一个 .NET 应用,从环境搭建到实战应用发布的详细教程,帮助你掌握 .NET 开发的核心技能。
|
开发框架 .NET API
Windows Forms应用程序中集成一个ASP.NET API服务
Windows Forms应用程序中集成一个ASP.NET API服务
475 9
|
存储 开发框架 .NET
Windows IIS中asp的global.asa全局配置文件使用说明
Windows IIS中asp的global.asa全局配置文件使用说明
431 1
mcr.microsoft.com/dotnet/core/aspnet:2.1安装libgdiplus
mcr.microsoft.com/dotnet/core/aspnet:2.1安装libgdiplus
263 1