Blog Home  Home Feed your aggregator (RSS 2.0)  
.Net Jonesie - February, 2006
A simple programmers blog
 
# Tuesday, February 28, 2006
I've been tweaking a stored proc today and when using the new SQL 2005 Management Studio I spotted a new option in the query menu:  Client Stats.  When I execute the stored proc, I get a tab page with some interesting numbers.  The really usful thing is, if I execute the same query again - after tweaking the proc - I get to see multiple results side by side:
 
 
How cool is that!
Tuesday, February 28, 2006 2:57:27 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]   General | SQL  | 
# Monday, February 27, 2006
Plans are starting to come together for our Code Camp. There's a lot of work getting this organised, but it's starting to get exciting.  So far we have about a dozen sessions and speakers confirmed, talking on some interesting topics like AJAX, Ruby on Rails, WWF, SQL, Biztalk, Team System and more.
 
Registration for Code Camp will - hopefully - be available this week.  In the meantime, you can enjoy the chrome, created by Phil (The Genius) Cockfield.

 

Don't miss the great kiwi
Coding Getaway

Two days of hard core .Net programming demo's, workshops & discussions. Nothing but code.

Code Camp 2006, April 22/23,
Porirua Wellington


Brought to you by the NZ .Net User Group
Monday, February 27, 2006 4:18:17 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]   General | NZ .Net User Group  | 
# Friday, February 24, 2006
I've started working though the Hands-On-Labs for Windows Workflow Foundation today and in Lab 1, Excerise 1 (more about that later) I discovered something old that I had never existed before:  Event Accessors. 
 
Normally you would decalre an event like this:
 

    1 public event EventHandler<CancelEventArgs> ValidateControls;

 

 

Using Event Accessors makes this look a lot more like a property:

 

    1     public event EventHandler<CancelEventArgs> ValidateControls

    2     {

    3       add

    4       {

    5 

    6       }

    7       remove

    8       {

    9 

   10       }

   11     }

 

This could be useful to ... hmmm, I'm not exactly sure if I would use it, but I imagine some people would.

 

FYI, this also works in .Net 1.1.  Not sure about VB though.

Friday, February 24, 2006 8:59:21 AM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]   General  | 
# Thursday, February 23, 2006
I just noticed that Visual Studio gives you a nice little tooltip in the Solution Explorer to tell you who has a file checked out (or not).
 
 
Is this new?  I normally don't keep the mouse stationary long enough to see tooltips.
Thursday, February 23, 2006 1:24:03 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [1]   Visual Studio  | 
# Monday, February 20, 2006
I've been having a bit of a play with three 3rd party products for Team System, namely, TeamLook, TeamPlain and Teamprise.  This is not a review of these products, just some observations.
 
TeamLook
TeamLook integrates without Outlook to provide access to Work Items only.  It gives you a nice tree view of work items and you can create new work items from emails.  It looks promising but I found that Outlook was taking minutes to start-up with TeamLook loaded.  After removing TeamLook, Outlook starts up in about 2 seconds.
 
Teamprise
Teamprise is a J* client for TFS and provides work item and source control functionality for Eclipse or as a standalone client.  I don't know much about Eclipse but we do have a team using it for a large WebSphere project.  This does look promising but it doesn't go far enough yet.  There is no access to reports or documents or process guidance - you fall back to Sharepoint for this - which is fine, but TeamPlain is better.
 
TeamPlain
TeamPlain is a ASP.Net application that provides much of the same functionality as Team Explorer, but with a much richer UI.  With it you can view and create work items, view reports and documents, view source code with some limited source control interaction and pretty much do everything you need to do if you don't have Team Explorer.  For us, this means we can provide work item access to testers and users without having to install the TS Client.  I found the web access extremely fast - faster than the Team Explorer.  The UI is also very attractive and easy to use.  TeamPlain also authenticates users with Integrated Security if possible or using a standard login/password prompt.  This means we can provide external access to our repository without providing a VPN. 
 
In the future they will be providing Eclipse and VS2003 addins which will suit us very well.
 
Licensing of TeamPlain is not cheap, but they do have floating licenses and if you just need work item access then there will be a cheaper Lite version.
 
Summary
All of these products are still officially in beta, but TeamPlain is pretty much finished and just waiting for TFS RTM. Overall, I think TeamPlain provides the best performance and coverage of TFS functionality but I'd expect TeamPrise to improve when it's closer to release.  If you just need work item access then TeamLook is probably also worth a closer investigation.
Monday, February 20, 2006 9:27:27 AM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]   Team System  | 
# Wednesday, February 15, 2006
I'm jumping on the snippet bandwagon a bit late but this morning I realised I was repeating myself repeating myself repeating myself more than usual.  I am trying to figure out a bit of spaghetti I write a while ago that is getting events firing in the wrong order.  The logic is  bit too complex to step through so I'm adding tracing code and capturing this to a log file. 
 
Eg:
 

    1     private void fireModeChange()

    2     {

    3       Trace.WriteLine("Starting fireModeChange", "Designer");

    4       Trace.Indent();

    5       try

    6       {

    7         if (ModeChanged != null)

    8         {

    9           ModeChanged(this, new EventArgs());

   10         }

   11       }

   12       finally

   13       {

   14 

   15         Trace.Unindent();

   16         Trace.WriteLine("Ending fireModeChange", "Designer");

   17       }

   18     }

 
The time saving solution is to create a code snippet that surrounds the selected code with this block.  Creating a snippet is pretty easy when you've done it a few times, but to make things interesting I downloaded Snippy from GotDotNet.  It's a NLU (nice little utility) for creating snippet files.
 
 
Now surrounding the selected code is very easy.  Of course, it's taken me several hours of fracking about to get all this working and documented - but that's another blog post :}
Wednesday, February 15, 2006 12:01:20 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]   Visual Studio  | 
I've been pretty critical of GotDotNet in the past so I must now give credit where it is due.  The site is much faster, it seems more reliable and it even looks better.  I also find the menu's a lot easier to navigate.  The GDN team have done a great job.  Well done!
 
My only annoyance is that you often have to join a workspace community to download a tool or sample code, but I suspect this necessary for legal reasons or some such thing.
Wednesday, February 15, 2006 10:06:47 AM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]   General  | 
# Monday, February 13, 2006
Here's a few notes and tips from my TFS Server Upgrade experience.
  • Make sure you get the upgrade kit and read the instructions cover to cover before starting. 
  • You'll also need the updated install guide.  But be warned, you may not be able to view the contents of this.  See my rant in a previous post.
  • The upgrade guide is 43 pages long, but don't panic.  You can ignore some of this.  I have a single server install so I ignored the dual server upgrade instructions.
  • Read Rob Caron's blog.  There's a few links there to other peoples upgrade experience.
  • During the upgrade you need to create and delete Team Projects.  I found that TFSDeleteProject would not work on my client machine.  It kept telling me it could not find the server.  I suspect this was due to my TFS permissions or something funcky with our domain/AD setup.  I copied TFSDeleteProject to the server and, using remote desktop, logged in using the TFSService account and it then worked just fine.
  • You need to uninstall Beta 3 during the upgrade.  I have the Team Test Load Controller on our single server so I uninstalled that first just to be safe.  I didn't have Team Explorer on the TFS server so I didn't need to uninstall this.
  • After you install the TFS RC, you need to execute a web service method on http://localhost:8080/services/v1.0/Registration.asmx  and verify that the returned XML is correct.  This seems daft to me.  It should be something that is built into the install.
  • To upgrade the build types, you have to run the upgrade tool TFSBuildUpgrade on a machine that has the Team Explorer installed.  I didn't have this installed on my TF Server so I tried to run this on my build server but I got the same error as TFSDeleteProject - it could not see the TFS Server.  So, I installed the Team Explorer on the TF Server and ran the upgrade there without issue.
  • You have to install the Team Explorer on client machines. This sounds obvious but when you are working through the upgrade instructions it's not easy to spot when you should do this.  You should do it after you have installed all the servers.  If you try to use Visual Studio with the Beta explorer (like I did) it won't work.
The installation took me about 2.5 hours but I was very careful - this is a production system.  I would expect a full install from scratch (including SQL & Sharepoint Services) would take about the same time - maybe a little longer.  Overall, this was a pretty painless process and I think is more than good enough for a Version 1 product - at least for a single server install.  I'm being deliberatly cautious in my praise here as I have installed TFS a few times already. Someone installing for the first time may not find it as easy as I did.
 
I haven't had much time to play with the client yet, but here's a couple of things I noticed.
  • The Security & Permissions dialogs include some more informational tips:   



    This is a nice reminder for people. 
  • User names are now displayed instead of login names:

       
  • Reports are tidier and much more complete.
Now back to more boring work...

Monday, February 13, 2006 1:52:03 PM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]   Team System  | 
I understand that there is a lot of nasty stuff around on the web that may get onto my work machine and cause all sorts of problems, but really, sometimes I find Windows too protective.  For example, I downloaded an updated Compiled Help File for my TFS upgrade.  When I open the file I get this:
 
 
Well, ok, someone forgot to sign the file so this is reasonable and I can untick the option to hide this next time I open it.  However, when I click open I see this:
 
 
After a lot of head scratching, a colleague pointed me to this in the file properties:
 
 
Once Unblocked, the help contents display correctly.
 
I spend all day working with various versions of Windows and I can't figure this stuff out.  How the frack is an ordinary occasional PC user supposed to understand this BS?  This is a really good example of unintelligent design.  Maybe it's a consequence of the Windows UI that limits the amount of useful information that can be displayed to a user.  To me, it would be much more sensible to display the file differently so I can immediately see that there is a problem with it.  Eg.  Instead of displaying the short-cut thus:
 
 
it could look something like this:
 
 
I look forward to having a play with Vista very soon to see if it's any better.
Monday, February 13, 2006 11:43:15 AM (New Zealand Daylight Time, UTC+13:00)  #    Comments [1]   General  | 
# Thursday, February 09, 2006
I've been looking at some complex code that someone else wrote lately and trying to figure out how it all works (or doesn't actually).  I've been adding lots of Trace statements so I can more easily follow the flow of execution.
 
Now, I'm not sure if this is a problem for anyone else or just my addled brain but I found that Trace statements in my Web Service don't display in the Visual Studio Output window unless I step into the Web Service code from the WinForms client.  This is a real drag.  All I want to do is execute the application and later examine the process steps.
 
A simple workaround is to use the TextWriterTraceListener.  With this I can capture Trace output to a file and look at the results after execute.  You do this by adding the following section to your web.config:
 
<system.diagnostics>
 <
trace autoflush="true" indentsize="2"
>
  <
listeners
>
   <
add name="myListener"  type="System.Diagnostics.TextWriterTraceListener" initializeData="mywebapp.log"
/>
  </
listeners
>
 </
trace
>
</
system.diagnostics>
 
 
However, I also rediscovered that by default, Trace messages also get output via OutputDebugStr() and this can be viewed with a suitable Debug Viewer.  Eg:
 
 
This DebugView is free from SysInternals.com.  It captures Trace messages from .Net apps and any other apps that use OutputDebugStr(), which includes Windows.  There is one problem that I noticed immediately though.  Trace.Write() appears like Trace.WriteLine() so you may loose some of the nice formatting that you would get in a log file but I can live with this.
Thursday, February 09, 2006 9:19:04 AM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]   General | Visual Studio  | 
# Tuesday, February 07, 2006
According to Jeff Beehler - and he should know! - Team Foundatation Server RC 1 should be on MSDN very soon, like today.  If you haven't seen what's in this release then here's another post with some details.
 
At the moment I'm quite happy with Beta 3 Refresh.  It's working pretty well and is stable but I will definately be switching as soon as I can get the download.
Tuesday, February 07, 2006 10:48:59 AM (New Zealand Daylight Time, UTC+13:00)  #    Comments [0]   Team System  | 
Copyright © 2010 Peter G Jones. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: