Use T4 Templates to create enumerations from your database lookup tables

15 February, 2014.

T4 (Text Template Transformation Toolkit) has been around for a while now… its been a part of Visual Studio since the 2005 release. In case you don’t know, T4 can be used to automatically generate files based on templates. You create a text template, which is then transformed (interpreted) by Visual Studio into a working file. T4 can be used to create C# code files, and indeed it forms the basis of the current scaffolding templates you have probably used when creating ASP .NET web applications…

Continue reading

Publish your website to an IIS staging environment using Microsoft Web Deploy

08 February, 2014.

One of the simplest and quickest ways to publish your website to a staging environment is, at least in my opinion, using Microsoft Web Deploy. This post is about how you approach this, a future article will discuss why you probably shouldn’t do this. Key points; The remote server should be running Internet Information Services (IIS) 7.0 or later. You can use the Microsoft Web Platform Installer to install all the extra bits you need to make this work. You need to set appropriate permissions to…

Continue reading

Resilient Connection for Entity Framework 6

05 February, 2014.

Disclaimer: I cannot take a shred of credit for the code you are about to see. I simply went over to the Entity Framework source code repository on CodePlex, copied some code, butchered it, hammered it, and rolled it until it fitted nicely into the slot that was my requirements. Please direct your thanks to the Entity Framework team. I had a requirement whereby I needed a resilient Entity Framework connection, and by that I mean a connection that could retry a certain number of times…

Continue reading

How to pass Microsoft Exam 70-486 (Developing ASP.NET MVC 4 Web Applications) in 30 days

01 February, 2014.

Before you continue reading this blog, you need to be aware of the following; This is not a “quick fix” or an “easy solution”. I have not discovered some secret formula to guarantee you pass with 100% marks every time. I am not trying to sell you anything. The exam is genuinely challenging and the only way you are going to pass is by working hard! You will not find any brain dumps here! If you’re afraid of working hard to achieve your goals, you best leave now … Still Here? Congratulations, you…

Continue reading

5 easy security enhancements for your ASP .NET application

26 January, 2014.

Protecting web applications against unauthorised access is somewhat of a dark art, but there are simple steps you can take to ensure that you are protected against the most common security risks. Cross Site Request Forgery (CSRF / XSRF) Problem: Cross site request forgery (CSRF / XSRF) is the process of tricking a legitimate user of your website into posting data to the web server without their knowledge. This type of attack is typically executed using a malicious link in an email, or by social…

Continue reading

10 things every software developer should do in 2014

18 January, 2014.

It is important in the world of software development that every developer re-train and update their skills regularly. Failure to do so will probably result in stagnation and loss of earnings over an extended period.There has been a massive shift over the last few years from development of traditional desktop applications being written in Windows Forms (WinForms) and Windows Presentation Foundation (WPF) to the web and mobile. Open standards, including HTML 5 and CSS 3, have been driving a new…

Continue reading

Check TFS Online service status using C#

10 January, 2014.

If you use TFS Online you may have experienced some unexpected downtime over the last few months. Whilst the service is getting better and better all the time, downtime is still an issue. I have written a little screen scraping tool based on the HTML Agility Pack that will scrape the service status page and report back the current status. Add the following class to your project; The usage for this code is as follows; I hope you find this little helper useful. Please leave a comment below.

Continue reading

15 reasons why I can’t work without JetBrains ReSharper

28 December, 2013.

If you know me personally, you’ll know how much I love JetBrains ReSharper, I use it every day and I swear by it. People often ask me what I like most about it, and here I often stutter. The truth is, there is no one killer reason why I love ReSharper… it’s a combination of many small features that make it a tool I literally cannot work without. I’m going to explain my 15 favourite features, and urge you to give it a try. If you’re still not sold by the end of this, you’re never going to be…

Continue reading

C# Create a custom XML configuration section

21 December, 2013.

It is common when developing either Desktop or Web based applications to need to persist settings in an easily updateable location. Developers often choose to add normal application settings in the form of key value pairs, as shown below, and this is a great approach when you only have a small number of settings. However, as your applications configuration becomes more complicated, this approach soon becomes hard for the developer and end user alike. This blog post looks at how you can create a…

Continue reading