While app is in "Release" in compilation build configuration I am trying to publish an app into "Preprod" build configuration. (Right click project in Project Explorer/ Properties / Build / Select "Preprod" as in screenshot) When I check the published published app, it is published as per "Release" configuration. Also Active seems as "Release" configuration in 2nd screenshot. It seems it has no effect whatever I choose in publish build configuration. Is there a setting that I should do to publish app in a different build configuration than compilation build config?
It seems like there's some confusion between the build configuration and the publish target.
Build configuration (e.g., Debug, Release, or in your case, Preprod) refers to how your project is compiled, optimizing for either debugging or release performance, or in your case, for a custom configuration like Preprod. Publishing refers to the process of packaging your application for deployment, which happens after the build process but doesn't inherently change the build configuration.
To ensure you have the desired build configuration (e.g., Preprod), do it:
In Visual Studio, at the top of the window (next to the green run button), you'll find a dropdown listing the active build configuration (Debug, Release, etc.). The one you highlighted with yellow on top. Change that dropdown to your desired build configuration, in your case, Preprod. It's important to note that if you don't change the build configuration using this dropdown, the configuration in the Project Properties (under Build settings) will always revert to the active configuration (e.g., Release in your case). So even if you set "Preprod" in the Properties, the build will use the configuration selected in the dropdown unless you explicitly change it.