Site hosting news, tutorials, tips, How Tos and more

Archive for October, 2013


Configuring Elmah on Winhost

howto

Prompted by a forum post, here are instructions on how to install Elmah, an application-wide Error Logging Module and Handler for ASP.NET on your hosting account here at Winhost.  First, you’ll need to download Elmah at this link.  For this tutorial, I downloaded ELMAH-1.2-sp2-bin-x64.zip.

ElmahHomePage

After you have downloaded the .zip file, extract its contents.  Open the /bin directory and find the .NET Framework libraries you want to use.  Most likely you will be using the assemblies in the net-2.0 -> Release folder.  Upload only the Elmah assemblies (i.e. Elmah.dll, Elmah.pdb, and Elmah.xml) to the /bin folder of your web application.

ElmahAssemblies

You can configure Elmah to store the exception information in different types of databases, but for this tutorial, I will only be showing you how to set it up with Microsoft SQL Server.  If you don’t have a database setup already, follow these instructions to create one:

1) Log into the Winhost Control Panel at https://cp.winhost.com
2) Click on the Sites tab.
3) Click on the Manage link next to the site you want to manage.
4) Click on the MS SQL Manager button.
5) Click on the Add button.
6) Select the database version in the drop down list, name the database, set the quota, and then click on the Create button.

Then log into your database using SQL Server Management Studio.  Select File -> Open -> File… (or hit CTRL-O) and navigate to the /db directory of your Elmah extracted files.  Select the SQLServer.sql file and click on Open.

SQLScript

Hit F5 to execute the script.  This will create the error logging database objects in your database.  The final step is to configure your web.config file.  The configuration will depend on what type Application Pool Pipeline mode you use.  For Classic mode, add the following XML markup to your web.config file to enable Elmah, only substituting Winhost_Database_Connection_String with your actual database connection string.

<configuration>
  <configSections>
    <sectionGroup name="elmah">
      <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
      <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
      <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
      <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
    </sectionGroup>
  </configSections>
  <elmah>
    <security allowRemoteAccess="yes" />
    <errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="Elmah" />
  </elmah>
  <connectionStrings>
    <clear />
    <add name="Elmah" connectionString="Winhost_Database_Connection_String" />
  </connectionStrings>
  <system.web>
    <httpHandlers>
      <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
    </httpHandlers>
    <httpModules>
      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
    </httpModules>
  </system.web>
</configuration>

For Integrated mode, use the following XML markup:

<configuration>
  <configSections>
    <sectionGroup name="elmah">
      <section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
      <section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
      <section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
      <section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
    </sectionGroup>
  </configSections>
  <elmah>
    <security allowRemoteAccess="yes" />
    <errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="Elmah" />
  </elmah>
  <connectionStrings>
    <clear />
    <add name="Elmah" connectionString="Winhost_Database_Connection_String" />
  </connectionStrings>
  <system.webServer>
    <handlers>
      <add name="Elmah" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah"/>
    </handlers>
    <modules>
      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
      <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
    </modules>
  </system.webServer>
</configuration>

You can find your Winhost database connection string by:

1) Log into the Winhost Control Panel at https://cp.winhost.com
2) Click on the Sites tab.
3) Click on the Manage link next to the site you want to manage.
4) Click on the MS SQL Manager button.
5) Click on the Manage link next to the database you want to manage.

The connection string information will appear at the bottom.  Remember to replace the ****** in the password section with your actual database password.  If you have forgotten it, use the Edit link next to Database Password to change it.  If you need more details on other Elmah settings, refer to the sample web.config file in the /samples directory.

That’s it!  Elmah is now configured to trap exceptions from your web application.  It also comes with some sample reporting pages in the /samples/Demo directory which you can upload to review the errors trapped.

ElmahSamples



Change is afoot


announcements

On November 11th, 2013 we are introducing some plan changes. Check your email for details. To summarize what’s happening:

Quota increases!

These increases will take place automatically on November 11th.

whatsnew

Changes to payment plans and prices

In order to make the plan changes, we are updating the pricing and payment options. You can find details in the plan change email.

While the quarterly and yearly payments will increase slightly, we have introduced a new two-year payment option that allows you to pay as little as $3.95 per month for the Basic plan. Even less than the old price.

The two-year payment option applies to every Winhost plan, so no matter which plan you use, you can decrease your monthly price by up to 20% by choosing the new two-year payment option.

And you can make the switch right now in Control Panel, before the new quotas and pricing go into effect on November 11th.

As we mentioned in the email, the price increase was a difficult decision for us. We never want to increase prices, but we want to continue to make improvements to the hosting services, and this will allow us to do that.

We hope the two-year payment option – which actually lowers current prices – and the quota increase will help ease the transition for some of you.



Google Checkout retiring November 11


announcements

Google announced that they would be closing Google Checkout over a year ago, but now they have announced the date when the service will close permanently; November 11, 2013.

If you use Google Checkout on your site they have a FAQ to help you transition to another system.

Google-Checkout