[英]Can launchSettings.json be used to enable access-control-allow-origin response headers with IIS Express?
I was hoping to be able to specify CORS related configuration for IIS Express within the launchSettings.json file of my ASP.NET Core application.我希望能够在我的 Z9E0DA8438E1E38A1065B2126Z Express 的 launchSettings.json 文件中为 IIS Express 指定 CORS 相关配置。 I've tried searching for examples, tutorials or documentation related to configuring IIS Express with launchSettings.json but so far have not had much luck with that.我已经尝试搜索与使用 launchSettings.json 配置 IIS Express 相关的示例、教程或文档,但到目前为止还没有太多运气。 This page shows how to configure IIS itself to specify response headers using xml: https://docs.microsoft.com/en-us/iis/extensions/cors-module/cors-module-configuration-reference .此页面显示如何配置 IIS 本身以使用 xml 指定响应标头: https://docs.microsoft.com/en-us/corscors/extensions My ASP.NET Core application targets .NET Core 2.1 currently.我的 ASP.NET Core 应用程序目前针对 .NET Core 2.1。 Thoughts?想法? I'm not sure if this is even possible or if I need to just use regular IIS instead of IIS Express.我不确定这是否可能,或者我是否需要使用常规 IIS 而不是 IIS Express。
No. launchSettings.json
is only honored by dotnet run
and other .NET Core tooling, not by IIS Express. launchSettings.json
仅适用于dotnet run
和其他 .NET 核心工具,而不适用于 IIS Express。
You can switch to full IIS for development, or use the CORS module for IIS upon IIS Express (the actual steps are too complicated without PowerShell scripts written by me ). You can switch to full IIS for development, or use the CORS module for IIS upon IIS Express (the actual steps are too complicated without PowerShell scripts written by me ).
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.