Saturday 31 December 2011

Microsoft Managed Extensibility Framework (MEF)

Managed Extensibility Framework (MEF) is a composition layer for .NET that improves the flexibility, maintainability and testability of large applications. MEF can be used for third-party plugin extensibility, or it can bring the benefits of a loosely-coupled plugin-like architecture to regular applications.


MEF is a part of the Microsoft .NET Framework, with types primarily under theSystem.ComponentModel.Composition.* namespaces.

  • MEF has shipped with .NET 4.0 and Silverlight 4
  • MEF 2 is under development and can be downloaded in source code and binary form from this site

For more information, click here.



Saturday 24 December 2011

Useful Git Terms



  • master: this is the main code branch, equivalent to trunk in Subversion. Branches are generally created off of master.
  • origin: the default remote repository that all your branches are pull'ed from and push'ed to. This is defined when you execute the initial git clone command.
  • fast-forward: the process of bringing a branch up-to-date with another branch, by fast-forwarding the commits in one branch onto the other.
  • rebase: the process by which you cut off the changes made in your local branch, and graft them onto the end of another branch.
  • unpublished vs. published branches: an unpublished branch is a branch that only exists on your local workstation, in your local repository. Nobody but you know that branch exists. A published branch is one that has beenpush'ed up to github, and is available for other developers to checkout and work on.

Thursday 22 December 2011

NuGet Install Castle.Windsor and factilies for NLog or log4net

Install the following Castle packages from NuGet command line.
  1. PM>  install-package Castle.Windsor 
  2. PM>  install-package Castle.Core-NLog 
  3. PM> install-package Castle.Core-log4net
  4. PM> install-package Castle.LoggingFacility

 Notes: that Castle.Core-NLog has the Castle.Facilities for NLog.

Thursday 8 December 2011

Validation of viewstate MAC failed,in hosting on a web farm

If a web application is hosted by a web farm or cluster, you would experience this exception if you didn't set up the web.config correctly. The solution for resolving this exception is to ensure the configuration specifies the same validation key and validation algorithm in every single web.config in your deployment. AutoGeneration by default cannot be used in a cluster environment. Below is the sample machinekey config entry for your web.config
 
<configuration>
    <appSettings/>
    <connectionStrings/>
    <system.web>
        <machineKey  validationKey='44DB9132AD56D581F6DBFDD8F09EDFD167B75283771DB3241804B0F03602EBACF6349C724FAC64785F60653EC9F9CA20A4D377387A1677704525FE9147CE6AC3' decryptionKey='C77E66D32F8F554C507DDEC6DA2A1A470B5EE195DA584EDD' validation='SHA1'/>
    </system.web>
</configuration>