Add Role attribute to MVC3 methods only in Release mode?
问题 Is it possible to add an [Authorize(Roles="Admin")] (as an example) to an MVC3 Controller Method but ONLY in Release mode? The Test environment I have access to at the moment has no AD, but Live does - so I'd like to add the attribute only in release mode. EDIT: Problem when using #if using... using... using MyWebsite.Helpers; namespace MyWebsite.Controllers.Admin { #if !DEBUG [RedirectAuthorize(Roles = "Admin")] #endif [DatabaseDependant] public class AdminController : Controller { ... } As