1.准备服务器
推荐Windows Server 2022 Datacenter 或 Windows Server 2016 Datacenter
2.安装IIS服务
3.安装.Net8环境
依次安装dotnet-sdk-8.0和dotnet-hosting
4.管理员启动命令行重启IIS
在命令行中先执行 net stop was /y
然后执行 net start w3svc
5.VS2022发布.Net8网站并部署到IIS
6.修改应用的web.config
<modules>
<remove name="WebDAVModule"/>
</modules>
<handlers>
<remove name="WebDAV"/>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" requireAccess="Script" />
</handlers>
7.网站开发的三个好搭档
mariadb-10.3.37-winx64.msi
HeidiSQL_12.8.0.6908_Setup.exe
npp.8.6.8.nstaller.x64.exe
Comments