Tuesday, 20 September 2011

How to add a new project to your SVN repository using TortoiseSVN



start from "Step 1. Repository creation. ". If you already have you repo set up go to "Step 2. Initial import."

Tuesday, 30 August 2011

Linked files in Visual Studio 2010

A feature of VS to be able to link between files instead of actually copying them. Read more...


Moq

Mocking library for .NET
What Is Moq?
"Moq is a mocking framework for C#/.NET. It is used in unit testing to isolate your class under test from its dependencies and ensure that the proper methods on the dependent objects are being called" Read more...

Other Moq frameworks for .net 
TypeMock, RhinoMocks, nMock

"Mock objects are simulated objects that mimic the behavior of real objects in controlled ways In a unit test, mock objects can simulate the behavior of complex, real (non-mock) objects and are therefore useful when a real object is impractical or impossible to incorporate into a unit test." Read more on wikipedia

Introduction to Moq
http://code.google.com/p/moq/wiki/QuickStart

Beginning Mocking With Moq 3 – Part 1 to 4
http://www.codethinked.com/beginning-mocking-with-moq-3-part-1

Friday, 26 August 2011

Plug-ins to integrate Subversion with Visual Studion

1 - Visual SVN
http://www.visualsvn.com/

2 - AnkhSVN
http://ankhsvn.open.collab.net/

Domain-Driven Design / Intro

A good introduction article on DDD
http://msdn.microsoft.com/en-us/magazine/dd419654.aspx

The story starts from Plato the famous student of Socrates who proposed
that the concepts, people, places, and things we intuit and perceive with our senses are merely shadows of the truth. He dubbed this idea of a true thing a Form.
To explain Forms, Plato used what's become known as the allegory of the cave. In this allegory, there exists a people that are bound inside a deep, dark cave. These cave people are chained in such a way that they can only ever see a blank wall of the cave that receives light from the opening. When an animal walks by the opening, a shadow is projected onto the interior wall that the cave dwellers see. To the cave dwellers, these shadows are the real thing. When a lion walks by, they point at the shadow of the lion and exclaim, "Run for cover!" But it is really only a shadow of the real Form, the lion itself...Read more about it in the Platonic Model section of the article.



Tuesday, 23 August 2011

Wednesday, 17 August 2011

XML SPY

XML Editor for Modeling, Editing, Transforming, & Debugging XML Technologies http://www.altova.com/xmlspy.html

Friday, 12 August 2011

Working with MSMQ

What is MSMQ?

Microsoft Message Queue Server (MSMQ) is a fast store-and-forward service that enables applications running at different times to communicate across heterogeneous networks and systems that may be temporarily offline.

Applications send messages to queues and read messages from queues. The following illustration shows how a queue can hold messages that are generated by multiple sending applications and read by multiple receiving applications.Read more

Sample Code

This sample requires the installation of Message Queuing. See the installation instructions in Message Queuing
Notes on the WCF code sample

  • You need to add the name of the Queue in the the appSettings
  • Also in the clinent project in the service configs under system.setviceModel in the web.config file you need to add endpoint and bindings

Useful classes
Referencing System.Messaging libarary Message and MessageQueue classes are the ones that is needed.
Message: rovides everything required to define and use an MSMQ message
MessageQueue: provides all the necessary functionality to work with and manipulate MSMQ queues


MSMQ Software Development Kit (SDK)
http://technet.microsoft.com/en-us/library/cc723251.aspx|http://technet.microsoft.com/en-us/library/cc723251.aspx


     
 
   
     
       
         
       
     
   



Friday, 15 July 2011

A cool LINQ to SQL helper tool

LINQPad is a free tool for testing LINQ to SQL statements:http://www.linqpad.net/

Wednesday, 13 July 2011

Web.config Transformation Syntax

http://msdn.microsoft.com/en-us/library/dd465326.aspx

Wednesday, 22 June 2011

Friday, 17 June 2011

Thursday, 16 June 2011

How to activate word wapping in Microsoft Visual Studio

To make sure your code/text is always in the visible space activate word waping in VS IDE:
http://blogs.msdn.com/b/zainnab/archive/2010/02/27/understanding-word-wrap-vstipedit0022.aspx

Friday, 10 June 2011

Where is WCF Test Client (WcfTestClient.exe) on 64 machine?

The WCF Test Client tool can be found here:
C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE

Highlights of Guathon event - London 6th of June

 London developer community ran Guathon a full day event with Scot Guthrie and Steve Sanderson from Microsoft on Monday the 6th.

Highlights:
  • Build an app using ASP.NET MVC 3, EF Code First, NuGet, and IIS by Scott Guthrie
    • New in MVC 4: Intranet application template added to Add new project window
    • EF Code First option: a really nice and clean way to work with data, No need for designer or XML mapping file. Define your class like this: Sample class (Notice that in addition to standard scalar properties, each class has an “association” property. e.g, the “Product” class has a “Category” property that enables you to get access to the Category it belongs to.)
    • Razor the new MVC view engine: Demoed syntax and some of the methods like @RenderBody(), @Renderfooter(), ...
    • modernizer.js : recommended for addig scripts to your html 5 markup so that it can be read in lower browsers.(eg. modernizer.canvas : a method to check if the browser supports canvas.)
    • Glimpse: a neat ASP.NET tool available through nuget - does the same thing for the server-side as firebug does for client-side
  • Dynamic Web UIs with Knockout.js by Steve Sanderson
    • Knockout.js is a JavaScript library that is good for rich client-side interactivity : no overlapping mess of interrelated event handles
    • MVVM pattern: Object oriented java script and declarative bindings
    • Wide browser support and works good with both ASP.NET and JQuery
    • A demo on channel9 if interested : http://channel9.msdn.com/Events/MIX/MIX11/FRM08
  • C#5 and asynchronous Web applications by Steve Sanderson
    • Using a post office metaphor model Steve showed us how traditional web request handeling worked which is thread per request. Then he moved on to Evented web request handling which is asynchronous using a restaurant model. He Showed us how C#5 Async works and how neat an easier is to code multi threading application in C#5. 
    • He also mentioned that using the nuget package SignalR most of the functionalities will be available now.
  • Cloud Development by Scott Guthrie
    • In his first public talk on Cloud computing with Windows Azure after he's been moved to Azure team, Scott talked about Azure platform as an overview and the current tools and services available to build quick cloud applications.
    • He also announced that that Azure service deployments are guaranteed a fixed IP address (this wasn't guaranteed before)
I really enjoyed the event and thanks to DDD team for organising it. I will add links and slides letter on if it is posted by the speakers. (There was a promise to put the sample code for online)




    Monday, 23 May 2011

    Highlights of #UKTechDays 2011 (1st day dev sessions)

    UKTechDays 2011
    Date: Monday, 23 May 2011
    Location: Fulham, London

    I attended 2 sessions under cloud topic and all the sessions except from the very first one (and a half!) under The Web topic.

    For me, the important highlight of the event was to see presenters from outside Microsoft being invited. For Instance, Bruce Lawson Opera evangelist did a 60 minutes presentation on HTML5. Also a weird thing on Azure topic was the amount of marketing material which was stuffed into it; with three companies showcasing their Azure-Based products in length within the first session.

    Highlights on the Azure Sessions:

    ü  A-Z of the Windows Azure Platform by David Gristwood
    ·         Something to have some reading about:
    ·         SQL Azure: Extending SQL server for relational storage for the cloud.
    o    Blob, Table and Queue types new for Windows Azure
    ·         Azure AppFabric : Infrastructure to connect to the cloud that
    o    Connects existing app to the cloud
    o    Connects through network boundaries
    o    Easily control authorization to apps

    Highlights on the Web sessions:

    ü  HTML5 - Who, what, when, why? By  Bruce Lawson (@brucel)
    ·         Very cool features of HTML5
    ü  Web development with HTML5 & Internet Explorer By Martin Beeby (@thebeebs)
    ·         Yes! The same guy who presented on MVC at LBi for the second EPiServer meetup!
    ·         Demo of using html5 video and audio, IE9 canvas and  JQuery
    ·         Also jquery.svg.js was recommended: a useful JS library that wraps the SVG and coding SVG is much easier using it.
    ·         Raphael for Graphs        
    ·         Also some cool tools recommended:
    o    Modernizer: feature detection library for advanced browser features
    o    Mire video converter: For converting video types to each other
    ü  Enhancing sites with Pinning and Internet Explorer by Stephen Kennedy
    ·         On IE9 feature that enables your websites to be pinned on taskbar or start menu
    ·         Details of what classes, methods and properties to be used. (Too much details I would say)
    ·         For more code/demo on pinning enabled sites:  http://buildmypinnedsite.com/
    ü  An introduction to CSS3 for web developers by Rachel Andrew (@rachelandrew)
    ·         Some of the css 3 features
    ü  Getting Tech.Days online by Martin Beeby
    ·         On how MS guys developed the techdays website using Umraco cms and hosted on Windows azure.
    ·         Surprisingly Umraco CMS been promoted and Highly recommended on a Microsoft event
    ü  Getting Productive with ASP.NET MVC v3 (@Stevensanderson)
    ·         Vary useful and informative presentation by Steve Sanderson from Microsoft
    ·         With code demo of 6 items to get the most out of MVC 3
    o    NuGet: Package Managing Console
    o    MvcScaffolding: Command line version of scaffolding.  Scaffolding:  “quickly generating a basic outline of your software that you can then edit and customise”. Reade more : http://blog.stevensanderson.com/2011/01/13/scaffold-your-aspnet-mvc-3-project-with-the-mvcscaffolding-package/
    o    Ninject.MVC3 : Dependency Injection tool
    o    Razor: Updated view engine in MVC3
    o    SQL compact
    o    IISExpress
    ü  Microsoft WebMatrix by Andy Robb
    ·         Open source platform by MS(!) using ASP.NET, MVC, PHP, Razor
    ·         Seems like a very quick platform for those who are new to development to get the site up and running quickly
    ·         Personally I think in practice it can only be used for demo apps or for setting up the platform on the development machine

    Sunday, 22 May 2011

    EPiServer Developer Resources Index

    http://www.frederikvig.com/2010/05/episerver-developer-resources/

    EPiServer File Manager & File Summary

    A useful article about EPiServer File Manager and File Summary by @frederikvig. 


    Highlights:

    Accessing the data:

    var file = System.Web.Hosting.HostingEnvironment.VirtualPathProvider.GetFile("/Global/Images/[Folder Name]/[Image-Name]") as UnifiedFile;
    
    
    "The Summary property exposes a IUnifiedSummary type which gives us access to properties like Author, Comments, Category etc, and more importantly a Dictionary for accessing other properties we create (like Website)."
    
    
    file.Summary.Dictionary["Website"]
    
    

    Simple example of accessing the Summary properties in code:

    <div class="featured">
     <img src="<%= Image.VirtualPath %>" alt="<%= Image.Summary.Title %>" />
     <p>
      <a href="<%= Image.Summary.Dictionary["Website"] %>"><%= Image.Summary.Author %>a>
      <em><%= Image.Summary.Dictionary["Description"]%>em>
     p>
    div>

    Thursday, 21 April 2011

    Are you happy?



     

    If not or you are not sure,
    Take an Action Now:

    Dependency Injection

    I got what Dependancy Injection really is starting from this article:
    http://www.kevinwilliampang.com/2009/11/07/dependency-injection-for-dummies/

    creative and funny pictures by the author as well!

    Wednesday, 16 March 2011

    EPiServer - Creating pages programmatically

    With using DataFactory class and calling GetDefaultPageData method it is so easy to create a new page programmatically. Read more details here:

    Thursday, 17 February 2011

    EPiServer Globalization - Detecting language automatically

    Used this confiuration feature of EPiServe 5.2 to aoutomatically detect the site language based on browser language settings today:

    setting "EPsDefaultLanguageBranch=true " in the config file will do the job. It is also configurable via EPiServer Admin mode.

    find more details here


    Thursday, 6 January 2011

    LINQ to SQL log to debug/output window

    Debugging LINQ to SQL commands in visual studio is much more easier when you can see the equivalent SQL statements in the output window. See the following link to simply set it up:

    http://damieng.com/blog/2008/07/30/linq-to-sql-log-to-debug-window-file-memory-or-multiple-writers

    Wednesday, 5 January 2011

    LINQ to SQL - How to put Connectionstring in web.config

    When you add a LINQ to SQL dataclasses(.dbml file) to the project the connection string is automatically configured for you when your dragging the tables. However in practice you need to take the connection string settings outside the datacontext file and put it the config file. This is useful particularly when you've got the project on different servers (dev, staging). 
    To do this all you need to is:
    1- Open the .dbml file in the designer, right click on somewhere on the blank screen (not on the objects/tables) to open the properties window and update the connection to look like this: 
    And then:
    2- Create a partial class for your dataContext and only a constructor in it:
    public partial class TestDataContext 
     {    
       public TestDataContext () : base(ConfigurationManager.ConnectionStrings["TestKey"].ConnectionString, mappingSource)
        {
        }
      }
    
    3- Update the connection string section in the config file with the new key:

    For more info please refer to the following links: