1.下载dotnet-hosting-6.0.0-rc.1.21452.15-win.exe并安装,成功后检查iis模块中是否有aspnetcoremodulev2
2.安装vs时选择“开发时iis支持”
3.在iis中创建站点,目录指向开发项目wwwroot的上级目录,应用程序池默认与站点名称相同
4.将刚新建站点的应用程序池的.net clr版本改成无托管代码
5.在项目启动配置文件中添加配置(也可在项目属性调试中配置)
{ "iisttings": { "windowsauthentication": fal, "anonymousauthentication": true, "iis": { "applicationurl": "http://xxx.xxxx.com", "sslport": 0 } }, "profiles": { "iis": { 明列子的功效"commandname": "iis", "launchbrowr": true, "environmentvariables": { "aspnetcore_environment": "development" } } }}
6.在项目中添加web.config
<?xml version="1.0" encoding="utf-8"?><configuration> <location path="." inheritinchildapplications="fal"> <system.webrver> <handlers> <add name="aspnetcore" path="*" verb="*" modules="aspnetcoremodulev2" resourcetype="unspecified" /> </为梦想启航handlers> <aspnetcore processpjingle bells英文歌词ath="bin\debug\net6.0\web.exe" stdoutlogenabled="fal" stdoutlogfile=".\logs\stdout" hostingmodel="inprocess" arguments=""> <environmentvariables> <environment队章variable name="aspnetcore_environment" value="development" /> </enviro小学写人作文nmentvariables> </aspnetcore> </system.webrver> </location></configuration>
到此这篇关于使.net6在开发时支持iis的文章就介绍到这了。希望对大家的学习有所帮助,也希望大家多多支持www.887551.com。
本文发布于:2023-04-04 12:36:48,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/ba1f6c5f9f0a9804d7b1ec9e8345304d.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:使.NET6在开发时支持IIS.doc
本文 PDF 下载地址:使.NET6在开发时支持IIS.pdf
留言与评论(共有 0 条评论) |