.net8 aspire 启动不用https 报ASPIRE_ALLOW_UNSECURED_TRANSPORT故障

故障显示

System.AggregateException:“One or more errors occurred. 
(The 'applicationUrl' setting must be an https address
unless the 'ASPIRE_ALLOW_UNSECURED_TRANSPORT' environment variable is set to true.
This configuration is commonly set in the launch profile.
See https://aka.ms/dotnet/aspire/allowunsecuredtransport for more details.)”

   方式1 通过设置环境变量不适用https

unix系统输入:

export ASPIRE_ALLOW_UNSECURED_TRANSPORT=true

 

windows系统 powershell输入:

$env:ASPIRE_ALLOW_UNSECURED_TRANSPORT = "true"

方式2 :启动配置文件设置如下参数

 "ASPIRE_ALLOW_UNSECURED_TRANSPORT": "true"

 效果:

 

posted @ 2024-06-11 11:05  JohnnyLei  阅读(357)  评论(0)    收藏  举报