<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9108944828477346591</id><updated>2012-01-03T10:02:39.532Z</updated><category term='Personal'/><category term='C#'/><category term='Team Foundation Server'/><category term='ASP.Net'/><category term='Microsoft .Net'/><category term='Technology'/><category term='Microsoft MVC framework'/><category term='Visual Studio 2010'/><category term='InfoPath'/><category term='Google Chrome OS'/><category term='SQL Server'/><category term='MsBuild'/><title type='text'>Hamid Shahid's Notes</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>33</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-7891984057714604182</id><published>2010-08-26T15:26:00.001+01:00</published><updated>2010-08-26T15:28:30.351+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Events vs Delegates in C#</title><content type='html'>Today, somebody asked me to explain the difference between an event and a delegate in C#. Despite using the language for a long time now, I was quite taken back by the fact that   couldn't describe the exact difference. The only thing I knew was that one need to define a delegate to declare an event.&lt;br /&gt;&lt;br /&gt;A bit of searching took me to this very well explained post on the subject &lt;a href="http://blog.monstuff.com/archives/000040.html"&gt;http://blog.monstuff.com/archives/000040.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;To sum it all up, an Event is actually a modifier on delegate i.e. makes it more restrictive. The main differences are&lt;br /&gt;&lt;br /&gt;1) Event can be used in an interface definition while a delegate cannot be used.&lt;br /&gt;&lt;br /&gt;2) Event can only be invoked from the class that declares it, while delegates can be invoked from child classes and clients.&lt;br /&gt;&lt;br /&gt;3) Event comes with it's pair of &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_0"&gt;accessor&lt;/span&gt;s i.e Add and Remove. An event is always assigned and unassigned with a += and -= operator.&lt;br /&gt;&lt;br /&gt;4) Event has a restrictive signature and must always be of the form Event (object source, &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_1"&gt;EventArgs&lt;/span&gt; &lt;span class="blsp-spelling-error" id="SPELLING_ERROR_2"&gt;args&lt;/span&gt;)&lt;br /&gt;&lt;br /&gt;Well, you learn something new everyday...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-7891984057714604182?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/7891984057714604182/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=7891984057714604182' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/7891984057714604182'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/7891984057714604182'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2010/08/events-vs-delegates-in-c.html' title='Events vs Delegates in C#'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-895602754529755916</id><published>2010-06-17T15:01:00.000+01:00</published><updated>2010-06-17T15:17:27.863+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><category scheme='http://www.blogger.com/atom/ns#' term='InfoPath'/><title type='text'>RegForm Tool and Visual Studio</title><content type='html'>&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: arial;"&gt;If you have used Microsoft InfoPath to create electronic forms, you would no doubt be familiar with the Regform tool. The tools is a command line utility that allows you to &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: arial;"&gt;Automatically make a backup copy of the form template&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: arial;"&gt;Make the necessary changes to the .xsf file and XML template file to make the form fully trusted&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: arial;"&gt;Update the version number of the form template&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: arial;"&gt;Package the files in the .xsn CAB file format&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: arial;"&gt;Create a custom installation program for installing the fully trusted form&lt;/span&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: arial;"&gt;        &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Now,  the RegForm uses Microsoft Visual Studio 2005 (Visual Studio 8) to create the installer and won't work if you have Visual Studio 2008 or Visual Studio 2010 installed on your machine. Well,  there is a heck around it. The following registry setting contains the path to the latest version of visual studio installed on your machine&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family: arial;"&gt;HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\devenv.exe&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;If you change the setting from "%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" or "%ProgramFiles%\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe" to "%ProgramFiles%\Microsoft Visual Studio 8\Common7\IDE\devenv.exe", assuming you have visual studio 2005 installed on your machine, the RegForm tool would work correctly.&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-895602754529755916?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/895602754529755916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=895602754529755916' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/895602754529755916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/895602754529755916'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2010/06/regform-tool-and-visual-studio.html' title='RegForm Tool and Visual Studio'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-1444749127986476956</id><published>2010-04-29T17:58:00.004+01:00</published><updated>2010-04-29T18:03:56.304+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><category scheme='http://www.blogger.com/atom/ns#' term='MsBuild'/><title type='text'>Missing Reference name while building with Team Build</title><content type='html'>I recently spent quite a lot of time, uncovering this rather bizarre looking error in our Team Build. We start getting it when I moved one happy perfectly working build from a TSF 2008 build agent running to a new TFS 2010 Build agent. As soon as I ran the build on the new server, I start getting an error in one of the projects&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;Class1(14,27): error CS0234: The type or namespace name 'Class1' does not exist in the namespace 'namespace1' (are you missing an assembly reference?)&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;Tried the same build in the original Build agent and it did built without any problems. Ran the build again with diagnostics log. From the log files I spotted that where my project was getting compiled using Csc.exe , it didn’t include reference to a project. So, I checked again where the project being reference was getting built and yes it was. Also, it was built before the project what was referencing it. So on the face of it everything looked good. But it won’t still build!&lt;br /&gt;&lt;br /&gt;Next thing was to try building the solution manually using MSBUILD. So wrote something like&lt;br /&gt;&lt;br /&gt;   &lt;blockquote&gt;Msbuild.exe mysolution.sln&lt;/blockquote&gt;It ran successfully without a hitch. Now, it was getting interesting. But hang on Team Build does use Multi-processor support while invoking msbuild. So, ran msbuild again with a /m switch&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;    Msbuild.exe /m mysolution.sln&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;Here we go, I got exactly the same problem. So the build work fines when someone is compiling using one processor but not with multi-processor. So, what happened there?&lt;br /&gt;&lt;br /&gt;With some support from Microsoft Visual Studio support team, found that it could be a problem that that path of the project file was too long. So looked back and yes it was. The path of the project that the other project was referencing was 262 characters. Reduced the path length by reconfiguring my build agent to build on a shorter named base directory and bang it worked correctly.&lt;br /&gt;&lt;br /&gt;So, if you hit by this problem that a build doesn’t work when maxcpucount is greater than one, do check your path lengths.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-1444749127986476956?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/1444749127986476956/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=1444749127986476956' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/1444749127986476956'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/1444749127986476956'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2010/04/missing-reference-name-while-building.html' title='Missing Reference name while building with Team Build'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-3003127020168379307</id><published>2010-04-19T17:35:00.002+01:00</published><updated>2010-04-19T17:45:05.293+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio 2010'/><title type='text'>TF215097: An error occured while initializing a build</title><content type='html'>&lt;span style="font-size:100%;"&gt;Since, I spent a significant amount of time resolving this issue while moving our team project and builds from TFS 2008 to TFS 2010, I thought to write it down in my blog so that anyone stuck in the same quagmire might find some help.&lt;br /&gt;&lt;br /&gt;We have been looking to leverage some exciting new features in TFS 2010 and team build in our project so when the RTM release was issued last Monday we decided to make the move instantly.&lt;br /&gt;&lt;br /&gt;The migration process is simple, straight forward and well-documented. I must give it to Microsoft who has done tremendous work to make the whole installation process much simpler and a far cry from early days of TFS 2005.&lt;br /&gt;&lt;br /&gt;Once installed, I followed the configuration wizard to upgrade my projects, which went pretty smoothly as well. The last block in the puzzle was to make Team build to work. So, I disabled the build service of TFS 2008 and installed TFS 2010 build service on our build machines. The wizard picked up existing build agents and created a Build Controller and Build agent for me. Ran the build and bang it all worked.&lt;br /&gt;&lt;br /&gt;I ran the built again and got the following error&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;&lt;/span&gt;&lt;blockquote style="color: rgb(255, 0, 0);"&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;TF215097: An error occured while initializing a build for build definition \Gateway2.0\2.7_Gateway. There was no endpoint listening at http://ggtfs26build1.9191/Build/v3.0/Services/Controller/21 that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;Confused as to why it worked the first time around and not second time, I looked in to the properties of the build controller where it failed. Clicked the Test Connection button and it worked correctly. Tried the build again and got the same error. Finally, after restarting my build agents and build controllers and my TFS collections I was able to do a build again only for it to fail again.&lt;br /&gt;&lt;br /&gt;After talking to a few people in the Microsoft Visual Studio team, got to know that there are two methods &lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;TestConnection&lt;/span&gt;&lt;span style="font-size:100%;"&gt; and &lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;StartBuild&lt;/span&gt;&lt;span style="font-size:100%;"&gt;. While the TestConnection method always succeeded the StartBuild would fail.  After running some traces on my TFS server, they found that the calls to StartBuild, which goes directly through w3wp.exe succeed but if they are called via TFSJobAgent, it won’t succeed, and since the call to TestConnection always go through w3wp.exe, it always succeeded.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The innerException on my build machine suggested that the proxy could not be resolved. So, I changed my internet connection settings, restarted my TFSJobAgent service and ran a build. Again, the build ran fine the first time around but failed in the second go. Though, it did not resolve the issue but helped to identify that the exception is coming in from the Job Agent service.&lt;br /&gt;&lt;br /&gt;The next step was to enable tracing in TFSJobAgent service. You can do that by going to the C:\Program Files\Microsoft Team Foundation Server 2010\Application Tier\TFSJobAgent directory and add the following within the listeners tag in&lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt; &amp;lt;System.Diagnostics&amp;gt; section&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote style="font-style: italic; color: rgb(51, 51, 255);"&gt;&lt;span style="font-size:100%;"&gt;&amp;lt;add name="myListener" type="System.Diagnostics.TextWriterTraceListener"  initializeData="C:\logs\jobagent.log" /&amp;gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;&lt;br /&gt;Also, change the value from 0 to 4 in each of the switches. My System.Diagnostics section looked like this&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:100%;"&gt;  &lt;span style="color: rgb(51, 51, 255);"&gt;&amp;lt;system.diagnostics&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    &amp;lt;trace autoflush="false" indentsize="4"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      &amp;lt;!--To enable tracing to file, simply uncomment listeners section and set trace switch(es) below.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;          Directory specified for TextWriterTraceListener output must exist, and job agent service account must have write permissions. --&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      &amp;lt;listeners&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;        &amp;lt;add name="myListener" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;          type="System.Diagnostics.TextWriterTraceListener" &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;          initializeData="C:\logs\jobagent.log" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;        &amp;lt;remove name="Default" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      &amp;lt;/listeners&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    &amp;lt;/trace&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    &amp;lt;switches&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      &amp;lt;!--  Trace Switches&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;            Each of the trace switches should be set to a value between 0 and 4, inclusive.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;              0: No trace output&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;              1-4: Increasing levels of trace output; see Systems.Diagnostics.TraceLevel--&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      &amp;lt;add name="API" value="4" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      &amp;lt;add name="Authentication" value="4" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      &amp;lt;add name="Authorization" value="4" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      &amp;lt;add name="Database" value="4" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      &amp;lt;add name="General" value="4" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;      &amp;lt;add name="traceLevel" value="4" /&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;    &amp;lt;/switches&amp;gt; &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 51, 255);"&gt;   &amp;lt;/system.diagnostics&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;Restarted the service and check the entries in the job agent. After a few minutes, the following error appeared in the log file&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-style: italic; color: rgb(255, 0, 0);font-size:85%;" &gt;[Error, PID 3916, TID 6784, 13:29:49.002] Exception:  {&lt;br /&gt;Exception Message: Team Foundation services are not available from server http://&lt;oldtfsserver&gt;:8080/VSTSCI/WebServices/notifyservices.asmx?proj=7fd3fa6a-33bb-4ec8-8cfd-9e6a9cc59015.&lt;br /&gt;Technical information (for administrator):&lt;br /&gt;Unable to connect to the remote server (type TeamFoundationServiceUnavailableException)&lt;br /&gt;&lt;br /&gt;Exception Stack Trace:    at Microsoft.TeamFoundation.Client.TeamFoundationClientProxyBase.CreateSoapRequest(String methodName, HttpWebRequest&amp;amp; request, XmlWriter&amp;amp; requestXml)&lt;br /&gt; at Microsoft.TeamFoundation.JobService.Extensions.Core.TeamFoundationNotificationClient.Notify(String eventXml, String tfsIdentityXml, Subscription subscription)&lt;br /&gt; at Microsoft.TeamFoundation.JobService.Extensions.Core.NotificationJobExtension.SendSoapNotification(TeamFoundationRequestContext requestContext, TeamFoundationNotification notification, TeamFoundationIdentityService identityService)&lt;br /&gt;&lt;br /&gt;Inner Exception Details:&lt;br /&gt;&lt;br /&gt;Exception Message: Unable to connect to the remote server (type WebException)&lt;br /&gt;Exception Stack Trace:    at System.Net.HttpWebRequest.GetRequestStream(TransportContext&amp;amp; context)&lt;br /&gt; at System.Net.HttpWebRequest.GetRequestStream()&lt;br /&gt; at Microsoft.TeamFoundation.Client.TeamFoundationClientProxyBase.CreateSoapRequest(String methodName, HttpWebRequest&amp;amp; request, XmlWriter&amp;amp; requestXml)&lt;br /&gt;&lt;br /&gt;Inner Exception Details:&lt;br /&gt;&lt;br /&gt;Exception Message: No connection could be made because the target machine actively refused it OldTFSIPAddress:8080 (type SocketException)&lt;br /&gt;&lt;br /&gt;Exception Stack Trace:    at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)&lt;br /&gt; at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket&amp;amp; socket, IPAddress&amp;amp; address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception&amp;amp; exception)&lt;/oldtfsserver&gt;&lt;/span&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;This was rather strange that i could see web services calls made to my old TFS server, which had been upgraded. So, I did a repair of TFS installation and hurrah the builds start running merrily.&lt;br /&gt;&lt;br /&gt;Now, I don’t know if it is an upgrade issue or anything peculiar in our team project which might have caused this error but hopefully with this post you would have an idea on how to resolve this issue. So, if you spot this issue&lt;br /&gt;&lt;br /&gt;1) Make sure that the build servers and controller could speak to each other. If the TestConnection button is working, it is a good indication that there is no comms error.&lt;br /&gt;&lt;br /&gt;2) Make sure that your proxy settings are correct on TFS server for the user under who’s context the TFS Build Agent is running.&lt;br /&gt;&lt;br /&gt;3) If the error still exists, enable tracing on TFSBuildAgent service and see if it is logging an errors.&lt;br /&gt;Apart from the above error, I also got the behaviour that the build would start but the build service could not find the build agent. Internally, it doesn’t start the build either.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-3003127020168379307?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/3003127020168379307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=3003127020168379307' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/3003127020168379307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/3003127020168379307'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2010/04/tf215097-error-occured-while.html' title='TF215097: An error occured while initializing a build'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-2447617113086988759</id><published>2010-03-19T10:32:00.002Z</published><updated>2010-03-19T10:45:22.409Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>No option to connect to Analysis Services in Microsoft Management Studio</title><content type='html'>I spent about an hour on this issue today so thought to jot it down here to save someone else's time.&lt;br /&gt;&lt;br /&gt;I had a new installation of Microsoft SQL Server 2008 and tried to connect to Analaysis Service using Microsoft SQL Server Management Studio. But the only options I could see in the drop down list in the "Connect to Server" dialog were "Database Engine" and "SQL Server Compact Engine".&lt;br /&gt;Verified that "Analysis Services" and were running and whether the port was allowed in Windows Firewall but everything seemed to be fine.&lt;br /&gt;&lt;br /&gt;Then I decided to repair my installation to see if I have missed out on any feature and yes that was certainly the case. From the features option, there is an option to install "Management Tools - Basic" and there is an option to install "Management Tools - Complete". I had it installed with Management Tools Basic and that is why I couldn't see all the options.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-2447617113086988759?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/2447617113086988759/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=2447617113086988759' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/2447617113086988759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/2447617113086988759'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2010/03/no-option-to-connect-to-analysis.html' title='No option to connect to Analysis Services in Microsoft Management Studio'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-3430787346519837993</id><published>2010-02-05T15:58:00.004Z</published><updated>2010-02-05T16:03:30.018Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft .Net'/><title type='text'>Authentication error while communicating with web server</title><content type='html'>I started debugging one of our sites today after having a new 64 bit virtual machine with Windows 2003 Server installed on it.  After setting up all websites, code, etc and when I pressed F5 on my Visual Studio 2008, I got the following error&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;"Unable to start debugging on the web server. &lt;/span&gt;&lt;em style="color: rgb(255, 0, 0);"&gt;An authentication error occurred while communicating with the web serve&lt;/em&gt;&lt;span style="color: rgb(255, 0, 0);"&gt;r"&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Most of the answers on net point to doing an IISRESET and enabling HTTP Keep-alives, neither of which worked for me. But the following link proved to be useful and after carrying out the steps, it finally start working for me.&lt;br /&gt;&lt;br /&gt;http://support.microsoft.com/?id=896861&lt;br /&gt;&lt;br /&gt;Blogging it, as it might be useful for somebody else.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-3430787346519837993?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/3430787346519837993/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=3430787346519837993' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/3430787346519837993'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/3430787346519837993'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2010/02/authentication-error-while.html' title='Authentication error while communicating with web server'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-6103408190735918486</id><published>2009-10-19T15:12:00.001+01:00</published><updated>2009-10-19T15:13:40.467+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><title type='text'>Team Explorer not showing the correct workspace</title><content type='html'>Today a fellow in our project team experienced a rather strange problem while working with Team Explorer. I spent some time on it to resolve it so thought to share it out here to save someone else's precious time.&lt;br /&gt;&lt;br /&gt;The problem we faced was that this person's team explorer was showing someone else's workspaces rather than his own.&lt;br /&gt;&lt;br /&gt;I verified the person's credentials and his access rights on team project. Then I used TFS Sidekicks to see his workspaces and all his workspaces were still present on the server. Then I typed tf workspaces on his client machine using Visual studio command prompt and I could still see his original workspaces all right. So, why is it different when connecting from visual studio? I double checked to see if he was not executing visual studio's exe from any other account but he was not.&lt;br /&gt;&lt;br /&gt;Finally, I checked that whether he had some saved User credentials for connection to the TFS server and ahaaa that resolves our problem! There was a saved user credential for connection to the TFS server and by default TFS explorer was using this credential rather than the credential our user was logged in as. Removed that stored credential and we got correct workspaces.&lt;br /&gt;&lt;br /&gt;Please note that the way we are set up is that developer’s machine resides on a different domain than TFS. Each developer connects to the TFS machine by connecting to the TFS's domain using VPN, where each developer has his/her own credential. The TFS server is added in each development machine's host file. So, when connecting, Windows uses host file and stored credential information rather than the VPN user name.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-6103408190735918486?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/6103408190735918486/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=6103408190735918486' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/6103408190735918486'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/6103408190735918486'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/10/team-explorer-not-showing-correct.html' title='Team Explorer not showing the correct workspace'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-4361877224352593414</id><published>2009-07-27T14:41:00.007+01:00</published><updated>2009-07-27T14:51:04.264+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><category scheme='http://www.blogger.com/atom/ns#' term='MsBuild'/><title type='text'>Custom Output Directory for solutions in Team Build</title><content type='html'>Basically, the problem is that Team Build creates the output of compiled code in a different location than desktop build or in other words when you compile your project locally on your development machine.&lt;br /&gt;I faced this issue because a new website was introduced in one of our solutions with the same name as another project in the same solution.&lt;br /&gt;The only difference between the two were that they were in different directory structure. For this reason, it built fine on the local machine but once on the build server&lt;br /&gt;using team build, the project compiled later overwrote all the website files of the earlier project.&lt;br /&gt;&lt;br /&gt;Now, unlike Team Build v1, Orcas does support building using the same output structure as desktop build.&lt;br /&gt;&lt;br /&gt;There is a Team Build property called &lt;strong&gt;CustomizableOutDir&lt;/strong&gt;. If you set it to true, the output binaries are created within the same&lt;br /&gt;folder structure rather than to the Binaries root directory. This &lt;a href="http://blogs.msdn.com/aaronhallberg/archive/2007/06/07/preserving-output-directory-structures-in-orcas-team-build.aspx"&gt;post&lt;/a&gt; from Aaron Hallberg gives a very good account on the&lt;br /&gt;new property.&lt;br /&gt;&lt;br /&gt;I tried using that but since I only had to use it in one of my several solutions, I tried using the format&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="color:#cc0000;"&gt;&amp;lt;SolutionToBuild Include="$(SolutionRoot)\Development\...\Solution1.sln"&amp;gt;&lt;br /&gt;&amp;lt;Properties&amp;gt;CustomizableOutDir=true&amp;lt;/Properties&amp;gt;&lt;br /&gt;&amp;lt;/SolutionToBuild&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;but it didn't work. Turned out the property needs to be defined in a global PropertyGroup&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;span style="color:#cc0000;"&gt;&amp;lt;PropertyGroup&amp;gt;&lt;br /&gt;&amp;lt;CustomizableOutDir&amp;gt;true&amp;lt;/CustomizableOutDir&amp;gt;&lt;br /&gt;&amp;lt;/PropertyGroup&amp;gt;&lt;/span&gt; &lt;/blockquote&gt;so once I have defined it all solutions would be build in place. So what to do now?&lt;br /&gt;The above mentioned blog post mentions the use of &lt;strong&gt;OutDir&lt;/strong&gt; propertiy. The OutDir property specifies the directory where Tema Build writes all output files.&lt;br /&gt;Similary, there is another property &lt;strong&gt;TeamBuildDir&lt;/strong&gt; is the output directory where Team Build writes the output files by default.&lt;br /&gt;&lt;br /&gt;So, to fix the issue that all my solutions, execept for one, keep on writing to the default output directory, I wrote my buid script as follows with the CustomizableOutDir property set to true.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;p&gt;&lt;br /&gt;&lt;span style="color:#cc0000;"&gt;&amp;lt;SolutionToBuild Include="$(SolutionRoot)\Development\...\Solution0.sln" &amp;gt;&lt;br /&gt;&amp;lt;Properties&amp;gt;OutDir=$(TeamBuildOutDir)&amp;lt;/Properties&amp;gt;&lt;br /&gt;&amp;lt;/SolutionToBuild&amp;gt; &lt;/span&gt;&lt;/p&gt;&lt;span style="color:#cc0000;"&gt;&lt;p&gt;&lt;br /&gt;&amp;lt;SolutionToBuild Include="$(SolutionRoot)\Development\...\Solution1.sln" &amp;gt;&lt;br /&gt;&amp;lt;!-- Since this solution needs to build in place, we don't specify the OutDir property--&amp;gt;&lt;br /&gt;&amp;lt;/SolutionToBuild&amp;gt; &lt;/p&gt;&lt;p&gt;&lt;br /&gt;&amp;lt;SolutionToBuild Include="$(SolutionRoot)\Development\...\Solution1.sln" &amp;gt;&lt;br /&gt;&amp;lt;Properties&amp;gt;OutDir=$(TeamBuildOutDir)&amp;lt;/Properties&amp;gt;&lt;br /&gt;&amp;lt;/SolutionToBuild&amp;gt; &lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;I hope this solution is useful for other poeple as well. If it works (or not work) for you, please do not hesitate to leave a comment.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-4361877224352593414?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/4361877224352593414/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=4361877224352593414' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/4361877224352593414'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/4361877224352593414'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/07/custom-output-directory-for-solutions.html' title='Custom Output Directory for solutions in Team Build'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-6920976317700479611</id><published>2009-07-10T16:39:00.003+01:00</published><updated>2009-07-10T16:41:37.178+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><category scheme='http://www.blogger.com/atom/ns#' term='Google Chrome OS'/><title type='text'>Google Chrome OS</title><content type='html'>The recent &lt;a href="http://googleblog.blogspot.com/2009/07/introducing-google-chrome-os.html"&gt;announcement&lt;/a&gt; made by Google that it is launching it's own operating system has created quite a media frenzy. Google Chrome as it named promises to use "Web as an OS". Not sure if I understood this marketing phrase correctly, I thought to find out exactly what is it that Google is set about doing? &lt;br /&gt;&lt;br /&gt;After reading the details, it became quite clear to me that what google are doing is that they are "Creating a new windowing system on linux kernel". This is the only technical detail I could find of the new OS on Google &lt;a href="http://googleblog.blogspot.com/2009/07/introducing-google-chrome-os.html"&gt;blog&lt;/a&gt;. What constitutes an operating system is quite a debate, but I am sure purists would agree with me that "Kernel is the operating system". &lt;br /&gt;&lt;br /&gt;So, from the details which has emerged now, Google are not creating an operating system. They are merely re-launching an existing open-source proven operating system with a new windows system (shell). &lt;br /&gt;&lt;br /&gt;I am sure Google would make it very simple, user-friendly and easier-to-use but at the end of the day it is linux with a google shell on it. Not a new operating system as the headlines make it out to be.&lt;br /&gt;&lt;br /&gt;PS: Some people won't agree on it and if you want you are always welcome to leave a comment and I will try to answer. My post is based on the information available today.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-6920976317700479611?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/6920976317700479611/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=6920976317700479611' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/6920976317700479611'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/6920976317700479611'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/07/google-chrome-os.html' title='Google Chrome OS'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-6497478429593366487</id><published>2009-06-24T16:13:00.004+01:00</published><updated>2009-07-04T00:07:51.468+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><title type='text'>TFS Performance Report Pack</title><content type='html'>&lt;p&gt;Ever since we have moved our TFS to a virtual machine on Hyper V, we have had complains about the performance of the server. The most critical part of troubleshooting performance problems is to quantify them. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;For Team Foundation Server, I found "TFS Performance Report Pack", created by &lt;a href="http://blogs.msdn.com/granth/"&gt;Grant Holiday&lt;/a&gt;, an invaluable resource. It is a set of reports that collect data from the TFSActivityLogging database (the database which logs all actions on TFS) and provides a visual view of the response time, number of requests and wait time for source control requests. &lt;/p&gt;&lt;p&gt;Until recently, the Report Pack was available only for SQL Server Reporting Services 2008. But recently Jim Saunders from &lt;a href="http://blogs.msdn.com/dstfs/"&gt;TFS Developer Support Team&lt;/a&gt; has produced a version of it for SSRS 2005 as well.&lt;/p&gt;&lt;p&gt;Installation of TFS Performance Report Pack is very simple. &lt;/p&gt;&lt;ol&gt;&lt;li&gt;Download the zip file from &lt;a href="http://blogs.msdn.com/granth/archive/2009/02/03/announcing-tfs-performance-report-pack.aspx"&gt;here&lt;/a&gt; and extract it to your TFS Application tier server.&lt;/li&gt;&lt;li&gt;Browse to your Reporting Services, which for server TFSSERVER would be &lt;a href="http://tfsserver/Reports"&gt;http://TFSSERVER/Reports&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Create a Data Source for the database TFSActivityLogging&lt;/li&gt;&lt;li&gt;Import each report file individually.&lt;/li&gt;&lt;li&gt;For each report, open the properties of the report and select the option "A shared data source". Click on the Browse button and select the data source created in step 3.&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;The reports are self explanatory and Grant Holliday's blog &lt;a href="http://blogs.msdn.com/granth/archive/2009/02/03/announcing-tfs-performance-report-pack.aspx"&gt;post&lt;/a&gt; describe them well.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-6497478429593366487?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/6497478429593366487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=6497478429593366487' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/6497478429593366487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/6497478429593366487'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/06/tfs-performance-report-pak.html' title='TFS Performance Report Pack'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-3856703093516730752</id><published>2009-06-15T14:57:00.002+01:00</published><updated>2009-06-15T14:59:10.614+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><title type='text'>TFWA</title><content type='html'>Ever since my baptism with Microsoft Team Founation Server (TFS), I have come across a number of tools, which has made working with TFS must more easier and possible for developers and configuration managers. Some of the "must have" tools for TFS are&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Team Foundation SideKicks&lt;/li&gt;&lt;li&gt;Microsoft Team Foundation Server PowerTools, and&lt;/li&gt;&lt;li&gt;MSBuild Extension Pack (if you are using Team Build)&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;These tools make up for many of the shortcomings in the feature list of TFS so far. Today, I come accross another tool for TFS, which I would like to add to the must haves list for TFS. The tools is called Microsoft Team System Web Access (TFWA) and is available as a free downloaded from Microsoft's website. It provides a web view of your TFS project and is pretty useful where clients cannot have Team Explorer installed on their machines.&lt;br /&gt;&lt;br /&gt;The tool was initially developed by &lt;a href="http://www.devbiz.com/"&gt;DevBiz&lt;/a&gt; and was called TeamPlain but was later acquired and made free to download by Microsoft.&lt;br /&gt;&lt;br /&gt;The good news is that it is all integrated in TFS2010 and is not needed as a seperate download for TFS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-3856703093516730752?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/3856703093516730752/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=3856703093516730752' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/3856703093516730752'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/3856703093516730752'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/06/tfwa.html' title='TFWA'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-968371503604691066</id><published>2009-06-02T01:01:00.003+01:00</published><updated>2009-06-02T01:09:05.434+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><title type='text'>Bing</title><content type='html'>I have been playing with the new Microsoft search engine - Bing and its actually not that bad. Do try it out by visiting http://www.bing.com.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-968371503604691066?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/968371503604691066/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=968371503604691066' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/968371503604691066'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/968371503604691066'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/06/bing.html' title='Bing'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-8528840554599054100</id><published>2009-05-28T08:49:00.002+01:00</published><updated>2009-05-28T09:48:52.688+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SQL Server'/><title type='text'>Renaming your SQL Server</title><content type='html'>If you are pondering changing the name of your development machine, you must remember to change the name of your SQL Server as well. I didn't know that and spent a good half an hour trying to run a simple query in the format&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;&lt;/span&gt;&lt;blockquote style="color: rgb(102, 0, 0);"&gt;&lt;span style="font-family: arial;"&gt;    Select &amp;lt;ColumnNames&amp;gt; from [ServerName].[DatabaseName].dbo.[TableName]&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;The server came back with the following error &lt;/span&gt;&lt;br /&gt;&lt;blockquote style="color: rgb(102, 0, 0);"&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;    Could not find server 'GGTFS2-0BUILD2' in sysservers. Execute sp_addlinkedserver to add the server to sysservers.&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family: arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Struck by the need to create a linked server for itself, I executed the following to find out what servers are present &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-family: arial;"&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;Select * from sys.sysservers&lt;/span&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Only to find that the table still contains the previous name of my machine. The resolution is pretty straight forward. Execute the following &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;&lt;/span&gt;&lt;blockquote style="color: rgb(102, 0, 0);"&gt;&lt;span style="font-family: arial;"&gt;    sp_dropserver '&amp;lt;OLD SERVER NAME&amp;gt;'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;    go&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;    &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;    sp_addserver '&amp;lt;NEW SERVER NAME&amp;gt;', 'local'&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;    go&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-family: arial;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;Restart your SQL Server and bang it starts working again :)&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-8528840554599054100?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/8528840554599054100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=8528840554599054100' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/8528840554599054100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/8528840554599054100'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/05/renaming-your-sql-server.html' title='Renaming your SQL Server'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-2803486296645318116</id><published>2009-05-27T17:15:00.029+01:00</published><updated>2009-06-02T17:00:16.723+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><title type='text'>TFS 2010 - First Encounter</title><content type='html'>&lt;span style="font-family:georgia;"&gt;I have been reading about TFS 2010 for some time now and frankly am quite eagerly waiting for it. It's a major release which promises some brilliant new features and some substantial redesign. I won’t go into details yet but Brian Harry has done a few posts about the &lt;/span&gt;&lt;a style="font-family: georgia;" href="http://blogs.msdn.com/bharry/archive/2009/04/19/team-foundation-server-2010-key-concepts.aspx"&gt;new features in TFS 2010 Beta 1 &lt;/a&gt;. TFS2010 and VSTS 2010 was released last week and I had been really waiting to check them out  Finally found some time to install it today. One of the areas where Microsoft has promised to bring improvements in TFS is its installation. Installation of existing versions of TFS is not simple to say the least. I remember I struggled for a couple of days while with my first installation of TFS 2005. No doubt, &lt;a href="http://msdn.microsoft.com/en-us/teamsystem/bb980963.aspx"&gt;"TFS Best Practices Analyzer"&lt;/a&gt; have made troubleshooting in installation much easier installing TFS is still a complicated task.&lt;br /&gt;&lt;br /&gt;In my opinion there are four things, which made installing TFS such a complicated task:&lt;br /&gt;&lt;br /&gt;1)        Creation of users on Active Directory. The person installing TFS needs to create a number of account TFSSETUP, TFSSERVICE and TFSREPORTS and needs to know exactly what rights need to be given to this user in each tier.&lt;br /&gt;&lt;br /&gt;2)        Dependency of TFS on Windows SharePoint Services and SQL Server Reporting Services. These should be installed and configured before TFS could be set up.&lt;br /&gt;&lt;br /&gt;3)        TFS wizard does not separate installation of components and their configuration. If there is some problem in configuring any part of installation, the whole installation has to start from scratch.&lt;br /&gt;&lt;br /&gt;4)        TFS installation wizard does not “screen” the environment for installation, something that “TFS Best Practices Analyzer” does.&lt;br /&gt;&lt;br /&gt;I think the point (2) is also very important in that if somebody wants to NOT use detailed reports from Reporting services or the team portal but just use TFS as a source repository (like Visual Source Safe) or source and bug repository, there wasn't another way for them unless they install everything.&lt;br /&gt;&lt;br /&gt;Microsoft has addressed at least two of these issues in TFS 2010. The new version allows TFS to be installed completely and then there are wizards for configuring each area of TFS. Also, Microsoft SQL Server Reporting Services and SharePoint are now optional for TFS 2010.&lt;br /&gt;&lt;br /&gt;Having read about it and to see how easy it is to install the Team Foundation Server, I thought to do a bare minimum single-server deployment of TFS2010. Following are the steps that I followed to deploy TFS2010&lt;br /&gt;&lt;br /&gt;1) Created a new virtual machine taking an image of Windows 2008 service pack 1 as baseline.&lt;br /&gt;&lt;br /&gt;2) Installed SQL Server 2008 on the my virtual machine.&lt;br /&gt;&lt;ol&gt;&lt;li&gt;From the first step in SQL Server 2008 installation, I selected "New SQL Server stand-alone installation or add features to an existing installation".&lt;/li&gt;&lt;li&gt;Setup Support Rules ran and gave the following warning. I ignored it.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiU5Y2AONpI/AAAAAAAABQM/9nSkk86C9dQ/s1600-h/setupsupport..JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 303px;" src="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiU5Y2AONpI/AAAAAAAABQM/9nSkk86C9dQ/s400/setupsupport..JPG" alt="" id="BLOGGER_PHOTO_ID_5342739631921051282" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Select following features for SQL Server 2008 installation&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_s7COYMZ4cc0/SiU5mnLOIZI/AAAAAAAABQU/N09PaztP0-U/s1600-h/sqlfeatures.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_s7COYMZ4cc0/SiU5mnLOIZI/AAAAAAAABQU/N09PaztP0-U/s400/sqlfeatures.JPG" alt="" id="BLOGGER_PHOTO_ID_5342739868458819986" border="0" /&gt;&lt;/a&gt;&lt;/li&gt;&lt;li&gt;Select default Instance&lt;/li&gt;&lt;li&gt;Use NT_AUTHORITY\SYSTEM for all services&lt;/li&gt;&lt;li&gt;Use Windows Authentication mode&lt;/li&gt;&lt;li&gt;Use Administrator account for Database Engine configuration Account Provisioning and Analysis services configuration account provisioning.&lt;/li&gt;&lt;li&gt;In the Reporting Services Configuration, select "Install the Native Mode default configuration"&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ol&gt;The next step is to install Team Foundation Server 2010 Beta1 on my machine. Note that I have not installed Windows SharePoint Services or Reporting services yet. I haven't even added any role to my server. I wanted to find out how would TFS installation wizard behave with bare minimum&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3)  So our third and last major step is to install TFS 2010 beta 1 on the server. I double clicked on the TFS setup file and is shown TFS installation wizard. In a couple of minutes with a couple of clicks, TFS is installed successfully and I am presented with the following configuration wizard.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_s7COYMZ4cc0/SiU9atDALrI/AAAAAAAABQc/pfJ5GcxoU48/s1600-h/tfs+config.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 267px;" src="http://2.bp.blogspot.com/_s7COYMZ4cc0/SiU9atDALrI/AAAAAAAABQc/pfJ5GcxoU48/s400/tfs+config.JPG" alt="" id="BLOGGER_PHOTO_ID_5342744061923045042" border="0" /&gt;&lt;/a&gt;Knowing that the "Default Configuration" uses SharePoint and Reporting services, I decided to use Custom Custom configuration. So, I clicked on "Custom Configuration" and clicked "Start Wizard. The first step of Custom Configuration Wizard is shown&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiU-CHHlnsI/AAAAAAAABQk/lBeYTnEwBD8/s1600-h/configfirst.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiU-CHHlnsI/AAAAAAAABQk/lBeYTnEwBD8/s400/configfirst.JPG" alt="" id="BLOGGER_PHOTO_ID_5342744738936495810" border="0" /&gt;&lt;/a&gt;Clicked Next.&lt;br /&gt;&lt;br /&gt;The second step "Configuration Database" asks for the name of SQL server instance and also if to use a pre-existing database.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_s7COYMZ4cc0/SiU-XSd-8eI/AAAAAAAABQs/eoWuTaeenYI/s1600-h/configsecond.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_s7COYMZ4cc0/SiU-XSd-8eI/AAAAAAAABQs/eoWuTaeenYI/s400/configsecond.JPG" alt="" id="BLOGGER_PHOTO_ID_5342745102760473058" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The wizard also allows to specify a label which would be included in the name of database. So if I give a label of "MYTFS" the Tfs_Configuration database would be changed to Tfs_MYTFS_Configuration&lt;br /&gt;&lt;br /&gt;Click Next.&lt;br /&gt;&lt;br /&gt;The next step is "Application Tier" asking about the account for TFS service and the website for TFS (whether to create a new one or to use an existing one).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_s7COYMZ4cc0/SiU-0zcHbZI/AAAAAAAABQ0/TNNyX5UDYyk/s1600-h/configthird.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_s7COYMZ4cc0/SiU-0zcHbZI/AAAAAAAABQ0/TNNyX5UDYyk/s400/configthird.JPG" alt="" id="BLOGGER_PHOTO_ID_5342745609827216786" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Leaving the defaults, I clicked Next&lt;br /&gt;&lt;br /&gt;The next step goes on to configure "Reporting Services". It does tell that using reporting service is optional.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiU_RBI9aiI/AAAAAAAABQ8/td3dSjWcYXs/s1600-h/configfourth.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiU_RBI9aiI/AAAAAAAABQ8/td3dSjWcYXs/s400/configfourth.JPG" alt="" id="BLOGGER_PHOTO_ID_5342746094541302306" border="0" /&gt;&lt;/a&gt;As I don't want to use Tfs Reporting so I simply unchecked the option and clicked next.&lt;br /&gt;&lt;br /&gt;The next option is configure SharePoint.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiU_upVzm8I/AAAAAAAABRE/Tx1ZFwOn8g8/s1600-h/configfifth.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiU_upVzm8I/AAAAAAAABRE/Tx1ZFwOn8g8/s400/configfifth.JPG" alt="" id="BLOGGER_PHOTO_ID_5342746603548810178" border="0" /&gt;&lt;/a&gt;Again, it is an optional feature and I don't want to use it so I simple simply unchecked the option and clicked Next.&lt;br /&gt;&lt;br /&gt;The next and last step asked whether I need to create a new Project Collection.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_s7COYMZ4cc0/SiVAVYs7PfI/AAAAAAAABRM/QVG2KXJ03W4/s1600-h/configsix.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://4.bp.blogspot.com/_s7COYMZ4cc0/SiVAVYs7PfI/AAAAAAAABRM/QVG2KXJ03W4/s400/configsix.JPG" alt="" id="BLOGGER_PHOTO_ID_5342747269097274866" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I did not want to create a new Project Collection, apart from the one created by default so just left the default options and click next.&lt;br /&gt;&lt;br /&gt;The review screen is shown with a verify button (Something very similar to Best Practices Analyzer :))&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_s7COYMZ4cc0/SiVCiDGbrLI/AAAAAAAABRU/V0Wp5reROsw/s1600-h/configreview.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://3.bp.blogspot.com/_s7COYMZ4cc0/SiVCiDGbrLI/AAAAAAAABRU/V0Wp5reROsw/s400/configreview.JPG" alt="" id="BLOGGER_PHOTO_ID_5342749685660232882" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I clicked verify to see how is my installation looking and Ouch it came up with the following errors:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;Error        [ Configuration Database ] TF255149: The following server that is running SQL Server does not have the full-text search feature installed: TestTFS2010. This feature is required for Team Foundation Server to operate correctly.&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;Error        [ Configuration Database ] TF255152: Service is not running: SQL Server Database Agent&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;Error        [ Application Tier ] TF255120: Compatibility mode for Internet Information Services (IIS) 6.0 is not enabled. Team Foundation Server requires this mode on servers that are running Windows Server 2008.&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;Error        [ Application Tier ] TFxxxxxx: The Windows Authentication role service has not been installed in the Web Server (IIS) role.  This role service is required for Team Foundation Server to function properly.&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;Error        [ Application Tier ] TF255151: Service is not installed: IIS&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;Error        [ Application Tier ] TF255151: Service is not installed: IIS Admin Service&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;Warning        [ System Checks ] TF255142: Windows Firewall is not enabled.&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;Warning        [ Configuration Database ] TF255153: Service is not set to start automatically: SQL Server Database Agent&lt;/span&gt; &lt;/span&gt; &lt;/blockquote&gt;&lt;br /&gt;Not ideal but at least I know what I need to do. So, I&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Started SQL Server Agent Service.&lt;/li&gt;&lt;li&gt;Changed Start Mode of SQL Server Agent service from Manual to Automatic.&lt;/li&gt;&lt;li&gt;Added Full-Text search feature to the existing installation of SQL Server 2008.&lt;/li&gt;&lt;li&gt;From Administrative tools, select "Server Manager". Then from the "Roles", click "Add Role". Added following Roles to the server&lt;/li&gt;&lt;/ol&gt;&lt;ul&gt;&lt;li&gt;Web Server (IIS) : Adding web server showed the following dialog that I cannot add Web server unless Windows Process Activation Service is installed&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_s7COYMZ4cc0/SiVDipvJa0I/AAAAAAAABRc/aDz0OjpFbUo/s1600-h/addroles.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 147px;" src="http://3.bp.blogspot.com/_s7COYMZ4cc0/SiVDipvJa0I/AAAAAAAABRc/aDz0OjpFbUo/s400/addroles.JPG" alt="" id="BLOGGER_PHOTO_ID_5342750795543178050" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Clicked Add Required Features and the dialog closes.&lt;/li&gt;&lt;li&gt;I installed the following services to the web server role&lt;ol&gt;&lt;li&gt;Common HTTP Features&lt;/li&gt;&lt;li&gt; HTTP Logging&lt;/li&gt;&lt;li&gt; Requrest Monitor&lt;/li&gt;&lt;li&gt; Windows Authentication&lt;/li&gt;&lt;li&gt; Request Filtering&lt;/li&gt;&lt;li&gt; Static Content Compression&lt;/li&gt;&lt;li&gt; IIS Management scripts and tools&lt;/li&gt;&lt;li&gt;IIS6 Management Compatibility&lt;/li&gt;&lt;/ol&gt;&lt;/li&gt;&lt;li&gt;Clicked Next and it starts installing the Web Server role&lt;/li&gt;&lt;/ul&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;Now that I have installed all the pre-requisites I tried to verify again. There's a "Click to Retry" link in the bottom, which retries all the tests. Clicked it and after about 5 minutes it showed me the following success message.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_s7COYMZ4cc0/SiVFtgXs-yI/AAAAAAAABRk/L_ZqaFaou0c/s1600-h/configsuccess.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 300px;" src="http://2.bp.blogspot.com/_s7COYMZ4cc0/SiVFtgXs-yI/AAAAAAAABRk/L_ZqaFaou0c/s400/configsuccess.JPG" alt="" id="BLOGGER_PHOTO_ID_5342753181030742818" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;We are very close now and the whole thing is so much better than what we had in the older versions. Click Next and TFs setup is complete.&lt;br /&gt;&lt;br /&gt;Now that TFS is all installed and configured, the next thing I wanted to do was to set up a Team Build. Team build can be on separate machines than TFS but I wanted to test it all in a single machine environment.&lt;br /&gt;&lt;br /&gt;To configure team build, I clicked Team Build configuration from the Team Foundation Server configuration wizard and the clicked Start Wizard&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiVGdBphx7I/AAAAAAAABRs/d3GXrWdODFE/s1600-h/tfsbuild1.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 267px;" src="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiVGdBphx7I/AAAAAAAABRs/d3GXrWdODFE/s400/tfsbuild1.JPG" alt="" id="BLOGGER_PHOTO_ID_5342753997417727922" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The first page of Team Foundation Build service is shown.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_s7COYMZ4cc0/SiVG145ILHI/AAAAAAAABR0/E4nkB9UzA64/s1600-h/tfsbuild2.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 262px;" src="http://3.bp.blogspot.com/_s7COYMZ4cc0/SiVG145ILHI/AAAAAAAABR0/E4nkB9UzA64/s400/tfsbuild2.JPG" alt="" id="BLOGGER_PHOTO_ID_5342754424563969138" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I clicked Configure and was presented with the following dialog&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiVHEcqkhjI/AAAAAAAABR8/kvqu8rQY23Q/s1600-h/tfsbuild3.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 384px;" src="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiVHEcqkhjI/AAAAAAAABR8/kvqu8rQY23Q/s400/tfsbuild3.JPG" alt="" id="BLOGGER_PHOTO_ID_5342754674684757554" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Since, there is no TFS server listed, I clicked on the Browse button and then clicked add.&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_s7COYMZ4cc0/SiVHkUttnmI/AAAAAAAABSM/udsreSRLI2M/s1600-h/tfsbuild45.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 382px; height: 252px;" src="http://2.bp.blogspot.com/_s7COYMZ4cc0/SiVHkUttnmI/AAAAAAAABSM/udsreSRLI2M/s400/tfsbuild45.JPG" alt="" id="BLOGGER_PHOTO_ID_5342755222306266722" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;In the dialog, type in the name of my TFS server and then clicked OK.&lt;br /&gt;In the connect to Team Project Collection, click Connect and then click start from the Build Service Host Properties and here you go. The Build Service Host has been configured.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiVH7C8JsYI/AAAAAAAABSU/HiPIpimmu5c/s1600-h/tfsbuild5.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 262px;" src="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiVH7C8JsYI/AAAAAAAABSU/HiPIpimmu5c/s400/tfsbuild5.JPG" alt="" id="BLOGGER_PHOTO_ID_5342755612671979906" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Click New Controller and it will create a new Controller service for you. The next and final step is to create a new Build Agent. Clik on New Agent. The following dialog is shown&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiVIXYpkUVI/AAAAAAAABSc/Jrnmnp3stiE/s1600-h/tfsbuild6.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 377px;" src="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiVIXYpkUVI/AAAAAAAABSc/Jrnmnp3stiE/s400/tfsbuild6.JPG" alt="" id="BLOGGER_PHOTO_ID_5342756099535950162" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Type in a name for your agent, leave controller as default and change the status to Enabled and then click OK. And here you go, our build agent is now available for your build server.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiVIuCE1xKI/AAAAAAAABSk/6toB6KxaFqI/s1600-h/tfsbuild7.JPG"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 303px;" src="http://1.bp.blogspot.com/_s7COYMZ4cc0/SiVIuCE1xKI/AAAAAAAABSk/6toB6KxaFqI/s400/tfsbuild7.JPG" alt="" id="BLOGGER_PHOTO_ID_5342756488613315746" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Now, we have successfully completed a a single server installation of TFS and created a build server. If you have worked with previous version, you would appreciate how easy it is as compared to it's predecessors.&lt;br /&gt;&lt;br /&gt;In my next post, I will create a new team project and explore new features in the new version of TFS.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-2803486296645318116?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/2803486296645318116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=2803486296645318116' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/2803486296645318116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/2803486296645318116'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/05/tfs-2010-first-encounter.html' title='TFS 2010 - First Encounter'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_s7COYMZ4cc0/SiU5Y2AONpI/AAAAAAAABQM/9nSkk86C9dQ/s72-c/setupsupport..JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-9184258843529991003</id><published>2009-05-20T01:21:00.003+01:00</published><updated>2009-05-20T01:46:04.727+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft .Net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Microsoft C# 4.0</title><content type='html'>Today, I had a chance to look at this excellent &lt;a href="http://msdn.microsoft.com/en-gb/subscriptions/downloads/default.aspx?pv=18:370"&gt;presentation&lt;/a&gt; from &lt;a href="http://en.wikipedia.org/wiki/Anders_Hejlsberg"&gt;Anders Hejlsberg&lt;/a&gt; on Microsoft C# 4.0 and it's future direction. Found it really enlightening. What I also find fascinating is that C# is evolving into more and more dynamic language, where type correction is making way for flexibility and powerful expression. We saw some of that with the introduction of var keyword in C# 3.0 and now we have a new keyword "dynamic" for Dynamic Language Runtime. I can almost hear a Visual Basic vs C++ argument echoing into my ears :) Language purists might loathe it  but we can't deny the advantages of dynamic languages in creating quick simple applications. (Imagine the life if javascript was strongly typed). The danger is ofcourse that people would get carried away with it and we would see quite a lot of badly written dynamic code causing lots and lots of runtime type conversions.&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Another notable thing is the use of more and more functional programming features in C#. This is definitely a good thing. Especially now that all modern languages run over a virtual machine, where they have a real chance to get some performance optimisation by doing some clever prediction on the behaviour of executing code.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;PS: Beta 1 of VSTS2010 and .Net 4.0 was released today for MSDN subscribers. Here's the &lt;a href="http://msdn.microsoft.com/en-gb/subscriptions/downloads/default.aspx?pv=18:370"&gt;link&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-9184258843529991003?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/9184258843529991003/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=9184258843529991003' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/9184258843529991003'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/9184258843529991003'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/05/microsoft-c-40.html' title='Microsoft C# 4.0'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-7526978331943333729</id><published>2009-05-17T23:30:00.005+01:00</published><updated>2009-05-18T00:38:39.094+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Technology'/><title type='text'>Wolfram Alpha</title><content type='html'>After all the hype, &lt;a href="http://www.wolframalpha.com/"&gt;Wolfram Aplha&lt;/a&gt; was launched this weekend and has already attracted tremendous media coverage.  It's been touted as the future face of internet. Unlike traditional search engines, it claims to be an "answer engine" rather than a search engine. You type in the question and it come up with an answer ... nice.. isn't it. Sounds like the "Computer" in science fiction movies.&lt;br /&gt;&lt;br /&gt;Unlike google, it's not a search engine. It's a "knowledge engine" containing trillions of data elements stored in a manner that computation is possible on them. &lt;a href="http://en.wikipedia.org/wiki/Mathematica"&gt;Mathemetica&lt;/a&gt;, also developed by &lt;a href="http://en.wikipedia.org/wiki/Stephen_Wolfram"&gt;Steven Wolframe&lt;/a&gt; is at the heart of the engine. I did some queries on the engine like "What is the population of the world" and "center of the earth" and it came up with the numbers - very impressive&lt;br /&gt;&lt;br /&gt;Then I remember that is a "I'm feeling lucky" button on google, which also make an "intelligent guess" on your answer. I typed in the same questions "What is the population of the world" and "center of the earth" and google took to wikipedia page about the population of world - not exactly what I asked for. Wolfram Alpha scored over google.&lt;br /&gt;&lt;br /&gt;But then I asked a non-factual question "Who is Roger federer's wife" and wolfram alpha was stumped. Asked the same on google and it promptly came up with the page of his wife's details.&lt;br /&gt;I tried another question "best place to eat in London" and wolfram alpha didn't return an answer. Asked the same to google and pressed the "I'm feeling lucky" button it came up with a list of restaurants - not exactly and answer but let me choose from a list of good restaurants. This is exactly what I wanted.&lt;br /&gt;&lt;br /&gt;The matter of fact is that it is almost impossible to find answers of absolute everything. A lot of things have answers, which depend upon the context in which the question is asked. The question "Best restaurant in London" would have a different answer depending upon the person's own likes or dislikes. So until an engine like Wolfram Alpha has a historical perspective of every visiting person (which itself is a scary thought), it is very difficult to complete what the ultimate vision of the project is.&lt;br /&gt;&lt;br /&gt;Also, the hype that Wolfram Alpha will replace google is not true as &lt;a href="http://www.telegraph.co.uk/scienceandtechnology/technology/technologynews/5307492/Wolfram-Alpha-is-not-a-Google-killer-says-creator.html"&gt;said by the creater himself&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-7526978331943333729?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/7526978331943333729/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=7526978331943333729' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/7526978331943333729'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/7526978331943333729'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/05/wolfram-alpha.html' title='Wolfram Alpha'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-896911126634134</id><published>2009-05-15T12:47:00.003+01:00</published><updated>2009-05-15T12:57:56.497+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><title type='text'>Reconfiguring Build agents after moving TFS machine - Revisited</title><content type='html'>In my last &lt;a href="http://hamidshahid.blogspot.com/2009/05/reconfiguring-build-agents-after-moving.html"&gt;post&lt;/a&gt;, I wrote about how to re-configure your build agents after you have moved your TFS server from one machine to another. Well, it worked for most of our build agents but for one. The server didn't have any entry for the the registry key&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:courier new;" &gt;HKCU\Software\Microsoft\VisualStudio\9.0\TeamFoundation\Build\Service\AllowedTeamServer&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;and in &amp;lt;add key="AllowedTeamServer" value="" /&amp;gt; setting in the tfsbuildservice.exe.config file. I tried to change the value in the config file to the new server and from everywhere I could find in registry but nothing worked.&lt;br /&gt;&lt;br /&gt;I found that TFS also maintain settings in the registry entry&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(255, 0, 0);font-family:courier new;" &gt;HKEY_USERS\S-1-5-21-3665379455-301544577-1723053213-1110\Software\Microsoft\VisualStudio\9.0\TeamFoundation\&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;where, S-1-5-21-3665379455-301544577-1723053213-1110 is the ID of the user under whose context the Team Foundation Server Build service is running.&lt;br /&gt;&lt;br /&gt;I added keys for Build\Service and a string value for setting "AllowedTeamServer" - giving the name of the new TFS server in the setting value. Restarted the server and the build agent started working.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-896911126634134?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/896911126634134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=896911126634134' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/896911126634134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/896911126634134'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/05/reconfiguring-build-agents-after-moving_15.html' title='Reconfiguring Build agents after moving TFS machine - Revisited'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-8478208234870151662</id><published>2009-05-13T18:48:00.000+01:00</published><updated>2009-05-13T18:50:49.335+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><title type='text'>Reconfiguring Build agents after moving TFS machine.</title><content type='html'>In my previous post, I wrote about &lt;a href="http://hamidshahid.blogspot.com/2009/05/moving-team-foundation-server-from.html"&gt;moving Team Foundation server from one machine&lt;/a&gt; to another (I moved it from a physical machine to a virtual machine). The move went very smooth and is well documented.&lt;br /&gt;&lt;br /&gt;However, making the build agents to work with new TFS was a different story. As part of sanity test after the move, I checked out a few files, checked them back in, browsed through the history, added and updated some work items and everything went hunky dory. But when I tried to run the build, I got the following error:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-style: italic; color: rgb(204, 0, 0);"&gt;TF215085: An error occured while connecting to agent \TeamProjectName\AgentName: The build (vstfs:////Build/Build/14918) has already completed and cannot be started again.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Searching the error number on the internet mostly suggested that the user for the build service does not have access rights to access TFS server. It proved to be red herring.&lt;br /&gt;&lt;br /&gt;After confirming that the user had all the rights it needed on the build server, the second thing was to verify whether the TFS machine can reach the build server. There is a setting in the tfsbuildservice.exe.config, which tells what servers are allowed to access this build server.&lt;br /&gt;&lt;br /&gt;   &lt;add key="AllowedTeamServer" value=""&gt;&lt;br /&gt;It is empty by default and so was the case with me. The build service keeps the name of the TFS Server at registry entry&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(204, 0, 0);"&gt;HKCU\Software\Microsoft\VisualStudio\9.0\TeamFoundation\Build\Service\AllowedTeamServer&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;I looked in there and could see that it had the name of my previous TFS service. I changed that. Search the whole registry and replaced all entries of previous TFS server with the new one. Restarted the buld server but it still didn't work.&lt;br /&gt;&lt;br /&gt;Then, I put the value of new TFS server in the config file and restarted the service and Wholla it built correctly. Once the build happened, I configured the config file back to it's default state, restarted the service and it still builds correctly.&lt;/add&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-8478208234870151662?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/8478208234870151662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=8478208234870151662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/8478208234870151662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/8478208234870151662'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/05/reconfiguring-build-agents-after-moving.html' title='Reconfiguring Build agents after moving TFS machine.'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-639229940664764629</id><published>2009-05-11T14:57:00.006+01:00</published><updated>2009-05-11T15:24:48.284+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft .Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><title type='text'>MSBuild Extensions</title><content type='html'>Today, I noticed that my first ever contribution to an open source project has been published. I had been working closely with Mike Fourie, who has been heavily involved with the MSBuild Extension pack. It's a library with a number of tasks that you can use in your MSBuild project, so that you don't have to re-invent the wheel. The tasks include commonly used functionality like managing folders, giving access rights to users, managing COM Plus applications, etc.&lt;br /&gt;&lt;br /&gt;I use this library a lot in our project. I recently wrote some new functionality to concatenate strings in an MSBUIlD string. This got published in early April and Mike has kindly mentioned my name there :) &lt;a href="http://msbuildextensionpack.codeplex.com/SourceControl/ListDownloadableCommits.aspx?ViewAll=true"&gt;http://msbuildextensionpack.codeplex.com/SourceControl/ListDownloadableCommits.aspx?ViewAll=true&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;More, I have also written functionality to create shortcut of installed files, so users can create links in desktop, start menu etc. It's not published as well.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-639229940664764629?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/639229940664764629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=639229940664764629' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/639229940664764629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/639229940664764629'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/05/msbuild-extensions.html' title='MSBuild Extensions'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-3629125506414011467</id><published>2009-05-07T17:11:00.004+01:00</published><updated>2009-05-07T17:34:36.834+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft .Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Team Foundation Server'/><title type='text'>Moving Team Foundation Server from Physical to a virtual machine</title><content type='html'>We have been using a single-machine installation of TFS for quite a few years now. The single-machine installation with Application &amp;amp; Data tiers on a single server serves us well. We recently moved from TFS 2005 to TFS 2008 but remained on SQL Server 2005. A recent review of the project identified potential benefits of moving TFS to a virtual machine. Microsoft’s &lt;a href="http://www.blogger.com/”"&gt;stance&lt;/a&gt; on this is that the application tier of TFS is supported in Hyper V but SQL Server 2005 is not. However, browsing through various posts and example scenarios we decided to go for it.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Microsoft has provided a complete &lt;a href="http://www.blogger.com/”"&gt;guide&lt;/a&gt; of moving from one hardware configuration to another, which is fairly comprehensive. Here I will write only from the perspective of moving a single server.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note that in our scenario, we are also moving the domain of our TFS server. Some of these steps are not needed if your new TFS server uses the same server. Also, I assume that you have already had TFS installed in your new server. To install the TFS server you can download TFS installation guide from &lt;a href="http://www.blogger.com/”http://www.microsoft.com/downloads/details.aspx?FamilyID=FF12844F-398C-4FE9-8B0D-9E84181D9923&amp;amp;displaylang=en”"&gt;here&lt;/a&gt; If you have MSDN subscription, you can avoid the pain of installing everything by simply downloading &lt;a href="http://www.blogger.com/”http://www.microsoft.com/downloads/details.aspx?FamilyID=72262ead-e49d-43d4-aa45-1da2a27d9a65&amp;amp;displaylang=en”"&gt;TFS VM&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#660000;"&gt;&lt;strong&gt;Existing TFS Machine: &lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;ol&gt;&lt;li&gt;Take a backup of Encryption key from your Reporting Server.&lt;br /&gt;a. For this, open Start menu &gt;&gt; Microsoft SQL Server 2005 &gt;&gt; Configuration Tools &gt;&gt; Reporting Service Configuration.&lt;br /&gt;b. Ensure that the Machine &amp;amp; Instance Names are correct and click Connect.&lt;br /&gt;c. Click Encryption Keys from left menu and click on the Backup button.&lt;br /&gt;d. Save the key file to a location from where you can read it in the new server.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Take a backup of existing TFS databases and copy them out. I use &lt;a href="http://www.blogger.com/”"&gt;LiteSpeed&lt;/a&gt; from Quest Software to take backups but simple SQL scripts or a manual backup of all databases would do the same. The databases that you need to take backup of are &lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;ReportServer&lt;/li&gt;&lt;br /&gt;&lt;li&gt;ReportServerTempDB&lt;/li&gt;&lt;br /&gt;&lt;li&gt;TfsBuild &lt;/li&gt;&lt;br /&gt;&lt;li&gt;TfsIntegration &lt;/li&gt;&lt;br /&gt;&lt;li&gt;TfsVersionControl &lt;/li&gt;&lt;br /&gt;&lt;li&gt;TfsWarehouse &lt;/li&gt;&lt;br /&gt;&lt;li&gt;TfsWorkItemTracking &lt;/li&gt;&lt;br /&gt;&lt;li&gt;TfsWorkItemTrackingAttachments&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;Make sure that you copy the backup files &amp;amp; encryption keys to a place from where they can be read by the new server.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;&lt;span style="color:#990000;"&gt;New TFS Machine:&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Preparation:&lt;/strong&gt; &lt;/p&gt;&lt;br /&gt;&lt;p&gt;1. Copy the backed up databases to local drive. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;2. From a Command Prompt window, run &lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;net stop TFSServerScheduler &lt;/li&gt;&lt;br /&gt;&lt;li&gt;net stop SPTimer &lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;3. In Internet Information Services (IIS) Manager, stop the following app pools &lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;ReportServer &lt;/li&gt;&lt;br /&gt;&lt;li&gt;TFS AppPool&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;4. Stop the Reporting Service instance. To do this &lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;For this, open Start menu &gt;&gt; Microsoft SQL Server 2005 &gt;&gt; Configuration Tools &gt;&gt; Reporting Service Configuration. &lt;/li&gt;&lt;br /&gt;&lt;li&gt;Ensure that the Machine &amp;amp; Instance Names are correct and click Connect. &lt;/li&gt;&lt;br /&gt;&lt;li&gt;Click Server Status from left menu and click on the stop button.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Database Restoration:&lt;/strong&gt;&lt;br /&gt;Connect to SQL server using SQL Server Management Studio and restore the following database in the same order: &lt;/p&gt;&lt;br /&gt;&lt;p&gt;• ReportServer&lt;br /&gt;• ReportServerTempDB&lt;br /&gt;• TfsBuild&lt;br /&gt;• TfsIntegration&lt;br /&gt;• TfsVersionControl&lt;br /&gt;• TfsWarehouse&lt;br /&gt;• TfsWorkItemTracking&lt;br /&gt;• TfsWorkItemTrackingAttachments&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Setting Database users: &lt;/strong&gt;&lt;br /&gt;Since the database restored are from a different machine, with a different domain, the database users need to be set up again.&lt;br /&gt;&lt;br /&gt;1. Click Start, click All Programs, Microsoft SQL Server 2005, and then click SQL Server Management Studio.&lt;br /&gt;&lt;br /&gt;2. In the Connect to server dialog, click OK.&lt;br /&gt;&lt;br /&gt;3. Expand Databases.&lt;br /&gt;&lt;br /&gt;4. Expand the database “TfsActivityLogging”. Expand Security and then expand Schema. Name the new Schema as &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. Expand Users. Click New User. Then in the login name browse to the user &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. Set the user name as &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. In the Roles section, select role “TFSExecRole”. In the Owned Schema section, select schema “Domain \&lt;newtfsserviceaccount&gt;”. Delete the user and schema &lt;olddomain&gt;\&lt;oldtfsserviceaccount&gt;.&lt;br /&gt;&lt;br /&gt;5. Expand the TfsBuild database. Expand Security and then expand Schema. Name the new Schema as &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. Now expand Users. Click New User. Then in the login name browse to the user &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. Set the user name as &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. In the Roles section, select role “TFSExecRole”. In the Owned Schema section, select schema “&lt;domain&gt;\&lt;newtfsserviceaccount&gt;”. Delete the user and schema &lt;olddomain&gt;\&lt;oldtfsserviceaccount&gt;.&lt;br /&gt;&lt;br /&gt;6. Expand the TfsIntegration database. Expand Security and then expand Schema. Name the new Schema as &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. Now expand Users. Click New User. Then in the login name browse to the user &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. Set the user name as &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. In the Roles section, select role “TFSExecRole”. In the Owned Schema section, select schema “&lt;domain&gt;\&lt;newtfsserviceaccount&gt;”. Delete the user and schema &lt;olddomain&gt;\&lt;oldtfsserviceaccount&gt;.&lt;br /&gt;&lt;br /&gt;7. Expand the TfsVersionControl database. Expand Security and then expand Schema. Name the new Schema as &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. Now expand Users. Click New User. Then in the login name browse to the user &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. Set the user name as &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. In the Roles section, select role “TFSExecRole”. In the Owned Schema section. Select schema “&lt;domain&gt;\&lt;newtfsserviceaccount&gt;”. Delete the user and schema &lt;olddomain&gt;\&lt;oldtfsserviceaccount&gt;.&lt;br /&gt;&lt;br /&gt;8. Expand the TfsWarehouse database. Expand Security and then expand Schema. Name the new Schema as &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. Create another schema called &lt;newdomain&gt;\TFSReports. Now expand Users. Click New User. Then in the login name browse to the user &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. Set the user name as &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. In the Roles section, select role “TFSExecRole”. In the Owned Schema section. Select schema “&lt;olddomain&gt;\&lt;oldtfsserviceaccount&gt;”. Click New User. Then in the login name browse to the user &lt;newdomain&gt;\TFSReports. Set the user name as &lt;newdomain&gt;\TFSReports. In the Roles section, select role “TFSWarehouseDataReader”. In the Owned Schema section. Select schema “&lt;domain&gt;\TFSReports”. Delete users and Schemas &lt;olddomain&gt;\&lt;oldtfsserviceaccount&gt; and &lt;olddomain&gt;\&lt;oldtfsreportsaccount&gt;.&lt;br /&gt;&lt;br /&gt;9. Expand the TfsWorkItemTracking database. Expand Security and then expand Schema. Name the new Schema as &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. Now expand Users. Click New User. Then in the login name browse to the user &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. Set the user name as &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. In the Roles section, select roles “db_datareader”, “db_datawriter” and “TFSExecRole”. In the Owned Schema section. Select schema “&lt;domain&gt;\&lt;newtfsserviceaccount&gt;”. Delete the user and schema &lt;olddomain&gt;\&lt;oldtfsserviceaccount&gt;.&lt;br /&gt;&lt;br /&gt;10. Expand the TfsWorkItemTrackingAttachments database, Expand Security and then expand Schema. Name the new Schema as &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. Now expand Users. Click New User. Then in the login name browse to the user &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. Set the user name as &lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;. In the Roles section, select roles “db_owner” and “TFSExecRole”. In the Owned Schema section. Select schema “&lt;newdomain&gt;\&lt;newtfsserviceaccount&gt;”. Delete the user and schema &lt;olddomain&gt;\&lt;oldtfsserviceaccount&gt;.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Change Server Name in Tables &lt;/strong&gt;&lt;br /&gt;Now, since the databases we have restored contains details of the old database. We need to change the name of servers from within the database. I did it by manually changing the serverName in database tables&lt;br /&gt;1. Open table tbl_database in database “TfsIntegration”. Replace the value of column “servername” with the name of new TFS server.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;strong&gt;Reconfigure Application Tier &lt;/strong&gt;&lt;br /&gt;1. From a Command Prompt window, run&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;blockquote&gt;C:\Program Files\Microsoft Visual Studio 2008 Team Foundation&lt;br /&gt;Server\Tools\TfsAdminUtil ActivateAT &lt;/blockquote&gt;&lt;newtfsmachine&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Reconfigure Report Server &lt;/strong&gt;&lt;br /&gt;To restore and verify Report Server on the new Team Foundation Server&lt;br /&gt;&lt;br /&gt;1. Click Start, click Administrative Tools, and then click Internet Information Services (IIS) Manager.&lt;br /&gt;&lt;br /&gt;2. In the Explorer pane, under the Application Pools node, right-click Report Server, and then click Start.&lt;br /&gt;&lt;br /&gt;3. Click Start, click Programs, click Microsoft SQL Server 2005, click Configuration Tools, and then click Reporting Services Configuration.&lt;br /&gt;&lt;br /&gt;4. In Report Server Installation Instance Selection, make sure that the computer name is the name of the new Team Foundation application-tier server and that the instance name is MSSQLSERVER, and then click Connect. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;5. In the Explorer pane, click Server Status.&lt;br /&gt;&lt;br /&gt;6. In the Report Server Status pane, in Instance Properties, click Start.&lt;br /&gt;&lt;br /&gt;7. In the Explorer pane, click Database Setup.&lt;br /&gt;&lt;br /&gt;8. In the Database Connection pane, make sure that the name of the Team Foundation data-tier server is correct in Server Name, and then click Connect.&lt;br /&gt;&lt;br /&gt;9. On the SQL Server Connection Dialog dialog box, click OK.&lt;br /&gt;&lt;br /&gt;10. In the Database Connection pane, click Apply.&lt;br /&gt;&lt;br /&gt;11. On the SQL Server Connection Dialog dialog box, click OK.&lt;br /&gt;&lt;br /&gt;12. Restore the encryption key and remove previous instances of Report Server by doing one of the following:&lt;br /&gt;&lt;br /&gt;If you are running SQL Report Server Enterprise Edition &lt;/p&gt;&lt;br /&gt;&lt;p&gt;1. In the Explorer pane of Reporting Services Configuration, click Encryption Keys. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;2. In the Explorer pane, click Encryptions Keys. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;3. On the Encryption Key page, click Restore. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;4. On the Encryption Key Information page, type the password for the encryption key file in Password, type or select the backup encryption key .snk file location in Key File, and then&lt;br /&gt;click OK. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;5. In the Explorer pane of Reporting Services Configuration, click Initialization. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;6. On the Initialization page, select the instance ID that corresponds with the name of the old Team Foundation data-tier server, click Remove, and then click OK. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;Note: Do not remove the installation ID that you recorded in the "To save Reporting Service installation IDs and stop services" section of this document.&lt;br /&gt;&lt;br /&gt;13. Open Internet Explorer and connect to http://localhost/reports [ http://localhost/reports ] . In Contents, click TfsReportDS.&lt;br /&gt;&lt;br /&gt;14. In Connection string, type “Data source=TFSMachineName;initial catalog=TfsWarehouse”. Select option Credentials stored securely in the report. Update the user name and password to reflect the new reporting services service account. Check the checkbox “Use as Windows credentials when connecting to the data source” and then click Apply.&lt;br /&gt;&lt;br /&gt;15. Under SQL Server Reporting Services, click Home.&lt;br /&gt;&lt;br /&gt;16. In Contents, click TfsOlapReportsDS. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;17. In Connection string, type “Data source=TFSMachineName;initial catalog=TfsWarehouse”. Select option Credentials stored securely in the report. Update the user name and password to reflect the new reporting services service account. Check the checkbox “Use as Windows credentials when connecting to the data source” and then click Apply.&lt;br /&gt;&lt;br /&gt;18. Click Start, click Administrative Tools, and then click Internet Information Services (IIS) Manager.&lt;br /&gt;&lt;br /&gt;19. In the Explorer pane, under the Application Pools node, right-click Team Foundation Server, and then click Start.&lt;br /&gt;&lt;br /&gt;20. Open a Command Prompt window and change directories to drive:\%ProgramFiles%\ Microsoft Visual Studio 2008 Team Foundation Server\Tools. Type the following command, where newDataTierServerName is the name of your new Team Foundation data-tier server, TFSReportServiceAccount is the name of the reporting services service account, and TFSServiceAccount is the name of the Team Foundation Server service account:&lt;br /&gt;SetupWarehouse.exe -o -s newDataTierServerName -d Tfswarehouse -c warehouseschema.xml -ra TFSReportServiceAccount -a TFSServiceAccount –mturl http://TFSServerName:8080&lt;br /&gt;&lt;br /&gt;21. On the Team Foundation data-tier server, click Start, click Programs, click Microsoft SQL Server 2005, and then click SQL Server Management Studio.&lt;br /&gt;&lt;br /&gt;22. On the Connect to Server dialog box, in Server type, select Database Engine, verify that the server name and authentication values are correct, and then click Connect.&lt;br /&gt;&lt;br /&gt;23. In the Object Explorer pane, expand Databases, expand TFSWarehouse, expand tables, right-click dbo._WarehouseConfig, and then click Properties.&lt;br /&gt;&lt;br /&gt;24. In Table Properties - _WarehouseConfig, in Select a page, click Permissions.&lt;br /&gt;&lt;br /&gt;25. In Users or Roles, click Add.&lt;br /&gt;&lt;br /&gt;26. In Select Users or Roles, add the Reporting Services service account (referred to generically as TFSReports), and then click OK.&lt;br /&gt;&lt;br /&gt;27. In Table Properties - _WarehouseConfig, click OK.&lt;br /&gt;&lt;br /&gt;28. In the Object Explorer pane, click Connect, and select Analysis Services.&lt;br /&gt;&lt;br /&gt;29. On the Connect to Server dialog box, make sure that the server name and authentication values are correct, and then click Connect.&lt;br /&gt;&lt;br /&gt;30. In the Object Explorer pane, expand Databases, right-click TFSWarehouse, and then click Process.&lt;br /&gt;&lt;br /&gt;31. In Process Database - TFSWarehouse, click OK.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Reset Domain Accounts and SID &lt;/strong&gt;&lt;br /&gt;Please note that these steps are only needed if the domain of the new server is different to the original server&lt;br /&gt;&lt;br /&gt;1. From a Command Prompt window &lt;/p&gt;&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Execute C:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Tools\TfsAdminUtil Sid. &lt;/li&gt;&lt;br /&gt;&lt;li&gt;Create users in the domain for all accounts that are listed as a result of last command.&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Execute C:\Program Files\Microsoft Visual Studio 2008 Team Foundation Server\Tools\TfsAdminUtil Sid /Change &lt;olddomainname&gt;&lt;newdomainname&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;2. Add user &lt;olddomainname&gt;\TFSReports to the “administrators” group of the new TFS server.&lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;strong&gt;Restart Services and verification&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;1. On the Team Foundation application-tier server, change directories to http://localhost/reports.&lt;br /&gt;&lt;br /&gt;2. In Contents, click any project, click any one of the default reports in the project, and then verify that it appears correctly.&lt;br /&gt;&lt;br /&gt;3. On the new Team Foundation application-tier server, click Start, click Administrative Tools, and then click Internet Information Services (IIS) Manager.&lt;br /&gt;&lt;br /&gt;4. In the Explorer pane, expand the Application Pools node, right-click TFS App Pool, and then click Start.&lt;br /&gt;&lt;br /&gt;5. On the new Team Foundation application-tier server, click Start, click Administrative Tools, click Services, select the TFSServerScheduler service, and then click Start, if it is not started already. Select the SharePoint Timer Service, and then click Start.&lt;br /&gt;&lt;br /&gt;6. On the Team Foundation data-tier server, connect to http://localhost:8080/WorkItemTracking/v1.0/ClientService.asmx.&lt;br /&gt;&lt;br /&gt;7. In ClientService, click StampWorkitemCache.&lt;br /&gt;&lt;br /&gt;8. In StampWorkitemCache, click Invoke.&lt;br /&gt;&lt;br /&gt;Note: The StampWorkitemCache invocation will not return any data. &lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;br /&gt;&lt;p&gt;I hope this post will help you move single-server TFS installation around quickly and easily. If you find any error in any of these steps, please do leave a comment.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-3629125506414011467?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/3629125506414011467/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=3629125506414011467' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/3629125506414011467'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/3629125506414011467'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/05/moving-team-foundation-server-from.html' title='Moving Team Foundation Server from Physical to a virtual machine'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-7998889052655508385</id><published>2009-03-31T01:01:00.007+01:00</published><updated>2009-04-01T00:24:22.321+01:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Personal'/><title type='text'>Now and then...</title><content type='html'>Today, I read &lt;a href="http://alchemya.com/wordpress2/2009/03/29/myths-about-pakistan-%E2%80%93-a-rant-or-a-middle-class-rejoinder-one/"&gt;this brilliant post&lt;/a&gt; from Jawwad Farid and it immediately struck a chord with me.&lt;br /&gt;&lt;br /&gt;From my early childhood memories, I remember that things around us were not in such abundance and people generally lived a much simpler life. I remember, we did not have a telephone at home. Having a phone was a privelege. Infact our whole apartment block had just two households with phone. All acquainances just called our neighbours, who would call us attend the call. Try telling it to today's kids in school. They would genuinely struggle with the idea of sharing their cell phones with their siblings. And it wasn't just technical items. All other things like cars, long distance travel, fast food, etc. were scarce and a luxury.&lt;br /&gt;&lt;br /&gt;Most the people I know from my childhood have progressed in some form or another. People who came to Karachi from small village and towns in search of better lives have settled down, some have bought property in their ancestral lands. People with motorbikes now have cars - sometimes two. And all of this is from Pakistan,  at times when the country have moved  from one sort of crisis to another .&lt;br /&gt;&lt;br /&gt;So, the question is where has all this money come from? No doubt, technical progress has contributed a lot. Things got cheaper and more accessible. Also, people worked hard and. But, for me one of the greatest reason is the world's definite tilt towards capitalism. In the last two decades, we have seen the world moving from nationalisation and a more state controlled "population focussed" model to a privatised and "profit centric" model. There has been many winners of this model but also the disparity of wealth between wealthy &amp;amp; poor has swelled tremendously. People have more wealth but at the same time they have become more indebted as well.&lt;br /&gt;&lt;br /&gt;The current economic meltdown may just prove to be a turning point. We have already seen huge enterprises being bailed out and effectively getting "nationalised", so a lot of things that happened in the last two decardes in being undone. Let's see how far it goes and what the future unfold for all of us.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-7998889052655508385?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/7998889052655508385/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=7998889052655508385' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/7998889052655508385'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/7998889052655508385'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/03/now-and-then.html' title='Now and then...'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-13727338932209307</id><published>2009-03-20T18:08:00.006Z</published><updated>2009-03-20T18:25:27.768Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft .Net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Adding Permissions to a shared folder using WMI and Microsoft .Net</title><content type='html'>&lt;span style="font-size:100%;"&gt;&lt;span style="font-family: arial;"&gt;A couple of days ago, I was looking at giving rights to domain users on an already existing shared folder. I searched for it on the net and didn’t find any comprehensive example of how to do it, so thought to put it here to help any desperately lazy developers out there &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;I am going to assign “Full Control” to a user called “MyDomain\MyUser” on a shared folder called “Shared”.  To do this I am using WMI through the .Net  System. Management library.  WMI is not very intuitive, but once you get hold of it, it’s really powerful to work with all those network objects.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: arial;"&gt;To assign permission to the user, the following needs to be done&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;ol style="font-family: arial;"&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Get hold of the Shared folder object’s setting and extract its security descriptor.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Extract Access Control List (ACL) from the security descriptor.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Get hold of the user account object and extract its security descriptor.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Create a Windows Trustee object for the user using its security descriptor.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Create an Access Control Entry (ACE) using the Trustee object.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Add Access Control Entry to Access Control List.&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Assign List back to Security Descriptor for the folder&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Reassign security descriptor to the shared folder.&lt;/span&gt;&lt;/li&gt;&lt;/ol&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;The above mentioned steps might seem a lot but once you know which WMI objects to use and how they are related to each other, the actual source code is not difficult.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The following function assigns user to the given shared folder.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        &lt;span style="color: rgb(0, 153, 0);"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// Creates the share.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        public void AddPermissions(string sharedFolderName, string domain, string userName)&lt;/span&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;&lt;br /&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;          &lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);"&gt;// Step 1 - Getting the user Account Object&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementObject sharedFolder = GetSharedFolderObject(sharedFolderName);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            if (sharedFolder==null)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                System.Diagnostics.Trace.WriteLine("The shared folder with given name does not exist");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                return;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementBaseObject securityDescriptorObject = sharedFolder.InvokeMethod("GetSecurityDescriptor", null, null);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            if (securityDescriptorObject == null)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                System.Diagnostics.Trace.WriteLine(string.Format(CultureInfo.InvariantCulture, "Error extracting security descriptor of the shared path {0}.", sharedFolderName));&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                return;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            int returnCode = Convert.ToInt32(securityDescriptorObject.Properties["ReturnValue"].Value);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            if (returnCode != 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                System.Diagnostics.Trace.WriteLine(string.Format(CultureInfo.InvariantCulture, "Error extracting security descriptor of the shared path {0}. Error Code{1}.", sharedFolderName, returnCode.ToString()));&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                return;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementBaseObject securityDescriptor = securityDescriptorObject.Properties["Descriptor"].Value as ManagementBaseObject;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            &lt;span style="color: rgb(0, 153, 0);"&gt;// Step 2 -- Extract Access Control List from the security descriptor&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            int existingAcessControlEntriesCount = 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementBaseObject[] accessControlList = securityDescriptor.Properties["DACL"].Value as ManagementBaseObject[];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            if (accessControlList == null)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                &lt;span style="color: rgb(0, 153, 0);"&gt;// If there aren't any entries in access control list or the list is empty - create one&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                accessControlList = new ManagementBaseObject[1];&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            else &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;                // Otherwise, resize the list to allow for all new users.&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                existingAcessControlEntriesCount = accessControlList.Length;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                Array.Resize(ref accessControlList, accessControlList.Length + 1);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;            // Step 3 - Getting the user Account Object&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementObject userAccountObject = GetUserAccountObject(domain, userName);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementObject securityIdentfierObject = new ManagementObject(string.Format("Win32_SID.SID='{0}'", (string)userAccountObject.Properties["SID"].Value));&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            securityIdentfierObject.Get();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;            // Step 4 - Create Trustee Object&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementObject trusteeObject = CreateTrustee(domain, userName, securityIdentfierObject);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            &lt;span style="color: rgb(0, 153, 0);"&gt;// Step 5 - Create Access Control Entry&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementObject accessControlEntry = CreateAccessControlEntry(trusteeObject, false);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            &lt;span style="color: rgb(0, 153, 0);"&gt;// Step 6 - Add Access Control Entry to the Access Control List&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            accessControlList[existingAcessControlEntriesCount] = accessControlEntry;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            &lt;span style="color: rgb(0, 153, 0);"&gt;// Step 7  - Assign access Control list to security desciptor &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            securityDescriptor.Properties["DACL"].Value = accessControlList;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                    &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            &lt;span style="color: rgb(0, 153, 0);"&gt;// Step 8  - Assign access Control list to security desciptor &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementBaseObject parameterForSetSecurityDescriptor = sharedFolder.GetMethodParameters("SetSecurityDescriptor");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            parameterForSetSecurityDescriptor["Descriptor"] = securityDescriptor;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            sharedFolder.InvokeMethod("SetSecurityDescriptor", parameterForSetSecurityDescriptor, null);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        &lt;span style="color: rgb(0, 153, 0);"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// The method returns ManagementObject object for the shared folder with given name&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;param name="sharedFolderName"&amp;gt;string containing name of shared folder&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;returns&amp;gt;Object of type ManagementObject for the shared folder.&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        private static ManagementObject GetSharedFolderObject(string sharedFolderName)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementObject sharedFolderObject = null;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            &lt;span style="color: rgb(0, 153, 0);"&gt;//Creating a searcher object to search &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementObjectSearcher searcher = new ManagementObjectSearcher("Select * from Win32_LogicalShareSecuritySetting where Name = '" + sharedFolderName + "'");&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementObjectCollection resultOfSearch = searcher.Get();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            if (resultOfSearch.Count &amp;gt; 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                &lt;span style="color: rgb(0, 153, 0);"&gt;//The search might return a number of objects with same shared name. I assume there is just going to be one&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                foreach (ManagementObject sharedFolder in resultOfSearch)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                    sharedFolderObject = sharedFolder;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                    break;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            return sharedFolderObject;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        &lt;span style="color: rgb(0, 153, 0);"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// The method returns ManagementObject object for the user folder with given name&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;param name="domain"&amp;gt;string containing domain name of user &amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;param name="alias"&amp;gt;string containing the user's network name &amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;returns&amp;gt;Object of type ManagementObject for the user folder.&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        private static ManagementObject GetUserAccountObject(string domain, string alias)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementObject userAccountObject = null;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementObjectSearcher searcher = new ManagementObjectSearcher(string.Format("select * from Win32_Account where Name = '{0}' and Domain='{1}'", alias, domain));&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementObjectCollection resultOfSearch = searcher.Get();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            if (resultOfSearch.Count &amp;gt; 0)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                foreach (ManagementObject userAccount in resultOfSearch)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                    userAccountObject = userAccount;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                    break;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;                }                &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            return userAccountObject;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        &lt;span style="color: rgb(0, 153, 0);"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// Returns the Security Identifier Sid of the given user&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;param name="userAccountObject"&amp;gt;The user object who's Sid needs to be returned&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        private static ManagementObject GetAccountSecurityIdentifier(ManagementBaseObject userAccountObject)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementObject securityIdentfierObject = new ManagementObject(string.Format("Win32_SID.SID='{0}'", (string)userAccountObject.Properties["SID"].Value));&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            securityIdentfierObject.Get();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            return securityIdentfierObject;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        &lt;span style="color: rgb(0, 153, 0);"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// Create a trustee object for the given user&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;param name="domain"&amp;gt;name of domain&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;param name="userName"&amp;gt;the network name of the user&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;param name="securityIdentifierOfUser"&amp;gt;Object containing User's&lt;br /&gt;sid&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        private static ManagementObject CreateTrustee(string domain, string userName, ManagementObject securityIdentifierOfUser)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementObject trusteeObject = new ManagementClass("Win32_Trustee").CreateInstance();&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            trusteeObject.Properties["Domain"].Value = domain;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            trusteeObject.Properties["Name"].Value = userName;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            trusteeObject.Properties["SID"].Value = securityIdentifierOfUser.Properties["BinaryRepresentation"].Value;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            trusteeObject.Properties["SidLength"].Value = securityIdentifierOfUser.Properties["SidLength"].Value;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            trusteeObject.Properties["SIDString"].Value = securityIdentifierOfUser.Properties["SID"].Value;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            return trusteeObject;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        &lt;span style="color: rgb(0, 153, 0);"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// Create an Access Control Entry object for the given user&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;/summary&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;param name="trustee"&amp;gt;The user's trustee object&amp;lt;/param&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;param name="deny"&amp;gt;boolean to say if user permissions should be assigned or denied&amp;lt;/param&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(0, 153, 0);font-family:courier new;" &gt;        /// &amp;lt;returns&amp;gt;&amp;lt;/returns&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        private static ManagementObject CreateAccessControlEntry(ManagementObject trustee, bool deny)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        {   &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            ManagementObject aceObject = new ManagementClass("Win32_ACE").CreateInstance();&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            aceObject.Properties["AccessMask"].Value = 0x1U | 0x2U | 0x4U | 0x8U | 0x10U | 0x20U | 0x40U | 0x80U | 0x100U | 0x10000U | 0x20000U | 0x40000U | 0x80000U | 0x100000U; // all permissions&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            aceObject.Properties["AceFlags"].Value = 0x0U; // no flags&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            aceObject.Properties["AceType"].Value = deny ? 1U : 0U; // 0 = allow, 1 = deny&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            aceObject.Properties["Trustee"].Value = trustee;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;            return aceObject;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;        }&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;The code above is pretty self explanatory, albeit not a good demonstration of catching exceptions and checking for boundary conditions.&lt;br /&gt;As you can see, I am using the ManagementObjectSearcher class to search for shared folder’s setting and user account objects as done in the GetSharedFolderObject() and GetUserAccountObject() methods. Once, we have got the objects, we are working with them to modify and create the related objects necessary to give new permissions.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-13727338932209307?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/13727338932209307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=13727338932209307' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/13727338932209307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/13727338932209307'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/03/adding-permissions-to-shared-folder.html' title='Adding Permissions to a shared folder using WMI and Microsoft .Net'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-4562235846530282377</id><published>2009-03-18T23:50:00.005Z</published><updated>2009-03-19T16:25:35.110Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Personal'/><title type='text'>Quantitative Easing</title><content type='html'>&lt;span style="font-family:arial;"&gt;The term "Quantitative Easing" has been mentioned quite often in news these days. I didn't know an aweful lot about it and had some time handy today, so thought to study it a bit. I am just jotting down my findings in as simple words as possible.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Wikipedia defines "Quantitative Easing" as a mechanism for central banks to pump liquidity (money supply) in the economy. In other words, central bank will print more money and put it in circulation, so for example if there was £18bn of wealth in circulation through currency notes it would be increased to £20bn of wealth.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(51, 0, 153); font-weight: bold;font-family:arial;" &gt;So, how do central banks do it?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Well, the honest answers is that it's the central bank and it's standing in the world that determines the wealth for us. A £10 currency note is actually the property of the Bank of England and the idea is  that if I give £10 to BoE, it would return me an equivalent amount of "wealth". Now, "wealth" used to be old solid gold in the old days (well, upto 1932). These days its a combination of T-Bills, government bonds and a host of other financial tools. These tools are bought and kept by commercial banks as deposits for the lending they do. &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Through quantitative analysis, central banks buy back these bonds and provide cash against these. Since, banks are required to only keep a percentage of their deposits as reserve (say 50%), increasing liquidity in banks by say £1000 would enable them to lend out £2000. This increase the money supply to banks, who can then lend them to individuals and business. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(51, 0, 153);font-family:arial;" &gt;Negative Effects:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;With more money in circulation, there will be more money chasing lesser goods making everything more "expensive". There is a genuine risks of inflation shooting through the roof. It depreciates the "actual" value of assetts for investers and devalues the currency.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102); font-weight: bold;font-family:arial;" &gt;Who's doing it?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;Bank of England announced it &lt;/span&gt;&lt;a style="font-family: arial;" href="http://news.bbc.co.uk/1/hi/business/7936319.stm"&gt;earlier this month&lt;/a&gt;&lt;span style="font-family:arial;"&gt;. And today, the Federal Reserve in US has &lt;/span&gt;&lt;a style="font-family: arial;" href="http://news.bbc.co.uk/1/hi/business/7951493.stm"&gt;announced &lt;/a&gt;&lt;span style="font-family:arial;"&gt;it. The scale of money pumping in by the US is mind boggling. Of course, both the economies are hit hard by the credit crunch and are undergoing negative inflation.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 102);font-family:arial;" &gt;Winners &amp;amp; Loosers:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The winners would be banks and financial companies. With the value of money reducing, the actual value of their bad debts would go down and they would have more cash to lend. After Quantitative Easing, a bad debt of say £100,000 would have the same effect as a bad debt of £90,000.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;The biggest loosers, I think, would be Asian and OPEC countries, who keep their reserves in dollars. All gulf countries, for example, have pegged their currencies against dollars. A devaluation of dollars would devalue their currencies and reduce their wealth. Also, countries like China and India have hoarded huge sums of dollars. They will see the actual value of their dollar based wealth dwindle.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102); font-weight: bold;font-family:arial;" &gt;What next?&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;I am quite keen to see&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;1) How China respond to this announcement by Federal Reserve today? Will they be selling T-Bills? Would it switch buy more Euro based assetts?&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;"&gt;2)  Will the European Central Bank adopt Quantitative Easing? This is one of the sternest test of the European Economic Commission. They have countries like Germany &amp;amp; France on one end, which would want it to happen and have countries like Poland, which still have strong inflationary pressure and would not want to do it.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-4562235846530282377?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/4562235846530282377/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=4562235846530282377' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/4562235846530282377'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/4562235846530282377'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/03/quantitative-easing.html' title='Quantitative Easing'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-5586076139606636801</id><published>2009-03-13T14:09:00.004Z</published><updated>2009-03-19T16:26:19.697Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft .Net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>New release of Microsoft StyleCop</title><content type='html'>A new version of &lt;a href="http://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=sourceanalysis&amp;amp;ReleaseId=1425"&gt;Microsoft StyleCop&lt;/a&gt; was released yesterday. If you are not already using StyleCop, do it try it out. For years, I have been frustrated by developers using inconsistent layouts, variables defined all over the place, different styles, etc which effect the readability of the code. This is where stylecop comes handy and once integrated into the build process, it would flag all inconsistencies in the project. This ensures that code is readable and maintainable throughout.&lt;br /&gt;&lt;br /&gt;If you are using &lt;a href="http://www.codeplex.com/MSBuildExtensionPack"&gt;MSBuild Entension Pack&lt;/a&gt;, there is a task defined for running StyleCop. Integrate it into your CI build and the developers would instantly know if a developer have done some misdemeanour :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-5586076139606636801?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/5586076139606636801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=5586076139606636801' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/5586076139606636801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/5586076139606636801'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/03/new-release-stylecop.html' title='New release of Microsoft StyleCop'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-3266185165174916236</id><published>2009-03-06T15:32:00.006Z</published><updated>2009-03-19T16:27:45.073Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Personal'/><title type='text'>Say yes to "No"</title><content type='html'>Josh Billings once famously said&lt;br /&gt;&lt;br /&gt;"One-half the troubles of this life can be traced to saying yes too quickly..."&lt;br /&gt;&lt;br /&gt;and reflecting back, this is certainly something true to my life. I have often found myself worried about doing things, which I could have avoided.  I think, my habbit is rooted from my cultural background.&lt;br /&gt;&lt;br /&gt;The fact it that people from Indian subcontinent are not used to hearing apologies. So, if someone invites you for dinner, for instance, and you can't make it, it can become really difficult to excuse out of it. People would insist and insist until you agree to what they are asking. The result is that people end up making commitments that they can't meet and people saying things they don't really mean. I, for one, find it frustrating.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-3266185165174916236?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/3266185165174916236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=3266185165174916236' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/3266185165174916236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/3266185165174916236'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/03/say-yes-to-no.html' title='Say yes to &quot;No&quot;'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-249315203913089698</id><published>2009-03-03T20:58:00.018Z</published><updated>2009-03-19T16:29:59.023Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft MVC framework'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft .Net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.Net'/><title type='text'>ASP.net MVC Framwork Part 3</title><content type='html'>In my &lt;a href="http://hamidshahid.blogspot.com/2009/02/aspnet-mvc-framwork-part-2.html"&gt;previous post&lt;/a&gt;, I wrote about the Microsoft ASP.Net MVC Framework and demonstrated with the help of a simple application, how it simplifies the use Model-View-Controller design pattern in web applications. The ultimate motive for using the patter is of course to achieve seperation of business and presentation logic.&lt;br /&gt;&lt;br /&gt;In this post, I will write about what actually happens under the hood in the MVC framework and how does it enables us to create more simpler applications. The underlying technology used in the MVC framework is not new. If you are familiar with the Micorosoft Internet Information server (IIS), you would have surely heard about ISAPI Extensions and ISAPI Filters.&lt;br /&gt;&lt;br /&gt;ISAPI Extensions are program that run on the IIS web server and have access to the functionality provided by IIS. They are the ultimate target of all web requests and are responsible for processing them. ISAP Filters are programs through which all client requests are filtered through before they are finally processed by ISAPI extensions.&lt;br /&gt;&lt;br /&gt;To harness the functionality of ISAPI Exentions and ISAPI filter, ASP.Net provides Http Handlers and Http Modules respectively. A following pictures gives a graphical representation of a web request through HTTP Modules and HTTP Handlers.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_s7COYMZ4cc0/SbBh_B7GX-I/AAAAAAAABMw/S6BRcLJmluM/s1600-h/httpmodule.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 199px; height: 277px;" src="http://1.bp.blogspot.com/_s7COYMZ4cc0/SbBh_B7GX-I/AAAAAAAABMw/S6BRcLJmluM/s320/httpmodule.jpg" alt="" id="BLOGGER_PHOTO_ID_5309851696145784802" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The HTTP Handler class must implement the IHTTPHandler interface in the System.Web namespace. For every type of web request, an HTTP handler must exist to preocess it. In a web application, the Http Handlers to process different kinds of files are listed in the web.config file. The following code snippet shows an example of all HTTP&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="color: rgb(153, 51, 0);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;    &amp;lt;system.webServer&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        &amp;lt;modules runAllManagedModulesForAllRequests="true"&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            &amp;lt;remove name="ScriptModule"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            &amp;lt;remove name="UrlRoutingModule"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;            &amp;lt;add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;            &amp;lt;add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        &amp;lt;/modules&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        &amp;lt;handlers&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;            &amp;lt;remove name="ScriptHandlerFactory"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            &amp;lt;remove name="ScriptHandlerFactoryAppServices"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            &amp;lt;remove name="ScriptResource"/&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;            &amp;lt;remove name="MvcHttpHandler"/&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;            &amp;lt;remove name="UrlRoutingHandler"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            &amp;lt;add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;            &amp;lt;add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            &amp;lt;add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;            &amp;lt;add name="MvcHttpHandler" preCondition="integratedMode" verb="*" path="*.mvc" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;            &amp;lt;add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        &amp;lt;/handlers&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;    &amp;lt;/system.webServer&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;As you might have guessed so far, the functionality of MVC framework is provided through HTTP Module and HTTP Handlers, which provides all the functionailty of routing and passing data between controller and view.&lt;br /&gt;&lt;br /&gt;To process the custom URL,  the framework make use of &lt;a href="http://msdn.microsoft.com/en-us/library/system.web.ihttphandler.aspx"&gt;UrlRoutingModule&lt;/a&gt;. In the above extract from web.config, you will find the the entry&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(153, 51, 0);font-family:courier new;" &gt;&amp;lt;add name="urlRouting" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing"/&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;A RouteTable needs to be defined to handle the URL pattern. This is done in the Application_OnStart event in the global.asax file. This is shown below:&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 51, 0);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="color: rgb(153, 51, 0);font-size:85%;" &gt;&lt;span style="font-family:courier new;"&gt;        public static void RegisterRoutes(RouteCollection routes)&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            routes.MapRoute(&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                "Default",                                              // Route name&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                "{controller}/{action}/{id}",                           // URL with parameters&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                new { controller = "Home", action = "Index", id = "" }  // Parameter defaults&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            );&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        protected void Application_Start()&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;            RegisterRoutes(RouteTable.Routes);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;br /&gt;Inside the method RegisterRoute,  there is a call routes.MapRoute, which takes three parameter. The first parameter is the name of the route, the second parameter contains the pattern of URL and the three parameter contains default values for URL.&lt;br /&gt;&lt;br /&gt;As you can see, the pattern used in URL is "{Controller}/{Action}/{Id}". When the URL is called, the class in the controller section is called as controller, the action value is set through the action part of URL and if there is a record selected then the Id is passed through the Id section.&lt;br /&gt;The HTTP module &lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;span style="color: rgb(153, 51, 0);"&gt;&lt;span style="color: rgb(0, 0, 0);"&gt;System.Web.Routing.UrlRoutingModule makes sure that requests are passed to controller and that all data submitted from the view is passed to it.&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-249315203913089698?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/249315203913089698/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=249315203913089698' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/249315203913089698'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/249315203913089698'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/03/aspnet-mvc-framwork-part-3.html' title='ASP.net MVC Framwork Part 3'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_s7COYMZ4cc0/SbBh_B7GX-I/AAAAAAAABMw/S6BRcLJmluM/s72-c/httpmodule.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-6511684926089853635</id><published>2009-02-24T23:13:00.019Z</published><updated>2009-03-19T16:29:45.103Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft MVC framework'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft .Net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.Net'/><title type='text'>ASP.net MVC Framwork Part 2</title><content type='html'>In my previous &lt;a href="http://hamidshahid.blogspot.com/2009/02/aspnet-mvc-framwork.html"&gt;post&lt;/a&gt;, I wrote about Microsoft ASP.Net MVC framework and how it resolves the complexity of implementing &lt;a href="http://en.wikipedia.org/wiki/Model-view-controller"&gt;model-view-controller&lt;/a&gt; design pattern in ASP.net web applications. In this post, I will compare what it takes to use MVC pattern in an ASP.net web application and do the same using the ASP.Net MVC framework.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 102);font-size:130%;" &gt;The QuickShop Application&lt;/span&gt;&lt;br /&gt;For my example, I will create a very very simple online store, which sells such a small number of items that they can be listed in a drop down list. We will also assume that the name of products are sufficient enough for the client and that all payment is done offline. Purchase through the online store has three steps in total. The first page shows the list of products and allow customers to select product and quanity. The second page shows a confirmation message with the selected product and quanity and the last page creates the order and takes the user back to first page.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 102);font-size:130%;" &gt;Database&lt;/span&gt;&lt;br /&gt;The databae of our simple application is also very simple. The database has two tables, Product &amp;amp; Order. The product table contains all the products present in the store and the Order table contain all the Orders, as shown&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_s7COYMZ4cc0/SaSxjNt7v8I/AAAAAAAABLY/xTs5oe8u54A/s1600-h/db.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 180px;" src="http://2.bp.blogspot.com/_s7COYMZ4cc0/SaSxjNt7v8I/AAAAAAAABLY/xTs5oe8u54A/s320/db.jpg" alt="" id="BLOGGER_PHOTO_ID_5306561479485145026" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 102); font-weight: bold;"&gt;ASP Web Application&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;To implement the controller of our application, we create an abstract class called "Process". The class would contain a list of "Actions". The controller would take input from view (ASP.Net pages) and move from one action to another, while working with Model, which is constituted of  the database and entity classes.&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(102, 51, 0);"&gt;namespace QuickShopWeb&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;    using System.Collections.Generic;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;    public delegate void ActionChangedEventHandler(object sender, System.EventArgs e);    &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;    [System.Serializable]&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;    public abstract class Process&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;        private List&lt;action&gt; _actions;&lt;/action&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;        private int _currentActionIndex;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;        public event ActionChangedEventHandler OnActionChanged;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;        public List&lt;action&gt; Actions&lt;/action&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;             get&lt;/span&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;{&lt;/span&gt;&lt;span style="color: rgb(102, 51, 0);"&gt; return _actions;&lt;/span&gt;&lt;span style="color: rgb(102, 51, 0);"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;        public Action CurrentAction&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;  get&lt;/span&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;{&lt;/span&gt;&lt;span style="color: rgb(102, 51, 0);"&gt; return _actions[_currentActionIndex];&lt;/span&gt;&lt;span style="color: rgb(102, 51, 0);"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;        internal void SetActions(List&lt;action&gt; actionsToSet)&lt;/action&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;  this._actions = actionsToSet;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;  foreach (Action action in this._actions)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;    action.OnCompletion += new ActionCompletionEventHandler(this.Action_OnCompletion);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;        private void Action_OnCompletion(object sender, System.EventArgs e)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;  if (this._currentActionIndex &gt;= this._actions.Count - 1)&lt;/span&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;   // Restart &lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;   this._currentActionIndex = 0;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;  else&lt;/span&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;   // Move to next action&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;   this._currentActionIndex++;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;  }&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(102, 51, 0);"&gt;  // Notify the View that we've moved on to a new action&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;  if (this.OnActionChanged != null)&lt;/span&gt;&lt;span style="color: rgb(102, 51, 0);"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;    this.OnActionChanged(this, e);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;  }&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(102, 51, 0);"&gt;&lt;/span&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;&lt;br /&gt;It contains a list of objects of type "Action". There is an indexer and a method that set the list of Actions. Also defined is an event and and event handler. The event is invoked when an action is completed and the EventHandler simply moves the indexer to the next Action in the list.&lt;br /&gt;&lt;br /&gt;We add the [System.Serializable] attribute because we would need to persist Controller between views and this is achieved by keeping the controller object in HTTP session object.&lt;br /&gt;&lt;br /&gt;We next look at the Action class, which is again a Serializeable abstract class, defines an event for ActionCompletion and a method called Complete. The class is defined as follows:&lt;br /&gt;&lt;br /&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;&lt;span style="color: rgb(102, 51, 0);"&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;namespace QuickShopWeb&lt;br /&gt;{&lt;br /&gt;using System;&lt;br /&gt;internal delegate void ActionCompletionEventHandler(object sender, EventArgs e);&lt;br /&gt;&lt;br /&gt;[System.Serializable]&lt;br /&gt;public abstract class Action&lt;br /&gt;{&lt;br /&gt;internal event ActionCompletionEventHandler OnCompletion;&lt;br /&gt;&lt;br /&gt;internal void Complete(EventArgs e)&lt;br /&gt;{&lt;br /&gt;  if (this.OnCompletion != null)&lt;br /&gt;  {&lt;br /&gt;      this.OnCompletion(this, e);&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;}&lt;/span&gt;&lt;span style="color: rgb(102, 51, 0);"&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;/span&gt;Now that the groundwork is done, all we need now is to define the specific process for our application. Our simple application has three actions&lt;br /&gt;&lt;ol&gt;&lt;li&gt;IndexAction: Need to retrieves all the products display them in the view&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Confirm: Need to shows confirmation message in the view&lt;br /&gt;&lt;/li&gt;&lt;li&gt;CreateOrder: Need to create new order record.&lt;/li&gt;&lt;/ol&gt;Our process class looks like following:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;blockquote  style="color: rgb(102, 51, 0);font-family:courier new;"&gt;namespace QuickShopWeb&lt;br /&gt;{&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;&lt;br /&gt;[System.Serializable]&lt;br /&gt;public class ShopProcess : Process&lt;br /&gt;{&lt;br /&gt;  public int ProductId { get; set; }&lt;br /&gt;  public int Quantity { get; set; }&lt;br /&gt;  public string ProductName { get; set; }&lt;br /&gt;&lt;br /&gt;  public ShopProcess()&lt;br /&gt;  {&lt;br /&gt;      List&lt;action&gt; actions = new List&lt;action&gt;();&lt;/action&gt;&lt;/action&gt;&lt;br /&gt;      actions.Add(new IndexAction());&lt;br /&gt;      actions.Add(new Confirm());&lt;br /&gt;      actions.Add(new CreateOrder());&lt;br /&gt;&lt;br /&gt;      this.OnActionChanged += new ActionChangedEventHandler(ProcessActionChanged);&lt;br /&gt;      this.SetActions(actions);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  private void ProcessActionChanged(object sender, System.EventArgs e)&lt;br /&gt;  {&lt;br /&gt;      RedirectToAction(CurrentAction);&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  public void RedirectToAction(Action action)&lt;br /&gt;  {&lt;br /&gt;      switch(action.GetType().Name)&lt;br /&gt;      {&lt;br /&gt;          case "IndexAction":&lt;br /&gt;              HttpContext.Current.Response.Redirect("~/View/Index.aspx");&lt;br /&gt;              break;&lt;br /&gt;&lt;br /&gt;          case "Confirm":&lt;br /&gt;              HttpContext.Current.Response.Redirect("~/View/Confirm.aspx");&lt;br /&gt;              break;&lt;br /&gt;&lt;br /&gt;          case "CreateOrder":              &lt;br /&gt;              HttpContext.Current.Response.Redirect("~/View/Complete.aspx");&lt;br /&gt;              break;&lt;br /&gt;      }&lt;br /&gt;  }  &lt;br /&gt;}&lt;br /&gt;}&lt;/blockquote&gt;&lt;span style="font-size:100%;"&gt;As you can see, the ShopProcess initiates all action and creates an EventHandler for OnCompletion event of all actions. The event handler simply redirects to appropriate view.&lt;br /&gt;&lt;br /&gt;Now that we have the controller part working, next is to create view. I will explain the only the Index.aspx page. Views for other actions are similar and can be easily understood by going through the code. The default aspx page created an object of type ShopProcess and added it to the Session variable as shown:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote  style="color: rgb(102, 51, 0);font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;    public partial class _Default : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt;   protected void Page_Load(object sender, EventArgs e)&lt;br /&gt;   {&lt;br /&gt;       ShopProcess goShopping = new ShopProcess();&lt;br /&gt;       Session["CurrentProcess"] = goShopping;&lt;br /&gt;       goShopping.RedirectToAction(goShopping.CurrentAction);&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-size:100%;"&gt;&lt;span style="font-family:arial;"&gt;This starts the process and takes the user to the index.aspx page. The index.aspx codebehind file looks like:&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;/span&gt;&lt;blockquote style="color: rgb(102, 51, 0); font-family: courier new;"&gt;&lt;span style="font-size:85%;"&gt;using System;&lt;br /&gt;using System.Collections.Generic;&lt;br /&gt;using System.Linq;&lt;br /&gt;using System.Web;&lt;br /&gt;using System.Web.UI;&lt;br /&gt;using System.Web.UI.WebControls;&lt;br /&gt;&lt;br /&gt;namespace QuickShopWeb.View&lt;br /&gt;{&lt;br /&gt;public partial class Index : System.Web.UI.Page&lt;br /&gt;{&lt;br /&gt; public ShopProcess CurrentProcess&lt;br /&gt; {&lt;br /&gt;     get&lt;br /&gt;     {&lt;br /&gt;         return (Session["CurrentProcess"] as ShopProcess);&lt;br /&gt; &lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt; protected void Page_Load(object sender, EventArgs e)&lt;br /&gt; {&lt;br /&gt;     if (!Page.IsPostBack)&lt;br /&gt;     {&lt;br /&gt;         IndexAction action = CurrentProcess.CurrentAction as IndexAction;&lt;br /&gt;         foreach (Product product in action.Products)&lt;br /&gt;         {&lt;br /&gt;             ProductDropDownList.Items.Add(new ListItem(product.ProductName, product.ProductId.ToString()));&lt;br /&gt;         }&lt;br /&gt;     }&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt; protected void OrderButton_Click(object sender, EventArgs e)&lt;br /&gt; {&lt;br /&gt;     CurrentProcess.ProductId = int.Parse(ProductDropDownList.SelectedValue);&lt;br /&gt;     CurrentProcess.Quantity = int.Parse(QuantityTextBox.Text);&lt;br /&gt;     CurrentProcess.ProductName = ProductDropDownList.SelectedItem.Text;&lt;br /&gt;&lt;br /&gt;     CurrentProcess.CurrentAction.Complete(e);&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;/span&gt;&lt;/blockquote&gt;The index.aspx page (view) extracts data passed to it from the contoller and displays it to the user. When user input some data, the view  passes it to the controller and set the current action to complete (as shown in the OrderButton_Click) event.&lt;br /&gt;&lt;br /&gt;The complete listing of web application can be downloaded from this &lt;a href="http://www.4shared.com/account/file/89329308/9a46843c/QuickShopWeb.html"&gt;link.&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 102); font-weight: bold;"&gt;Using MVC Framework&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Now, we will create the same application using MVC framework. I have created this example using the Microsoft MVC Release Candidate 1. If you have not downloaded it already, you can download it free from &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=f4e4ee26-4bc5-41ed-80c9-261336b2a5b6&amp;amp;displaylang=en"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;We create a new solution and this time instead of choosing "ASP.Net Web Application", we choose "ASP.Net MVC Web Application" as shown:&lt;blockquote&gt;&lt;/blockquote&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_s7COYMZ4cc0/SaSdw9P4YwI/AAAAAAAABLQ/ghYRDiYwSnc/s1600-h/MVCFramework.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 320px; height: 215px;" src="http://2.bp.blogspot.com/_s7COYMZ4cc0/SaSdw9P4YwI/AAAAAAAABLQ/ghYRDiYwSnc/s320/MVCFramework.jpg" alt="" id="BLOGGER_PHOTO_ID_5306539725349741314" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;The next step in the wizard would ask you if you want to create a unit test project. I select the option "No, do not create a unit test project" for my application. When you click OK, you will see that the wizard has created classes for Controller, home page, about page, etc. We will ignore them now.&lt;br /&gt;&lt;br /&gt;What I will do now is to add a dbml class that points to our QuickShop database. Then, click on the HomeController.cs class and rewrite the code for Index() method, so that it returns a list of all Products, so the code would look like:&lt;br /&gt;&lt;br /&gt;&lt;blockquote face="courier new" style="color: rgb(102, 51, 0);"&gt;&lt;span style="font-size:85%;"&gt;        public ActionResult Index()&lt;br /&gt;      {&lt;br /&gt;          var products = from p in db.Products orderby p.ProductName select p;&lt;br /&gt;          return View(products.ToList&lt;product&gt;());&lt;br /&gt;      }&lt;br /&gt;&lt;/product&gt;&lt;/span&gt;&lt;/blockquote&gt;By default the Index method is invoked for the Index page and this list of products would be available to the Index.aspx page (View). All we need to do is to create a codebehind file for Index.aspx and inherit it from System.Web.Mvc.ViewPage&amp;lt;List&amp;lt;Product&amp;gt;&amp;gt; So the codebehind class for our Index page would look like&lt;br /&gt;&lt;br /&gt;&lt;blockquote style="color: rgb(153, 102, 51);"&gt;&lt;span style=";font-family:courier new;font-size:85%;"  &gt;namespace QuickShop&lt;br /&gt;{&lt;br /&gt;  using System;&lt;br /&gt;  using System.Collections.Generic;&lt;br /&gt;  using System.Web;&lt;br /&gt;&lt;br /&gt;  public partial class Index : System.Web.Mvc.ViewPage&lt;list&gt;&lt;product&gt;&gt;&lt;br /&gt;  {&lt;br /&gt;  }&lt;br /&gt;}&lt;/product&gt;&lt;/list&gt;&lt;/span&gt;&lt;br /&gt;&lt;/blockquote&gt;To access the data returned from the controller, the aspx page (view) needs to use the ViewData.Model property. The complete listing of our Index.asp page is shown below&lt;br /&gt;&lt;br /&gt;&lt;blockquote  style="color: rgb(153, 102, 51);font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="false" CodeBehind="Index.cs" Inherits="System.Web.Mvc.ViewPage" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Import Namespace="QuickShop" %&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" &amp;gt;&lt;br /&gt;&amp;lt;head runat="server"&amp;gt;&lt;br /&gt;  &amp;lt;title&amp;gt;Quick Shop&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;  &amp;lt;h1&amp;gt;Quick Electronic Shop&amp;lt;/h1&amp;gt;&lt;br /&gt;  &amp;lt;br /&amp;gt;&lt;br /&gt;  &amp;lt;br /&amp;gt;&lt;br /&gt;  &amp;lt;div&amp;gt;&lt;br /&gt;      &amp;lt;form method="post" action="/Home/Confirm"&amp;gt;&lt;br /&gt;          Select Product&lt;br /&gt;          &amp;lt;br /&amp;gt;&lt;br /&gt;          &amp;lt;select name="product" style="width:200px;"&amp;gt;&lt;br /&gt;              &amp;lt;%&lt;br /&gt;                  foreach(Product product in (ViewData.Model as List&amp;lt;Product&amp;gt;))&lt;br /&gt;                  {&lt;br /&gt;                      Response.Write( string.Format("&amp;lt;option value=\"{0}\"&amp;gt;{1}&amp;lt;/option&amp;gt;", product.ProductId , product.ProductName ));&lt;br /&gt;                  }&lt;br /&gt;              %&amp;gt;&lt;br /&gt;          &amp;lt;/select&amp;gt;&lt;br /&gt;          &amp;lt;br /&amp;gt;&lt;br /&gt;          &amp;lt;br/&amp;gt;&lt;br /&gt;          Quantity&lt;br /&gt;          &amp;lt;br /&amp;gt;&lt;br /&gt;          &amp;lt;input type="text" name="quantity" style="width:200px;"/&amp;gt;&lt;br /&gt;          &amp;lt;br /&amp;gt;&lt;br /&gt;          &amp;lt;br /&amp;gt;&lt;br /&gt;          &amp;lt;input type="submit" value="Order" /&amp;gt;         &lt;br /&gt;      &amp;lt;/form&amp;gt;&lt;br /&gt;   &lt;br /&gt;  &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/blockquote&gt;Please note that we are not using any server side components in this page and the action of the forms is set to "&lt;span style="font-size:85%;"&gt;/Home/ConfirmOrder"&lt;/span&gt;. This would automatically invoke the ConfirmOrder method in the Home controller. Moreover, the form input variables are automatically passed as parameters to the method. So, the signature of our Confirm method would look like:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote style="color: rgb(153, 102, 51);"&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="font-family:courier new;"&gt;        public ActionResult Confirm(string product, string quantity )&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;        {&lt;/span&gt; &lt;span style="font-family:courier new;"&gt;&lt;/span&gt;&lt;span style="font-family:courier new;"&gt;        }&lt;/span&gt; &lt;/span&gt;&lt;/blockquote&gt;Compare this will all the code we had to write in our ASP Web application.&lt;br /&gt;&lt;br /&gt;In the confirm method, all we need to do is to return an object in the actionResult, which contains&lt;br /&gt;details of the product and quantity set in the previous page. The complete code of the confirm method is&lt;br /&gt;&lt;br /&gt;&lt;blockquote  style="color: rgb(153, 102, 51);font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;        public ActionResult Confirm(string product, string quantity )&lt;br /&gt;      {&lt;br /&gt;          string productName = string.Empty;&lt;br /&gt;          var products = from p in db.Products where p.ProductId == int.Parse(product) select p;&lt;br /&gt;          if (products != null)&lt;br /&gt;          {&lt;br /&gt;              foreach (Product p in products)&lt;br /&gt;              {&lt;br /&gt;                  productName = p.ProductName;&lt;br /&gt;                  break;&lt;br /&gt;              }&lt;br /&gt;          }&lt;br /&gt;          Dictionary&lt;string,string&gt; dict = new Dictionary&lt;string,string&gt;();&lt;br /&gt;          dict.Add("product",product);&lt;br /&gt;          dict.Add("productName", productName);&lt;br /&gt;          dict.Add("quantity", quantity);&lt;br /&gt;          return View( dict );&lt;br /&gt;       }&lt;br /&gt;&lt;/string,string&gt;&lt;/string,string&gt;&lt;/span&gt;&lt;/blockquote&gt;As you can see, the method returns the actionResult with a Dictionary object, containing all the information needed by view. The confirm.aspx page (view) would display this method and show a confirm button, which will set the action to "CreateOrder". The listing of confirm.aspx page is shown below:&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(153, 102, 51);font-family:courier new;" &gt;&lt;/span&gt;&lt;/span&gt;&lt;blockquote&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(153, 102, 51);font-family:courier new;" &gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="false" Inherits="System.Web.Mvc.ViewPage" Codebehind="~/Views/Home/Confirm.cs" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Import Namespace="QuickShop" %&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" &amp;gt;&lt;br /&gt;&amp;lt;head runat="server"&amp;gt;&lt;br /&gt;   &amp;lt;title&amp;gt;Quick Shop&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;   &amp;lt;h1&amp;gt; Confirm your order...&amp;lt;/h1&amp;gt;&lt;br /&gt;   &amp;lt;div&amp;gt;&lt;br /&gt;       &amp;lt;%&lt;br /&gt;           Dictionary&amp;lt;string, string&amp;gt; values = (ViewData.Model as Dictionary&amp;lt;string, string&amp;gt;);&lt;br /&gt;       %&amp;gt;&lt;br /&gt;       You have chose to buy &amp;lt;b&amp;gt;&amp;lt;%=values["quantity"]%&amp;gt;&amp;lt;/b&amp;gt; pieces of &amp;lt;B&amp;gt;&amp;lt;%=values["productName"]%&amp;gt;&amp;lt;/B&amp;gt;. Are you sure?&lt;br /&gt;       &amp;lt;form method="post" action="/Home/CreateOrder"&amp;gt;&lt;br /&gt;           &amp;lt;input type="hidden" name="product" value="&amp;lt;%=values["product"]%&amp;gt;"/&amp;gt;&lt;br /&gt;           &amp;lt;input type="hidden" name="quantity" value="&amp;lt;%=values["quantity"]%&amp;gt;"/&amp;gt;&lt;br /&gt;         &lt;br /&gt;           &amp;lt;input type="submit" value="confirm /&amp;gt;&lt;br /&gt;       &amp;lt;/form&amp;gt;&lt;br /&gt;   &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="color: rgb(153, 102, 51);font-family:courier new;" &gt;&lt;/span&gt; &lt;/span&gt;&lt;/blockquote&gt;Now, the last bit of detail needed in our MVC application is to create a method for CreateOrder in the HomeController. This method again takes two parameters -same as the input submitted through the HTML form. The method would create a new order record in the database and then redirects the view back to Index page.&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;blockquote style="color: rgb(153, 102, 51);"&gt;        public ActionResult CreateOrder(string product, string quantity)&lt;br /&gt;      {&lt;br /&gt;          Order newOrder = new Order();&lt;br /&gt;       &lt;br /&gt;          newOrder.OrderDate = DateTime.Now;&lt;br /&gt;          newOrder.ProductId = int.Parse(product);&lt;br /&gt;          newOrder.Quantity = int.Parse(quantity);&lt;br /&gt;          db.Orders.InsertOnSubmit(newOrder);&lt;br /&gt;          db.SubmitChanges();&lt;br /&gt;&lt;br /&gt;          return RedirectToAction("Index");&lt;br /&gt;      }&lt;br /&gt;&lt;/blockquote&gt;&lt;/span&gt;The complete listing of the quickshop application using MVC can be downloaded from this &lt;a href="http://www.4shared.com/account/file/89340035/3fd4af31/QuickShop.html"&gt;link&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="color: rgb(0, 0, 102); font-weight: bold;"&gt;Conclusion&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;I hope that the example, although overly simplistic, would have helped you in understanding how MVC framework simplifies using the MVC design pattern in the asp.net web applications. The framework does a lot of plumbing work for in getting and setting data from HTTP posts. For its functionalty the MVC framework uses it's own HTTPHandler.&lt;br /&gt;&lt;br /&gt;In my next post, I will write about what happens behind the scenes in MVC framework and how does it work internally.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-6511684926089853635?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/6511684926089853635/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=6511684926089853635' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/6511684926089853635'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/6511684926089853635'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/02/aspnet-mvc-framwork-part-2.html' title='ASP.net MVC Framwork Part 2'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_s7COYMZ4cc0/SaSxjNt7v8I/AAAAAAAABLY/xTs5oe8u54A/s72-c/db.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-7914976867127768833</id><published>2009-02-15T19:23:00.013Z</published><updated>2009-03-19T16:32:02.951Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft MVC framework'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft .Net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.Net'/><title type='text'>ASP.net MVC Framwork</title><content type='html'>I remember from early days of my career, when I was working on Microsoft ASP 3.0 technology, keeping a separation of business and presentation logic was quite a challenge. Although, the critical business logic was often coded in COM components, which were called from ASP Page, but the ASP Page would still contain certain logic on which component to call and how the process flow in the application would happen. The resulting ASP files were often a horrid mesh of server side VB Script portions, client side javascript portions and HTML/DHTML to render a page.&lt;br /&gt;&lt;br /&gt;To put some method to madness, and to achieve some separation of presentation and business logic, I was taught to create each ASP page with a “Main” method in it, called in the first command of the page. The Main method would provide a single point of entry to the page and used to look like&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;&lt;% &lt;/span&gt; &lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;Call Main&lt;br /&gt;&lt;br /&gt; &lt;/span&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;Sub Main&lt;/span&gt;&lt;br /&gt;                   &lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;Select _pageMode:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;                                    &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;Case ADD_MODE&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;: &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;                                      &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;'code to show the form in add mode &lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;                                    &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;Case INSERT_MODE&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;: &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;                                      &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;'code to add records&lt;/span&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;                                    &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;Case EDIT_MODE&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;: &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;                                      &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;'code to add record Case &lt;/span&gt; &lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;EDIT_MODE&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;                                    &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;Case UPDATE_MODE&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;: &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;                                      &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;'code to update records&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;                                    &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;.....&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;                                    &lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;.....&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;              &lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;End Select&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;  &lt;/span&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;End Sub&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;%&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;span style="color: rgb(204, 102, 0);font-family:courier new;" &gt;&lt;br /&gt;&lt;br /&gt;....&lt;br /&gt;....&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-size:85%;"&gt;&lt;br /&gt;&lt;/span&gt;So, what we had was essentially identification of action at the start of page and then business logic to do specific work for that action. The presentation of page would follow after all the server side script was executed. If there were any server side scriptlets in the HTML section, they were used just to present data.&lt;br /&gt;&lt;br /&gt;As then, the separation of presentation and essential business logic is still identified as one of the salient features of application maintainability. And the Model View Controller pattern has fast become one of the most popular ways of achieving this.&lt;br /&gt;&lt;br /&gt;The advent of ASP.Net saw the whole programming model of working with ASP pages to a more event driven structure. Certain events are fired are certain stage of a page’s execution. To do something similar in ASP.Net, an ordinary developer would identify the event where the code to handle the specific action needs to be written and then write down the code in the handler of that event. This model, along with the code behind ability of ASP.Net provides separation of presentation logic from business logic, but the code is still driven by view.&lt;br /&gt;&lt;br /&gt;The purists would argue that in a real MVC pattern, the Controller controls the process flow and maps “actions” to appropriate “processes”. In other words, it would gather the action done by the user on the view, determine the state of application and then invoke the appropriate model.&lt;br /&gt;&lt;br /&gt;The new &lt;a href="http://www.asp.net/mvc"&gt;Microsoft MVC framework&lt;/a&gt;, recently released by Microsoft is a lovely initiative to allow you to use the MVC framework without doing zillions of line of code. It also provides an alternative “off the shelf” approach to designing web applications for people who do not wish to use the server components, Post Backs, View state, etc.&lt;br /&gt;&lt;br /&gt;In my next post, I will write about using MVC pattern in a simple ASP.Net web application and demonstrate how simple it is to do so with the ASP.Net MVC framework. Also, you will be surprised to note, how similar our controller would be the above mentioned template that was suggested for ASP.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-7914976867127768833?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/7914976867127768833/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=7914976867127768833' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/7914976867127768833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/7914976867127768833'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/02/aspnet-mvc-framwork.html' title='ASP.net MVC Framwork'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-6070408699745491374</id><published>2009-02-11T13:55:00.002Z</published><updated>2010-01-09T23:14:00.240Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft .Net'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Reading X509 Certificates from remote machines</title><content type='html'>Today, I got to write some code to read X509 certificates remotely from machines on local network. The requirement was to read certificates installed in certificate stores on remote machines and verify whether or not they have expired.&lt;br /&gt;&lt;br /&gt;It may sound trivial but I found that it was not possible to do it using classes in the System.Security.Cryptography.X509Certificates namespace. For some reason, Microsoft have not included support to read remote certificate stores from the X509Store class, which otherwise makes working with X509 really easy.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:130%;"&gt;&lt;span style="font-weight: bold; color: rgb(0, 0, 102);"&gt;Reading Certificates from local machine&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;If you want to read certificates locally on your machine, the X509Store class is very useful and you can read and manipulate certificates with minimal code, as shown below:&lt;br /&gt;&lt;br /&gt;&lt;div  style="text-align: left;font-family:courier new;"&gt;&lt;span style="font-size:85%;"&gt;                &lt;span style="color: rgb(102, 0, 0);"&gt;X509Store store = new X509Store(StoreName.My, StoreLocation.LocalMachine);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;                try&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;                {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;                    store.Open(OpenFlags.ReadOnly);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;                }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;                catch (Exception ex)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;                {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;                    throw new Exception("Error opening certificate store", ex);&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;                }&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;                foreach (X509Certificate cert in store.Certificates)&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;   /// do whatever you want to read with certificate here&lt;/span&gt;&lt;br /&gt;&lt;span style="color: rgb(102, 0, 0);"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;The X509Store can open with &lt;span style="font-style: italic;"&gt;OpenFlags.Readonly&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;OpenFlags.ReadWrite&lt;/span&gt; option. The StoreLocation can be S&lt;span style="font-style: italic;"&gt;toreLocation.LocalMachine&lt;/span&gt; or &lt;span style="font-style: italic;"&gt;StoreLocation.CurrentUser&lt;/span&gt; and the StoreName can be any of the 8 different options.&lt;br /&gt;(StoreName.My is equivalent to Personal certificate store that you will see when you open Certificates from MMC Console)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(0, 0, 102);font-size:130%;"&gt;&lt;span style="font-weight: bold;"&gt;Reading Certificates from remote machine&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;One way to do it is to use directory services and find out the certificates of remote machine using DirectorySearcher and DirectoryEntry class in the System.DirectoryServices namespaces. This is described in the blogpost &lt;a href="http://geekswithblogs.net/shahed/archive/2007/03/11/108474.aspx"&gt;Get X509Certificate2 from a LDAP Server or Remote Machine&lt;/a&gt;. I found it a bit of overkill.&lt;br /&gt;&lt;br /&gt;Another way to do it is to use the old &lt;a href="http://msdn.microsoft.com/en-us/library/ms995332.aspx"&gt;Microsoft CAPICOM&lt;/a&gt; COM APIs. This requires that the CAPICOM ActiveX controls be installed along with the application and the CAPICOM APIs be p/invoked from your managed code. The most obvious downside of this is that the whole CAPICOM SDK would needs to be installed and distributed with your application.&lt;br /&gt;&lt;br /&gt;The best option that I found was to use the ever reliable &lt;a href="http://msdn.microsoft.com/en-us/library/aa376559%28VS.85%29.aspx"&gt;CertOpenStore&lt;/a&gt; windows API. The API is very powerful and if you have some experience with Windows programming and using P/Invoke to call windows API, the code would be most simple and straightforward for you to work with. Of course, the best practice is to encapsulate it in a class and make the P/Invoke hidden from the rest of the application&lt;br /&gt;&lt;br /&gt;The following class would do it for you. For illustration purposes, I have used the classes from the System.Security.Cryptography.X509Certificates namespace. You can do the same using only the APIs and not given computer name at all in the last parameter.&lt;br /&gt;&lt;br /&gt;&lt;span style="color: rgb(153, 0, 0);font-size:85%;"&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    using System.Security.Cryptography;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    using System.Security.Cryptography.X509Certificates;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    using System.Runtime.InteropServices;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    public enum CertStoreName&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; MY,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; ROOT,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; TRUST,&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; CA&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    public class CertStoreReader&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;    {&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        #region P/Invoke Interop&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; private static int CERT_STORE_PROV_SYSTEM = 10;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; private static int CERT_SYSTEM_STORE_CURRENT_USER = (1 &lt;&lt; 16);&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; private static int CERT_SYSTEM_STORE_LOCAL_MACHINE = (2 &lt;&lt; 16);&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; [DllImport("CRYPT32", EntryPoint = "CertOpenStore", CharSet = CharSet.Unicode, SetLastError = true)]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;         public static extern IntPtr CertOpenStore(int storeProvider, int encodingType, int hcryptProv, int flags, string pvPara);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; [DllImport("CRYPT32", EntryPoint = "CertEnumCertificatesInStore", CharSet = CharSet.Unicode, SetLastError = true)]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; public static extern IntPtr CertEnumCertificatesInStore(IntPtr storeProvider, IntPtr prevCertContext);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; [DllImport("CRYPT32", EntryPoint = "CertCloseStore", CharSet = CharSet.Unicode, SetLastError = true)]&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; public static extern bool CertCloseStore(IntPtr storeProvider, int flags);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        #endregion&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;&lt;br /&gt;&lt;br /&gt;public string ComputerName { get; set; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        private readonly bool isLocalMachine;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        public CertStoreReader(string machineName)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;             ComputerName = machineName;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  if (machineName == string.Empty)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   isLocalMachine = true;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  else&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   isLocalMachine = string.Compare(ComputerName, Environment.MachineName, true) == 0 ? true : false;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        public X509Certificate2Collection GetCertificates(CertStoreName storeName)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; X509Certificate2Collection collectionToReturn = null;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; string givenStoreName = GetStoreName(storeName);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; if (givenStoreName == string.Empty)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  throw new Exception("Invalid Store Name");&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; if (isLocalMachine)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  X509Store store = new X509Store(givenStoreName, StoreLocation.LocalMachine);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  try&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   store.Open(OpenFlags.ReadOnly);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  catch (Exception ex)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   throw new Exception("Error opening certificate store", ex);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  collectionToReturn = store.Certificates;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; else&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  try&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   IntPtr storeHandle = CertOpenStore(CERT_STORE_PROV_SYSTEM, 0, 0, CERT_SYSTEM_STORE_LOCAL_MACHINE, string.Format(@"\\{0}\{1}", ComputerName, givenStoreName));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                      if (storeHandle == IntPtr.Zero)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                      {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;     throw new Exception(string.Format("Cannot connect to remote machine: {0}",  ComputerName));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                      }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   IntPtr currentCertContext = IntPtr.Zero;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   collectionToReturn = new X509Certificate2Collection();&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   do&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;     currentCertContext = CertEnumCertificatesInStore(storeHandle, currentCertContext);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;                            if (currentCertContext != IntPtr.Zero)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;     {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;       collectionToReturn.Add(new X509Certificate2(currentCertContext));&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;     }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   while (currentCertContext != (IntPtr)0);&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   CertCloseStore(storeHandle, 0);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  catch (Exception ex)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   throw new Exception("Error opening Certificate Store", ex);&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;             }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;             return collectionToReturn;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;        }&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; private static string GetStoreName(CertStoreName certStoreName)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  string storeName = string.Empty;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  switch (certStoreName)&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;  {&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   case CertStoreName.MY:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      storeName = "My";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      break;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      case CertStoreName.ROOT:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      storeName = "Root";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      break;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      case CertStoreName.CA:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      storeName = "CA";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      break;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      case CertStoreName.TRUST:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      storeName = "Trust";&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;      break;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;   return storeName;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt; }&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:courier new;"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-6070408699745491374?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/6070408699745491374/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=6070408699745491374' title='8 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/6070408699745491374'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/6070408699745491374'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/02/reading-x509-certificates-from-remote.html' title='Reading X509 Certificates from remote machines'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>8</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-6444629634335792817</id><published>2009-01-20T22:58:00.001Z</published><updated>2009-03-19T16:33:49.836Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Personal'/><title type='text'>Hope for a change...</title><content type='html'>Today is a big day in US history as &lt;a href="http://en.wikipedia.org/wiki/Barack_Obama"&gt;Barak Obama&lt;/a&gt; takes oath. I haven't seen such anticipation and media hype for anyone sworning in. I think the hype around this one has as much to do with the departure of a highly unpopular president as with the arrival of a charasmatic and popular Obama. Let's hope that this marks a change for betterment and the new president is more listening and less defiant and that he put his focus on attaining peace in the world.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-6444629634335792817?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/6444629634335792817/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=6444629634335792817' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/6444629634335792817'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/6444629634335792817'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/01/hope-for-change.html' title='Hope for a change...'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-2487113862263404045</id><published>2009-01-14T16:17:00.001Z</published><updated>2009-03-19T16:34:04.563Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Personal'/><title type='text'>welcome 2009!!</title><content type='html'>It's been a while since I blogged. We have had Christmas and New Year in between and 2009, with its own set of twists and turns, is well underway. Reflecting back on 2008, it was a year of consolidation for me. I got married, moved into a our own house and have generally settled down nicely. Unlike 2006 and 2007 my career growth in 2008 had a more horizontal feel to it. This year started with a promotion, so not all the good work done last year was lost. I have also made a resolution to start something outside work this year.&lt;br /&gt;&lt;br /&gt;Talking about the current economic climate, things have turned for a worse at the start of this year. Woolworths, about which I wrote in my previous post, does not exist in more. Morever, some other big names like MFI, Officers Club, Whittard of Chelsea, Morgan and most recently Land of Leather have gone to administration. These draw a gloomy picture in the retail sector. Banking and Car manufacturing industries have also announced thousands of job cuts. Today I found this link &lt;a href="http://www.telegraph.co.uk/finance/financetopics/financialcrisis/3542572/Financial-crisis-UK-job-losses.html"&gt;http://www.telegraph.co.uk/finance/financetopics/financialcrisis/3542572/Financial-crisis-UK-job-losses.html&lt;/a&gt; on Daily Telegraph, which draws the job losses in UK since Oct 2008 on a map. Frightening stuff!!&lt;br /&gt;&lt;br /&gt;Having said, quite a few of positives can be taken from this "Credit Crunch". Firstly, hopefully now people will know the consequence of spending beyond their means albeit in a hard way. I am a firm believer in fundamentals and the very basic principle of economics is if your earn £1 and spend £1.10, sooner or later you will be in trouble. The other good thing is that people would more "earn" their wages. With more people and fewer jobs, only the fittest can survive. It's not such a bad thing. Ever since I have moved into UK, I have always had a feeling that most youngster get it too easy here. With a strong economy and strong social system, youngster with some potential do not have to work that hard to get a life, which youth of many other countries dream of. With a strong economy and strong social system, youngster with some potential do not have to work that hard to get a life, which youth of many other countries dream of. Ask an Indian and he will tell you what it takes to get into &lt;a href="http://en.wikipedia.org/wiki/Indian_Institutes_of_Management/"&gt;IIM&lt;/a&gt; in India. I am told three hundred thousand students compete to get thirteen hundred seats.&lt;br /&gt;&lt;br /&gt;That is a a bit extreme but i would more like to see people around the world competing on equal grounds. That would surely mean a more fairer world for everybody.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-2487113862263404045?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/2487113862263404045/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=2487113862263404045' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/2487113862263404045'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/2487113862263404045'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2009/01/welcome-2009.html' title='welcome 2009!!'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-5135277730857054999</id><published>2008-12-17T23:40:00.001Z</published><updated>2009-03-19T16:34:17.147Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Personal'/><title type='text'>The crunch have us !!!</title><content type='html'>Unless you have been stuck in a far away deserted island or been slumbering like Rip Van Winkle, you would surely have heard about the ongoing &lt;a href="http://en.wikipedia.org/wiki/Credit_crunch"&gt;Credit Crush&lt;/a&gt;. It is unique in that it is truly global, effects all of us and in a way challenges the very basics of modern economics.&lt;br /&gt;&lt;br /&gt;So far, it was the bankers and related industries who faced the wrath of credit crunch. Banking giants like &lt;a href="http://en.wikipedia.org/wiki/Lehman_Brothers"&gt;Lehman Brothers &lt;/a&gt;and &lt;a href="http://en.wikipedia.org/wiki/Merrill_Lynch"&gt;Merrill Lynch&lt;/a&gt; succumbed to the dramatic change in investment climate. But then they were bankers who make money out of taking risks. I mean these are a bunch of clever cookies who make money through astute investments and taking calculated risks.&lt;br /&gt;&lt;br /&gt;Today, for the fist time I saw the very visible face of credit crunch - by visiting the local&lt;br /&gt;&lt;a href="http://en.wikipedia.org/wiki/Woolworths_Group_plc"&gt;WoolWorths&lt;/a&gt; store. It's arguably the most visible casualty of credit cruch and would remind us of the times we live in everytime we visit the high street - A century old high street chain a source of income to some thirty thousand, mostly unskilled, people would cease to exist from as soon as early Jan next year.&lt;br /&gt;&lt;br /&gt;I am used to finding Woolworths on every high street and almost always shop from there for all my little nephews &amp;amp; neices. Have always found the staff cordial and the ambiance inviting. But, it wasn't the case today. There weren't any smiles, the staff were visibly distressed, some even shattered, the stores bore resemblance to a warfare after the bargain hunters' onslaught.&lt;br /&gt;&lt;br /&gt;My heart sagged - for the diligent workers who were in this situations because of decisions made by someone else - probalby in a boardroom. In the quest of growth and ever more profitability, the very fundamentals of  sustainability were overlooked.&lt;br /&gt;&lt;br /&gt;I wish all this would not have happened. None of the workers working there deserve this. For me this is the first real human factor of credit crunch!!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-5135277730857054999?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/5135277730857054999/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=5135277730857054999' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/5135277730857054999'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/5135277730857054999'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2008/12/crunch-have-us.html' title='The crunch have us !!!'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9108944828477346591.post-8286854196432452746</id><published>2008-12-13T14:03:00.001Z</published><updated>2009-03-19T16:34:28.948Z</updated><category scheme='http://www.blogger.com/atom/ns#' term='Personal'/><title type='text'>Opening up...</title><content type='html'>It's my third attempt to blog. The previous two attempts where thwarted by my efforts to blog on a particular topic and also my tries not to divulge too much details about my personal life. I guess that didn't work. There's so much going around us in these times we live in. I feel obliged to write about them. I will also attempt to include some work related technical posts related to what I do at work.&lt;br /&gt;&lt;br /&gt;If you don't already know me, I am an Pakistani expatriate living in Britain. Pakistani I am by heart and soul and half a decade of living away from homeland hasn't changed that. I am a software consultant by profession and work with a global consultancy in London. This was a a brief introduction to break the ice, my next blog would be about &lt;a href="http://en.wikipedia.org/wiki/Credit_crunch"&gt;Credit Crunch&lt;/a&gt; and how it is effect the life of people in London.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9108944828477346591-8286854196432452746?l=hamidshahid.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://hamidshahid.blogspot.com/feeds/8286854196432452746/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9108944828477346591&amp;postID=8286854196432452746' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/8286854196432452746'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9108944828477346591/posts/default/8286854196432452746'/><link rel='alternate' type='text/html' href='http://hamidshahid.blogspot.com/2008/12/opening-up.html' title='Opening up...'/><author><name>Hamid</name><uri>http://www.blogger.com/profile/10465713442151551945</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
