What are you doing Oct. 7th?

Tuesday, September 30 2008         No Comments

If the answer is "working" then perhaps you missed the announcement that Microsoft is hosting both of its FREE quarterly events on that day: MSDN Unleashed and ArcReady.  Both events will be held at the Microsoft office in Mason.

ArcReady will start the day off with Brian Prince talking about how to architect the modern distributed application (think cloud computing and services).  This is from 9:00 AM to 11:30 AM.

MSDN Unleashed (previously known as DevCares) will be given by Bill Steele and will include topics on Introductory WPF, what's new in VS 2008 SP1 and the .NET Framework 3.5.  MSDN Unleashed is from 1:00 PM to 4:00 PM.

Here's a link to register:

  • The ArcReady  at: http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032385969&EventCategory=1&culture=en-US&CountryCode=US
  • MSDN Unleashed at: http://msevents.microsoft.com/CUI/EventDetail.aspx?EventID=1032386201&Culture=en-US
  •  

    Remember that these events are FREE and are hosted at the Microsoft office.  If you need to "sell" this to your boss to let you go then make sure they understand that the events are free and given by Microsoft representatives/employees.  This is technical knowledge from the source.

    Can't You Even Spell Your Own Company's Name?!

    Monday, September 01 2008         No Comments

    Another quick story from this last week's upgrade from VS 2005 to VS 2008.  I ran code analysis from 2008 on the code base and started to get spelling warnings all over the place.  The amusing thing was that it was telling me that the name of the company, which is in the namespace, was spelled wrong.  My initial reaction was, "Good grief" (said with the best Charlie Brown imitation I could muster...which still wasn't very good).

    A quick Google session later and I've got the information I need to teach Code Analysis the way the company spells its own name (or at least abbreviates it).  Check out how to add your own custom dictionaries to your projects courtesy of the VS Code Analysis Team

    Side Note: It looks like they are still releasing updates to FxCop.  Version 1.36 was released on August 19th.

    A Caution on Upgrading to VS2008 for MSTest

    Monday, September 01 2008         No Comments

    At my current client we use MSTest as our testing framework.  Last week I was updating a solution that contained a few unit test projects from VS 2005 to VS 2008.  The project upgrade wizard ran and everything compiled just fine.  I ran the Unit test suite and noticed that several unit tests failed.  I looked at the first test and noticed that it had an Assert.Inconclusive() operation in it at the end.  Shouldn't that mark the test as inconclusive and not failed?  Odd.

    The next oddity was that any test that had an ExpectedException attribute was failing indicating that the very exception I was looking for had been thrown.  It was as if MSTest decided to completely ignore the ExpectedException attribute.  Okay, now that's double odd.

    I tried creating a simple unit test in the existing test project that did nothing more than throw an exception and added the ExpectedException attribute.  It still failed to notice the exception and instead reported the test as a failure. 

    One of the FTEs at the client used his VS2008 to generate the same simple unit test and it passed just fine.  After that, I created a new unit test project and tried the same test on my box, also with a pass.  At this point we decide it must have been something with the upgrade.  After looking around on Google for a while I happen across this blog post by Joni Moilanen from Finland.  Apparently the upgrade did not modify the version of the UnitTestFramework assembly the test project was using, it was still set to reference the 8.0 version.  Once I updated it to point to the 9.0 version everything was ducky. 

    I understand the upgrade wizard not attempting to decide to update references for you on your projects, but I can also see where this type of reference should have been updated.  Especially if the tests aren't going to work under the newer IDE.

    Lesson Learned: When you upgrade your MSTest projects to VS 2008 make sure to manually update the references to the Microsoft.VisualStudio.QualityTools.UnitTestFramework assembly to 9.0 as well.

    TFS Screencasts

    Saturday, August 30 2008         1 Comment

    SDS, the company I work for, has started fostering Tech Specialists positions.  These are positions in which one of our consultants chooses to become intimately familiar with a specific technology or product.  Ryan Cromwell has become our TFS Tech Specialist.  He's currently creating the guidelines for how SDS should use TFS as a company (for when we run our internal projects or remote projects).  As part of these guidelines Ryan is producing 10-minute long "How To" screencasts.  He's posting these out on his blog and hosting them from Silverlight Streaming. 

    You can check out the first screencast, "Creating a Team Project".  Note that some of the instructions he gives are specific to how SDS is handling their projects and Team System setup.  For example, we have a very open team structure, so all contributors have full access to the team project do perform any operation (other than delete the project).  Some organizations may not want to be that free with their permissions.

    devLINK Summary

    Saturday, August 30 2008         No Comments

    Last weekend was the devLINK 2008 conference in Murfreesboro, TN.  This was an awesome conference.

    A lot of people have already put up their take on the conference, but for me, the Open Spaces made the event.  There were a lot of great conversations.  The essence of some of these open spaces sessions were captured on a new wiki that sprang up after the event.  I hope to see this wiki grow in the future as we have more open space events.  It would also be cool if we could flesh out more of the notes that were taken since some of it only makes sense if you were there.

    I ended up only attending one "eyes front" presentation and that was Keith Rome's talk on Parallel Computing in .NET.  I had two reasons for attending this: 1) I have an interest in this topic and 2) I was giving a PLINQ session the next day so I wanted to see what he would cover in his talk.  It was a very good talk.  I started to attend the deep dive into Silverlight but the projector was displaying a giant yellow blob on the screen so they moved us to a new room that was a little too small for everyone.  I decided to head back out to the Open Spaces and I walked in on an open space about Rules Engines which turned out to be pretty interesting.

    It was very cool to see respected names in the .NET Community walking around the conference and participating in the Open Spaces.  I saw both Richard Campbell, Ted Neward and Joe Stagner attending open spaces.  I was also very happy to see that Carl Franklin decided to record an impromptu DNR at the bar after the conference.  This episode gives a lot of information about what Open Spaces are all about from Alan Stevens (the guy responsible for Open Spaces at devLINK) as well as the insight of several of the attendees and speakers on the .NET community in the region.

    The DNR talks about two types of attendees for devLINK: the people who came for the eyes front presentations and the people who came for the Open Spaces.  Both styles of learning are valid and extremely helpful.  Sometimes you want to go to a presentation to get a lot of information about a topic or technology in a short amount of time.  It saves you time and research on your own and hopefully the speakers shares some really good gems with you.  On the other hand, if you want to have an open discussion about a topic with some really smart folks then the Open Spaces is a good way to get that.  If you attend an event that has Open Spaces I highly recommend at least attending one to see what the experience is like.  If you don't like that conversation you can always move on to another open space or head off to a presentation.

    As for my talk, I think it went pretty well.  I had about 20 people in the room and only one of them fell asleep (I think he was actually left over from the previous talk in that room, but I can't be sure). 

    Enough rambling; if you didn't attend devLINK this year I highly recommend trying to make it in 2009! 

    VS2008 Ships with Samples

    Saturday, August 30 2008         No Comments

    Did you know that Visual Studio 2008 has samples of code out of the box?  Well, if you choose to not remove them from the install that is.  You can reach these by clicking on the Samples menu item on the Help toolbar menu.  These include samples in VB.NET, C# and C++ for things like: LINQ, PInvoke, Yield, Data, generics, etc.  If you are new to .NET 3.5 this may be worth a look through.  I stumbled upon these as I was checking out LINQ to XML.  I didn't realize they were there.

    MSDN Unleashed and ArcReady

    Saturday, August 30 2008         No Comments

    The next set of Microsoft free events in the area will be on Oct. 7th.  Check out the announcement on CINNUG's blog: http://cinnug.org/blog/archive/2008/08/30/arcready-and-msdn-unleashed-events-on-oct-7th.aspx

    PSS #3: Using PS to help get a list of changes from TFS

    Saturday, August 09 2008         No Comments

    My PowerShell Snippet this time comes from a little frustration I had with TFS this week.  I wanted to find a list of all the files that had changed within a branch.  Through the UI I couldn't find out how to get that list easily.  I could go to the top level folder in the source control window for the project I was interested in and get the history, but it would show me a list of all the changesets.  To get the actual files modified I would have had to open each changeset and get the list of files.  This would have been tedious since I would have had to go through MANY changesets (that's what checking in changes often will get you ;) ).

    Mike Shields (resident TFS guru at the client I'm at) suggested looking at the command line tf.exe.  So, since the GUI makes you weak (and apparently can't do the task anyway) I switched to the command line tool and was able to pull the following command line together:

    tf history *.* /noprompt /format:detailed /recursive

    Note that I ran this from the VS 2008 Command Prompt tool so that the TF executable was in the path.  I added the /noprompt so that the results would be output to the console.  If you don't do that then the actual window will appear (which seems counter-intuitive that it is an opt-out model to not show a window when a command is called from the command line, shouldn't it be an opt-in model instead?).  I also had to include the /recursive switch and set the /format parameter to detailed.  Only the detailed format will show you the list of changed files, otherwise you get just the changeset name and comments.

    This produced somewhat of what I wanted, but there was a lot of extraneous text that didn't need to be included.  Also, it got ALL the history (which I expected), but that included the branch changeset where the code was branched so EVERY file in the branch was listed.  I needed a list of all files that had just been altered since the branch.  This is where PowerShell came in.

    tf history *.* /noprompt /format:detailed /recursive | Where-Object { $_ -match "[edit|add|delete]\W*\$.*$" } | sort -u > c:\temp\filesthatchanged.txt

    This time I opened PowerShell and ran the command from there.  You'll need to make sure that tf.exe is in the PATH or express the full path to it on the command line.  I use the same call as I did before, but this time I'm piping the results to a Where-Object cmdlet that uses a Regular Expression (the -match switch) that looks for a line that starts with edit, add or delete (which filters out the extraneous text and the branch), followed by some whitespace, followed by something that starts with a dollar sign.  That Where-Object cmdlet is going to get me my list of files from all the text the tf.exe history command is generating.  I then pipe that to a sort cmdlet with a unique switch to get only the unique file names that changed.  I then use a redirector to push that out to a text file.

    SWEET!  This saved me quite a bit of time from copying this list out of the UI.

    ________

    I will point out that VSS had this feature to get a list of all files changed by project, user and/or date range.  Not that I'm advocating using VSS, but I'd like "newer, faster, better" tools to not take away features I had previously.

    Simulating Email

    Wednesday, August 06 2008         No Comments

    Keith Brown on the Pluralsight Blog has a great example of how to simulate email functionality so that you aren't hitting a real SMTP service.  Just by using the configuration file you can drive the method which the System.Net.Mail uses to "send" the email.  For production and system wide integration testing this should be your SMTP delivery (network); however, for  local development you can switch to SpecifiedPickupDirectory.  This just dumps a .eml file out to the specified directory which you can then check for.  I wouldn't use this for automated unit testing unless I was specifically testing a mail component that was hitting the System.Net.Mail directly, but very handy for local development integration tests. 

    Agile Summer Camp, Sept 6th

    Wednesday, July 30 2008         No Comments

    Josh Holmes and Chris Woodruff are arranging a very unique event over the weekend of September 6th.  The Agile Summer Camp will be held in Brighton, MI at the Brighton Recreation Area.  You can look forward to a laid back, rustic weekend discussing software development and agile practices.  This sounds like a blast.  Check out the wiki for more information.