Windows 2012 ASP.NET安裝經驗一則
来源:互联网 发布:网络剧 有毒 第一集 编辑:程序博客网 时间:2024/05/18 03:04
專案動用了SignalR 2.0,在我的Windows 2008R2開發機配合Chrome實測卻怎麼都無法開啟WebSocket傳輸,後來才發現SignalR支援WebSocket的必要條件:
- 伺服器端: .NET 4.5 Framework + Windows 8 或 Windows 2012
- 瀏覽器端: IE10+或其他瀏覽器
為上線預做準備,決定灌台Windows 2012R2 VM演練兼實測。Windows 2012R2介面修改不小,融入許多Windows 8風格,所幸Roles、Feature等觀念仍與Win2008一致,只差得花點時間熟悉新操作介面。
新增了IIS,也勾選了ASP.NET 4.5,心想這樣ASP.NET就安裝完成了。
在IIS管理工具使用Add Application掛上ASP.NET程式,但IIS管理員看起來怪怪的,右方只有IIS區,少了ASP.NET區。
瀏覽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".
依據過去的知識(參考: 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項目:
Application Role有個Web Server (IIS) Support,記得也要安裝。
加入Web Server (IIS) Support後,Web Server區會多出Application Developer項目,下面有ASP、ASP.NET 3.5、CGI... 等子項可以選擇。如果想啟用SignalR WebSocket傳輸,記得要勾選WebSocket Protocol。
幾經波折,WebSocket + SignalR終於合體完成!
【延伸閱讀】附上官方版的IIS8 ASP.NET安裝步驟。
- Windows 2012 ASP.NET安裝經驗一則
- ASP.NET Windows身份验证
- ASP.NET Windows用户认证
- ASP.NET Windows authentication 测试
- ASP.NET , windows窗体入门教程
- ASP.NET中的Windows身份验证
- asp.net 创建Windows服务
- ASP.NET中的Windows身份验证
- asp.net 控制windows服务
- asp.net 创建Windows服务
- ASP.NET 中的 Windows 身份验证
- asp.net 控制windows服务
- Asp.net 2.0 Windows Authentication
- ASP.NET 模拟Windows资源管理器
- asp.net调用windows服务
- Windows 2003 中配ASP,ASP.NET
- Windows 2003 中配ASP,ASP.NET
- 在 Windows Server 2012 上安装 ASP.NET STATE SERVICE
- 【RBM】代码学习--DeepLearningToolBox
- 使用Python进行分布式系统协调 (ZooKeeper/Consul/etcd)
- 值得Star的开源项目(一):完善的文件下载器
- 面向对象
- 贾跃亭对乐视员工的公开信
- Windows 2012 ASP.NET安裝經驗一則
- Servlet过滤和监听器
- Android研发安全3-Service安全
- linux内核的队列实现移植
- 构造函数
- Qt下载网络文件
- 并发编程——并行级别
- 多文件导出为ZIP文件
- 数组工具对象建立