asp.netcore iis中热更新

总结下来两种方式

  1. 修改web.config
  2. 新增html文件

修改web.config

这是之前写的,修改为进程外偶尔会不行
https://blog.csdn.net/qq_36437991/article/details/134090442

新增html

项目根目录下新增app_offline.htm,不是wwwroot下新增

html 复制代码
<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Offline</title>
</head>
<body style="margin:3em;font-family:sans-serif">
  <h2>Offline</h2>
  <p>This site is offline for maintenance.</p>
  <!--       
    Adding some hidden content so that IE "Friendly Errors" don't keep
    this message from displaying. (It will show a "friendly" 404
    error if the content isn't at least 512 bytes.)
    This is mostly a problem for IE6 which has "Friendly Errors" on by default.
    See http://weblogs.asp.net/scottgu/App_5F00_Offline.htm-and-working-around-the-_2200_IE-Friendly-Errors_2200_-feature
    
    <h2>This site is offline.</h2>
    <h2>This site is offline.</h2>
    <h2>This site is offline.</h2>
    <h2>This site is offline.</h2>
    <h2>This site is offline.</h2>
    -->
</body>
</html>

这样访问就会显示html中的内容,更新完成之后删除即可。

参考

https://github.com/dotnet/aspnetcore/issues/52307#issuecomment-1852886535

https://blog.csdn.net/weixin_38304160/article/details/133020599
https://www.cnblogs.com/willick/p/14639682.html
https://learn.microsoft.com/zh-cn/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-8.0
http://haitao.cool/contents/2/10.html
https://www.dongchuanmin.com/net/1331.html
https://blog.csdn.net/weixin_38304160/article/details/133020599
https://www.cnblogs.com/mojie/p/16636498.html

相关推荐
小满zs6 分钟前
Go语言第十四章(文件操作)
后端·go
打工仔折腾 AI6 分钟前
Linux 网络编程:从零掌握 TCP Socket 编程与 C++ 实战落地
linux·网络·人工智能·后端·python·tcp/ip·性能优化
沙蒿同学18 分钟前
Wails v3 实战:一个桌面提醒客户端,从 v2 升到 v3 的全过程
前端·后端·github
aibo86030823 分钟前
基于 Spring Boot + Vue3 的爱心众筹管理系统设计与实现
java·spring boot·后端
SimonKing25 分钟前
OpenCode免费模型直接给`Workbuddy`用,一键导入
java·后端·程序员
我命由我1234527 分钟前
Python 开发 - Python 项目部署(Windows 与 Linux)
java·linux·windows·后端·python·java-ee·python3.11
aibo86030840 分钟前
基于 Spring Boot + Vue3 的餐饮食材采购与成本分析系统设计与实现
java·spring boot·后端
Rain的Java大神之路44 分钟前
面了上百人,我最爱问的LeetCode 1「两数之和」:能背代码的很多,能讲清“先查后存”的没几个
java·后端·算法
aibo8603081 小时前
基于 Spring Boot + Vue3 的菜谱分享网站设计与实现
java·spring boot·后端
凤山老林1 小时前
Spring Boot 集成 TOTP 双因素认证与恢复码机制
java·spring boot·后端