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

相关推荐
焗猪扒饭2 小时前
redis stream用作消息队列极速入门
redis·后端·go
树獭非懒3 小时前
AI大模型小白手册|Embedding 与向量数据库
后端·python·llm
IT_陈寒6 小时前
SpringBoot实战:5个让你的API性能翻倍的隐藏技巧
前端·人工智能·后端
梦想很大很大6 小时前
拒绝“盲猜式”调优:在 Go Gin 项目中落地 OpenTelemetry 链路追踪
运维·后端·go
唐叔在学习6 小时前
就算没有服务器,我照样能够同步数据
后端·python·程序员
用户68545375977697 小时前
同步成本换并行度:多线程、协程、分片、MapReduce 怎么选才不踩坑
后端
javaTodo7 小时前
Claude Code 记忆机制详解:从 CLAUDE.md 到 Auto Memory,六层体系全拆解
后端
LSTM978 小时前
使用 C# 和 Spire.PDF 从 HTML 模板生成 PDF 的实用指南
后端
JaguarJack8 小时前
为什么 PHP 闭包要加 static?
后端·php·服务端