.net-corereleasepublish

Set configuration to "Release" when publishing


I have a project that I'm publishing using the dotnet CLI's dotnet publish command.

Since I only ever publish with a release intent, I'd like to make it so that when I issue a dotnet publish the build and publishing happen with the "Release" configuration but still use the "Debug" inside Visual Studio when I'm debugging/testing.

I know I can manually change the configuration from Visual Studio's configuration/properties window and can specify the -c Release argument but is there some tag I can include in my .csproj file that says "when publishing use 'Release' by default"?


Solution

  • There is an opened issue regarding this here.

    You may check it, specially this @nguerrera comment.