To change the checkout page URL from HTTP to HTTPS (SSL) I am using:
#if !DEBUG
[RequireHttps]
#endif
The problem is that the page is not redirected from HTTP to HTTPS.
But when I removed the #if statement and use only [RequireHttps], then the page successfully redirected to HTTPS.
I am still developing the site so I want to keep it #if statement.
What could it be?
Don’t confuse the ASP.NET debug setting (in Web.config) with the C# debug mode setting (in Solution Configuration). They are entirely different, and one does not affect the other.
#if !DEBUGis controlled by the Solution Configuration, not the ASP.NET / Web.config debug mode and must be changed before compiling your code.