1.安装 .NET Core Framework

下载.net core地址:官网地址

2.Install IIS

在控制面板->程序与功能-》Internet Infomation Services

3.站点部署

  实例: https://github.com/aspnet/mvc

  在IIS管理器,新建站点->物理路径Path:为项目的根目录。

 网站绑定:

  在host文件中添加127.0.0.1 mvcsanbox.cn,刷新dns缓存:cmd->ipconfig /flushdns

  设置主机域名为:mvcsanbox.cn 端口:80

4.安装 .net Core Windows Server Hosting

下载地址: .NET Core Windows Server Hosting

5.设置网站的web.config

<?xml version="1.0"?>
<configuration>
<system.webServer>
<directoryBrowse enabled="true"/>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified"/>
</handlers>
<!--<aspNetCore processPath="C:\Program Files\dotnet\dotnet.exe" arguments=".\AspNetCoreSampleForNano.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />-->
<aspNetCore processPath=".\bin\Debug\net451\win7-x64\MvcSandbox.exe" arguments="" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false" />
</system.webServer>
</configuration>

参数说明:


Attribute Description
processPath

Required string attribute.

Path to the executable that will launch a process listening for HTTP requests. Relative paths are supported. If the path begins with '.', the path is considered to be relative to the site root.

There is no default value.

arguments

Optional string attribute.

Arguments to the executable specified in processPath.

The default value is an empty string.

startupTimeLimit

Optional integer attribute.

Duration in seconds that the module will wait for the executable to start a process listening on the port. If this time limit is exceeded, the module will kill the process. The module will attempt to launch the process again when it receives a new request and will continue to attempt to restart the process on subsequent incoming requests unless the application fails to start rapidFailsPerMinute number of times in the last rolling minute.

The default value is 120.

shutdownTimeLimit

Optional integer attribute.

Duration in seconds for which the module will wait for the executable to gracefully shutdown when theapp_offline.htm file is detected.

The default value is 10.

rapidFailsPerMinute

Optional integer attribute.

Specifies the number of times the process specified in processPath is allowed to crash per minute. If this limit is exceeded, the module will stop launching the process for the remainder of the minute.

The default value is 10.

requestTimeout

Optional timespan attribute.

Specifies the duration for which the ASP.NET Core Module will wait for a response from the process listening on %ASPNETCORE_PORT%.

The default value is "00:02:00".

stdoutLogEnabled

Optional Boolean attribute.

If true, stdout and stderr for the process specified in processPath will be redirected to the file specified in stdoutLogFile.

The default value is false.

stdoutLogFile

Optional string attribute.

Specifies the relative or absolute file path for which stdout and stderr from the process specified inprocessPath will be logged. Relative paths are relative to the root of the site. Any path starting with '.' will be relative to the site root and all other paths will be treated as absolute paths. A timestamp and the file extension will automatically be added to the filename provided. Any folders provided in the path must exist in order for the module to create the log file.

The default value is aspnetcore-stdout.

forwardWindowsAuthToken true or false.

If true, the token will be forwarded to the child process listening on %ASPNETCORE_PORT% as a header 'MS-ASPNETCORE-WINAUTHTOKEN' per request. It is the responsibility of that process to call CloseHandle on this token per request.

The default value is false.

disableStartUpErrorPage true or false.

If true, the 502.5 - Process Failure page will be suppressed, and the 502 status code page configured in your web.config will take precedence.+

The default value is false.


参考地址:

https://docs.microsoft.com/en-us/aspnet/core/publishing/iis#common-errors

https://docs.microsoft.com/en-us/aspnet/core/publishing/iis#iis-configuration

https://docs.microsoft.com/en-us/aspnet/core/hosting/aspnet-core-module

【先定一个小目标】Asp.net Core 在IIS上的托管运行的更多相关文章

  1. 【先定一个小目标】dotnet core 命令详解

    本篇博客来了解一下dotnet这个神奇的命令.我会依次对dotnet,dotnet new,dotnet restore,dotnet build,dotnet test,dotnet run,dot ...

  2. 先定一个小目标,自己封装个ajax

    你是否发现项目中有很多页面只用到了框架不到十分之一的内容,还引了压缩后还有70多kb的jquery库 你是否发现项目中就用了两三个underscore提供的方法,其他大部分的你方法你甚至从来没有看过 ...

  3. 记一次asp.net core 在iis上运行抛出502.5错误

    asp.net core 在iis上运行抛出502.5异常的部分原因以及解决方案 环境说明 已安装 .net core runtime 2.1.401 已安装 .net core windows ho ...

  4. 先定一个小目标:10天自学C语言编程,教你如何改变一生

    C语言是面向过程的,而C++是面向对象的 C和C++的区别: C是一个结构化语言,它的重点在于算法和数据结构.C程序的设计首要考虑的是如何通过一个过程,对输入(或环境条件)进行运算处理得到输出(或实现 ...

  5. 【先定一个小目标】怎么解决mysql不允许远程连接的错误

    最近使用Navicat for MySQl访问远程mysql数据库,出现报错,显示“1130 - Host'xxx.xxx.xxx.xxx' is not allowed to connect to ...

  6. 【先定一个小目标】windows下安装RabbitMQ消息服务器

    RabbitMQ是一个在AMQP基础上完整的,可复用的企业消息系统.他遵循Mozilla Public License开源协议. 1:安装RabbitMQ 需要先安装Erlang语言开发包.下载地址  ...

  7. 【先定一个小目标】Windows下安装MongoDB 3.2

    1.MongoDB 安装 官网提供了三个版本下载: - MongoDB for Windows 64-bit 适合 64 位的 Windows Server 2008 R2, Windows 7 , ...

  8. 【先定一个小目标】在Windows下的安装Elasticsearch

    ElasticSearch是一个基于Lucene的搜索服务器.它提供了一个分布式多用户能力的全文搜索引擎,基于RESTful web接口.Elasticsearch是用Java开发的,并作为Apach ...

  9. 【先定一个小目标】Windows下Redis的安装使用

    Redis是一个key-value存储系统.和Memcached类似,它支持存储的value类型相对更多,包括string(字符串).list(链表).set(集合).zset(sorted set ...

随机推荐

  1. 一个基于JBoss5.1+EJB3.0 登陆应用

    花了几天的时间研究了一下EJB的使用,一直以来都主要是在写终端中的程序,对Java框架的相关的开发非常不熟悉,中间遇到了不少麻烦,还好总算都攻克了.写篇日志记录一下. 经验总结 为什么选择JBoss5 ...

  2. Node 即学即用 笔记 思维导图

    Node即学即用   REPL(Read-Evaluate-Print-Loop)     console.log     .clear .help .exit     require('http') ...

  3. 1 TypeScript 简介与安装

    简介: TypeScript 是一种由微软开发维护的自由和开源的编程语言,它是JavaScript的一个超集,支持可选的类型检查,扩展了JavaScript的语法,支持JavaScript的所有语法和 ...

  4. 2012年公司组织旅游西安线个人记录(repost)

    2012年公司组织旅游西安线个人记录 文件夹 [隐藏]  1 序言 2 第1天 3 第2天 4 第3天 5 第4天 6 第5天 [title=2012%E5%B9%B4%E5%85%AC%E5%8F% ...

  5. android真机调试 INSTALL_FAILED_MEDIA_UNAVAILABLE 问题解决方案

    前提是手机用数据线连到电脑,安装好手机对应的驱动. 1:打开cmd 2:cd切换到sdk安装目录的platform-tools目录,比如我安装到了D盘根目录,则输入: cd d:\android-sd ...

  6. 开发指南专题二:JEECG微云高速开发平台JEECG框架初探

    开发指南专题二:JEECG微云高速开发平台JEECG框架初探 2.JEECG框架初探 2.1演示系统 打开浏览器输入JEECG演示环境界址:http://demo.jeecg.org:8090/能够看 ...

  7. 2016/3/26 连接数据库 网页中数据的增删改 add delete update addchuli updateChuLi test8 DBDA

    主页面 test8.php <!DOCTYPE html> <html lang="en"> <head> <meta charset=& ...

  8. UVALive3126 Taxi Cab Scheme —— 最小路径覆盖

    题目链接:https://vjudge.net/problem/UVALive-3126 题解: 最小路径覆盖:即在图中找出尽量少的路径,使得每个结点恰好只存在于一条路径上.其中单独一个点也可以是一条 ...

  9. 地图上显示X,Y 坐标代码

    事件数据 所有的鼠标事件都使用MouseButtonEventArgs和MouseEventArgs作为事件数据,通过这两个参数可以获取相关事件数据,使用GetPosition方法或者Source.H ...

  10. CodeForces-213E:Two Permutations(神奇的线段树+hash)

    Rubik is very keen on number permutations. A permutation a with length n is a sequence, consisting o ...