Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 598
Fabricio Rodriguez Avatar asked Jun 08 '17 13:06

Fabricio Rodriguez


1 Answers

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.

like image 133
Ilya Chumakov Avatar answered Oct 10 '22 07:10

Ilya Chumakov