Wednesday, August 17, 2011

Search a string across all projects under Team Foundation Server.

TFS2008 Tools do not have a find-in-files function. But there is a Windows program with this functionality posted on CodePlex. I just installed and tested this and it works well.
for more information please check CodePlex.

Monday, August 8, 2011

c# Windows Service not appearing in services list after install

Many times user create a windows service and add installer to it, but when user try to install, it will installed successfully but dosn't appear in service list.

use the below mentioned steps to find a best solution:

Add a custom action to the setup project.

1.In Solution Explorer, right-click the setup project, point to View, then choose Custom Actions. The Custom Actions editor appears.

2.In the Custom Actions editor, right-click the Custom Actions node and choose Add Custom Action. The Select Item in Project dialog box appears.

3.Double-click the application folder in the list box to open it, select primary output from MyNewService (Active), and click OK. The primary output is added to all four nodes of the custom actions � Install, Commit, Rollback, and Uninstall.

4.Build the setup project.

Thursday, August 4, 2011

Show server time in client application

Sometime client requirement is to show server time in client application, There are two options to complete this task.
1) Read server Date and Time and do postback with timer.
2) Read Server Date and Time and use Javascript to maintain right date and time.

Expamle:

<script type="text/javascript">
var currenttime = '<%#Session["ServerDateTime"]%>';
var montharray = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
var serverdate = new Date(currenttime)

function padlength(what) {
var output = (what.toString().length == 1) ? "0" + what : what
return output
}

function displaytime() {
serverdate.setSeconds(serverdate.getSeconds() + 1)
var datestring = montharray[serverdate.getMonth()] + " " + padlength(serverdate.getDate()) + ", " + serverdate.getFullYear()
var timestring = padlength(serverdate.getHours()) + ":" + padlength(serverdate.getMinutes()) + ":" + padlength(serverdate.getSeconds())
document.getElementById("servertime").innerHTML = datestring + " " + timestring
}

window.onload = function () {
setInterval("displaytime()", 1000)
}

</script>

Split the String values with a special character in MS Flow to convert this into Array

 Many times we have a requirement to prepare the Mailing address for some of the documents, suppose there are Address Line1, Address Line2, ...