Disabling NuGet Package Restore

You’ve enabled NuGet Package Restore and want to reverse that decision? Follow the steps below for every csproj in your solution:

  • Close down the solution
  • Delete the .nuget folder on the solution level
  • Open up each csproj in a text editor
  • Find the following XML tags and delete them:
<Import Project="$(SolutionDir)\.nuget\nuget.targets" />  
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">  
      <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
    <Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />

EPiServer 7.5 – Exception – More than one content model is assigned to the guid

When running an EPiServer site and you get the exception “More than one content model is assigned to the guid”. This is usually because you’ve changed a namespace.

There will be a reference to the old namespace cached somewhere so do the following:

1) Clear your bin folder

2) Clear the ASP.NET Temporary files folder under the framework version your project is using

AngularJS – Why?

Why Angular?

AngularJS is written in Javascript and is a HTML compiler. It was written by developer, Misko Hevery who originally built AngularJS as a solution for building HTML components with functionality. It is now a fully fledged open source framework. It allows you to build complete applications.

It is very easy to learn and you will find a team of developers will quickly get up to speed. It is extremely popular and backed by Google so there are plenty of blogs, solutions and discussions out there.


Angular reduces time building an application compared to other mvc frameworks and thus saves money.

Two way binding is one of the most important features Angular provides. It enables real time updating of a model as soon as the variable binded to the scope is changed.

Similiar to jQuery, Angular allows you to write code on a higher level than as if you were writing raw Javascript.

Accessibility and locality is also supported. The ngAria module automatically makes most of your site accessible.

Currency, Dates and Number data types are localized out of the box. For the String data type, you will have to manage locals yourself. There are several 3rd party libraries out there that can help you with this.

Testing is what angular is all about. There are several frameworks created by the team at Google that allows you cover all aspects of testing. ngMock is used for unit testing, Protractor is used for end to end testing and Karma is an automation test tool.

AngularJS 1.4 – Declaring a Controller

I’ve been following a few tutorials that describe declaring a MainController. However the tutorials a pre AngularJS 1.3x and are no longer valid. Previous AngularJS allowed you to define a controller globally . As of 1.3x this is no longer the case and you must declare your Controllers inside angular modules. Here’s an example:

var githubViewerApp = angular.module('githubViewer', []);

Declare a new module and give it a unique name. Then assign module to a variable.

var MainController = function MainController($scope, $http) { }

Create your MainController. This is where all your functions and service calls will sit.

githubViewerApp.controller("MainController", ['$scope', '$http', MainController]);

Now bind the MainController variable to the module variable. The variables with $ signs are included in the function parameters to help support minification. Without this minifiers would rename the variable and angular would be unable to bind the parameters to the view.

Javascript – Revealing Module Pattern

This Javascript pattern allows you to define a piece of code with a private scope but have it accessible with a public method. Easy to implement and simple to understand.
var createWorker = function() {</code>

var task1 = function() {

var task2 = function() {

return {
job1: task1,
job2: task2

var worker = createWorker();

<code>task1</code> and <code>task2</code> functions are confined to the scope of the <code>createWorker</code> function.

In order to make them public to the outside scope, the <code>return<code> method ties public accessors to the inner scoped functions.</code></code>

<code>worker.job1();</code> calls job1

Web Performance – IIS GZip Compression

There’s nothing like performance tuning your website and watching benchmarks better themselves. Sometimes it can be tricky but fortunately this is one of the easier fixes. YSlow and Chrome Dev tools recommend gzip compression and you are looking at around a 70% reduction in file size for your static and dynamic resources. Great! So how do we do it?

First of all this blog post applies to IIS7 and above. IIS7 has Dynamic Content Compression un-installed so install it by heading to Windows Features.


In your solution, add the following config to your web.config:

<urlCompression doDynamicCompression="true" />

You can check your dynamic content is now being compressed with gzip by looking at the response header in fiddler, firebug or chrome developer tool:


New Marie Curie ‘In Your Area’ Search Functionality

For the past two weeks here at Marie Curie we’ve been working on new functionality for searching for Marie Curie services across the United Kingdom. It has just today finally gone live and now we can serve our supporters with better information about the key services and events in their area.

‘In Your Area’


On launch we have included the following:

  • Fundraising Groups
  • Fundraising Offices
  • Marie Curie Shops
  • Marie Curie Hospices
  • Events we run

Results are ordered by distance from the location you have entered and can be navigate by either the result list of the result map. Clicking on a result item on one result section, highlights it’s twin in the other.

The page is also fully responsive allowing you to view the search results and map as separate views.


Click here to go to the live search