发布:2023/12/7 15:36:37作者:大数据 来源:大数据 浏览次数:499
一、使用代码修改web.config实现
1 2 3 4 5 6 7 8 9 10 11 |
<?xml version="1.0" encoding="utf-8"?> <configuration> <location path="." inheritInChildApplications="false"> <system.webServer> <handlers> <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /> </handlers> <aspNetCore processPath="dotnet" arguments=".\WebApplication.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" /> </system.webServer> </location> </configuration> |
asp.net core 开启调试模式,
找到Web.config的<system.webServer>下的<aspNetCore .../>结点将末尾
1 |
/> |
替换
1 2 3 4 5 |
> <environmentVariables> <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" /> </environmentVariables> </aspNetCore> |
示例代码如下:
1 2 3 4 5 6 7 8 9 |
<aspNetCore processPath="dotnet" arguments=".\MyApp.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess"> <environmentVariables> <environmentVariable name="ASPNETCORE_ENVIRONMENT" value="Development" /> </environmentVariables> </aspNetCore> |
二、IIS中可视化编辑配置文件
在iis中选中要设置的网站,在右边功能最下部找到配置编辑器并双击打开,在结点system.webServer/aspNetCore中找到environmentVariable点击右边...按钮进行添加键值对,name="ASPNETCORE_ENVIRONMENT" value="Development",详细见下图
© Copyright 2014 - 2024 柏港建站平台 ejk5.com. 渝ICP备16000791号-4