gpt4 book ai didi

asp.net-core - 开发过程中 Web.config 在哪里?

转载 作者:行者123 更新时间:2023-12-03 14:26:57 25 4
gpt4 key购买 nike

当我发布 ASP .Net Core 1.1 MVC Web 应用程序时,我看到 Publish 文件夹包含 Web.config文件,我可以在其中设置 stdoutLogEnabled等。但是,在开发过程中,我根本看不到此文件 - 看起来它是在发布时生成的...因此,我如何设置此文件中的变量而不必在每次发布后手动编辑文件?

最佳答案

Web.config仅当您使用 IIS 在 Windows 上托管应用程序时才有意义。您必须手动将其添加到项目中以编辑文件的内容,否则它将自动生成:

Documentation:

If you don't have a web.config file in the project when you publish with dotnet publish or with Visual Studio publish, the file is created for you in published output. If you have the file in your project, it's transformed with the correct processPath and arguments to configure the ASP.NET Core Module and moved to published output. The transformation doesn't touch IIS configuration settings that you've included in the file.

关于asp.net-core - 开发过程中 Web.config 在哪里?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44437186/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com