Friday, 27 September 2013

SilverLight RESTing on Windows Communication Foundation (WCF)


1. Build the WCF service
A few things to keep in when building the service using REST:
a. Use the WebHttpBinding to expose the service

b. Use appropriate [WebGet] and [WebInvoke] attributes on operations of your service contract

Monday, 5 March 2012

Visual studio 2010 - very slow access to TFS 2008

I've been using Visual Studio 2010 to access TFS 2008 since a while and it has always worked fine until recently where network administrators of my company deployed a new web proxy.

Since then, Visual studio took an awful amount of time to access and retrieve source code from TFS.

After a quick search on the Internet, I found the solution:
http://social.msdn.microsoft.com/Forums/da-DK/tfsversioncontrol/thread/cec1cda4-93ac-404a-96a0-6c45910325ce
To correct the problem, I modified the configuration file of Visual Studio by adding the following line to the System.net section:

defaultProxy enabled="false"

After modification, the System.Net section looked like this:

Wednesday, 23 November 2011

Useless comments, useful clean-up

I guess all seasoned developers have come across code containing useless comments.

Some comments are so obvious that they don't deserve their existence in code and when they exist, they are nothing but code pollution.

Examples:
Code Snippet
  1. // Stored procedureName <-- Useless & too obvious comment. Even my grandma could tell that this is a constant storing a stored procedure name
  2. const string storedProcedure = "GetSoftwareArchitectsByCountry";

Code Snippet
  1. // Parameters for the stored procedure <--Useless & too obvious comment
  2. database.AddInParameter(command, "ExecutionCountryId", DbType.Int32, executionCountryId);

Useless comments cause code pollution (too many lines of "code") and require code cleanup which in turns requires time and I think we all agree that time is money. So dear developers don’t waste your effort in writing useless comments… use this time to do other useful things ;)

Cheers,
Shah MOHAMOD