Tuesday, November 23, 2010

find all listening ports - back to basics

netstat -an |find /i "listening"


open a port from cmd
netsh> add portopening TCP 9353 "xyz"

Monday, November 8, 2010

Eliminate if else statements for disabling and enabling controls

if (count > 0)
{
this.control.Enabled = false;
}
else
{
this.control.Enabled = true;
}



// this is 1 line compared to what we have above.
this.control.Enabled = (count <= 0);

Tuesday, November 2, 2010

DateTime vs DateTimeOffset

if (you are developing applications with globalization in mind)
{
use DateTimeOffset
}
else
{
use dateTime
}

Saturday, October 30, 2010

Security Prompt when trying to call a webhttpbinding service method.

i was working with a webhttpbinding service which was being called from Javascript and which inturn calls a wshttpbinding service, and all of a sudden i was getting a login prompt when i was trying to invoke this new method that i created, after a while i found out that the problem, my datacontracts were not updated, it was missing a new field that i added, once i added this new field, the login prompt went away....

Thursday, October 28, 2010

WCF Performance.

http://webservices20.blogspot.com/2010/10/important-wcf-performance-issue.html and i said WOW....

Tuesday, October 26, 2010

Team Foundation Error The cache file C:\Users\Administrator\AppData\Local\Microsoft\Team Foundation\3.0\Cache\VersionControl.config is not valid and cannot be loaded. Please correct or delete the file.

Fired up my VPC and tried connecting to TFS and i run into this error, i thought i need to setup bindings and working folders again....

*****************************************************************************
The cache file C:\Users\Administrator\AppData\Local\Microsoft\Team Foundation\3.0\Cache\VersionControl.config is not valid and cannot be loaded.

Please correct or delete the file.
*****************************************************************************

The solution was simple get a copy the "VersionControl.config" from your fellow dev on the project and replace it, TFS internally stores all the team members source control setting in this file.

Dll is locked

We had an issue where in our dll was locked and we were unable to delete it, i thought of using processexplorer from sysinternals to look at the process, while downloading it i came across this link
http://blogs.msdn.com/b/winclient/archive/2004/07/08/177947.aspx

and the solution was :
tasklist /m thelocked.dll