Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET Core Web.Config publish

When publishing a .Net Core app to a server via WebDeploy, a Web.Config file is created, with stdoutLogEnabled=false. This is overwriting the web.config on the server where I have set stdoutLogEnabled=true.

I struggling to find how I set the default value of stdoutLogEnabled prior to publishing. On .Net framework apps I would do this within the web.config file with transformations, however in .Net core I actually don't have a web.config file within my solution.

I've tried to find documentation on how to set the value, but it either doesn't exist, or more likely, I'm not using the correct search term. Can somebody please advise on how to set default values in the web.config.

like image 539
Dave0504 Avatar asked Dec 24 '18 13:12

Dave0504


People also ask

Can we use Web config in ASP.NET Core?

The web. config file has also been replaced in ASP.NET Core. Configuration itself can now be configured, as part of the application startup procedure described in Startup.

Where is the web config file in ASP.NET Core?

config file location. In order to set up the ASP.NET Core Module correctly, the web. config file must be present at the content root path (typically the app base path) of the deployed app.

Where is Web config file in Visual Studio 2022?

config file is located in the %SystemRoot%\Microsoft.NET\Framework\%VersionNumber%\CONFIG\ folder.


1 Answers

Create a web.config and put it the root directory of your source, Modify the web.config file to enable logging and any other customization you need.

When you publish, it’ll use that file instead of generating a completely new file.

like image 143
Kyle Dodge Avatar answered Sep 21 '22 10:09

Kyle Dodge