Fabricio Rodriguez
Fabricio Rodriguez

Reputation: 4239

Where is Web.config during development?

When I publish my ASP .Net Core 1.1 MVC web app, I see the Publish folder contain a Web.config file, where I can set stdoutLogEnabled, etc. However, while developing I don't see this file at all - it looks like it's being generated when publishing... How can I therefore set the variables in this file without having to manually edit the file after each publish?

Upvotes: 7

Views: 3528

Answers (1)

Ilya Chumakov
Ilya Chumakov

Reputation: 25019

Web.config only makes sense if you host the app on Windows with IIS. You have to manually add it to the project to edit the file's contents or it will be auto-generated:

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.

Upvotes: 6

Related Questions