Neet trick to make sure your sotware is getting released properly

At work we've had a few problems with different people doing releaes, not knowing that they need to change certain settings to put things in release mode etc.

So in light of this, instead of pointing fingers and saying "YOU DID IT WRONG" in a mean commanding voice that strikes fear into the hearts and toes of everyone that hears it... we did the following:

 

        protected void Page_Load(object sender, System.EventArgs e)

        {

            Initialize();

 

            if (!Page.IsPostBack)

            {

#if DEBUG

    pnlDebug.Visible = true;

#endif

 

 

                CustomErrorsMode cemRemoteOnly = ((CustomErrorsSection)((Configuration)WebConfigurationManager.OpenWebConfiguration("~/Web.config")).GetSection("system.web/customErrors")).Mode;

                if (cemRemoteOnly != CustomErrorsMode.RemoteOnly)

                {

                    pnlRemoteOnly.Visible = true;

                }

                LoadData();

            }

        }

And...

<asp:Panel CssClass="Inline" ID="pnlDebug" style="text-align:center;" runat="server" Visible="false" >

   <h1>DEBUG MODE - ON</h1>

   <asp:Image runat="server" ImageUrl="~/Images/bug.png" AlternateText="Bug"/>

   <asp:Literal ID="litAssembly" runat="server" />                          

</asp:Panel>

<asp:Panel runat="server" ID="pnlRemoteOnly" Visible="false" CssClass="Inline" >

   <img src="Images/MrT.jpg" style="margin:auto;" />

</asp:Panel>

 

Which will produce the lovely:

 

Now... isn't that way better than going to your co-worker and telling them to re-do it? This way the QA Department can do that.

Cheers.

No Comments