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,如需转载请自行联系原作者

相关文章
|
13天前
|
Linux C++ Windows
【Azure 应用服务】Azure App Service(Windows)环境中如何让.NET应用调用SAP NetWeaver RFC函数
【Azure 应用服务】Azure App Service(Windows)环境中如何让.NET应用调用SAP NetWeaver RFC函数
【Azure 应用服务】Azure App Service(Windows)环境中如何让.NET应用调用SAP NetWeaver RFC函数
|
4天前
|
Windows
Windows操作系统部署安装Kerberos客户端
详细介绍了在Windows操作系统上部署安装Kerberos客户端的完整过程,包括下载安装包、安装步骤、自定义安装路径、修改环境变量、配置hosts文件和Kerberos配置文件,以及安装后的验证步骤。
16 3
Windows操作系统部署安装Kerberos客户端
|
14天前
|
缓存 NoSQL Linux
【Azure Redis 缓存】Windows和Linux系统本地安装Redis, 加载dump.rdb中数据以及通过AOF日志文件追加数据
【Azure Redis 缓存】Windows和Linux系统本地安装Redis, 加载dump.rdb中数据以及通过AOF日志文件追加数据
【Azure Redis 缓存】Windows和Linux系统本地安装Redis, 加载dump.rdb中数据以及通过AOF日志文件追加数据
|
3天前
|
网络安全 虚拟化 Windows
windows 11安装openSSH server 遇到的"kex_exchange_identification: read: Connection reset"问题
windows 11安装openSSH server 遇到的"kex_exchange_identification: read: Connection reset"问题
|
10天前
|
Linux iOS开发 开发者
跨平台开发不再难:.NET Core如何让你的应用在Windows、Linux、macOS上自如游走?
【8月更文挑战第28天】本文提供了一份详尽的.NET跨平台开发指南,涵盖.NET Core简介、环境配置、项目结构、代码编写、依赖管理、构建与测试、部署及容器化等多个方面,帮助开发者掌握关键技术与最佳实践,充分利用.NET Core实现高效、便捷的跨平台应用开发与部署。
45 3
|
10天前
|
Ubuntu Linux 虚拟化
安装Windows Linux 子系统的方法:适用于windows 11 版本
本文提供了在Windows 11系统上安装Linux子系统(WSL)的详细步骤,包括启用子系统和虚拟化功能、从Microsoft Store安装Linux发行版、设置WSL默认版本、安装WSL2补丁,以及完成Ubuntu的首次安装设置。
42 2
|
9天前
|
API Docker Windows
2024 Ollama 一站式解决在Windows系统安装、使用、定制服务与实战案例
这篇文章是一份关于Ollama工具的一站式使用指南,涵盖了在Windows系统上安装、使用和定制服务,以及实战案例。
2024 Ollama 一站式解决在Windows系统安装、使用、定制服务与实战案例
|
10天前
|
网络安全 Windows
windows安装ssh服务
windows安装ssh服务
14 0
|
13天前
|
网络安全 API 数据安全/隐私保护
【Azure App Service】.NET代码实验App Service应用中获取TLS/SSL 证书 (App Service Windows)
【Azure App Service】.NET代码实验App Service应用中获取TLS/SSL 证书 (App Service Windows)
|
14天前
|
Java 开发工具 Spring
【Azure Spring Cloud】使用azure-spring-boot-starter-storage来上传文件报错: java.net.UnknownHostException: xxxxxxxx.blob.core.windows.net: Name or service not known
【Azure Spring Cloud】使用azure-spring-boot-starter-storage来上传文件报错: java.net.UnknownHostException: xxxxxxxx.blob.core.windows.net: Name or service not known
下一篇
DDNS