mfLY! and MVC Part 1#
mfLY! for Visual Studio allows developers to build using many patterns, one of which is Model-View-Controller (MVC).  In this post I will focus on how the controllers load views in mfLY!.

One aspect of MVC in mfLY! I want to point out here is how navigation is handled.  In an MVC application it is the controller that decides what view to load, and mfLY! is no exception but it does it just a bit different. 

In mfLY! there are Workflow Directors and View Workflows.  If it helps think of these as a workflow controller and view navigation controllers.  Workflow Directors are responsible for controlling navigation between View Workflows.  View Workflow’s on the other hand control navigation between views.  So when an application starts it lets the Workflow Director choose what View Workflow to start and the View Workflow in turn decides what view to show.  Each action (i.e. button click) in the application that is registered with the View Workflow can trigger the View Workflow to load the next view.

View Workflows allow the developer to encapsulate different feature areas into a workflow.  An example of this may be having one application with an Inventory View Workflow and an Orders View Workflow.  Since views are decoupled from navigation they can be used across multiple workflows.

 

The Workflow Director creates each View Workflow on demand, but does have the ability to create all of the View Workflows at one time.

The View Workflows have a similar creation mechanism.  A View workflow can create views on demand, all at one, or one level ahead.  One level ahead means when a view is loaded the View Workflow analyzes the possible paths and creates all the views that could be the next view, this way the lag between views is less.  In many cases the best option is to create all the views for the workflow at once since a user will most likely be working in a feature area for a specific task.  Of course this all depends on how many views are in the View Workflow.

In a future post I will show how to leverage the mfLY! workflow engine to do business logic and much more.

Monday, November 10, 2008 12:23:21 AM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

SMTP Server Headaches and Solutions#
Recently Clydesdale Software deployed a new site which heavily leverages the sending of emails.

My first approach was to run our own smtp server which in the end turned out to be a headache with spam and blacklists.

Next, was using the clients existing smtp which they pay a service company for. This service company only allows so many emails to be sent each hour. So another no go.

The solution, redundant smtp servers and a pay for smtp server. The first attempt to send an email is done by AuthSmtp. AuthSmtp is an affordable service which makes it very easy to upgrade and downgrade your service level that is based on how many emails you send. The second smtp server is the one the client has that only allows so many emails per hour. And the secret sauce, Advanced Smtp Server which lets you define multiple smtp gateways and will try each one in order. It also uses a queue and the messages will be retried to send if a failure occurs.

Friday, October 31, 2008 7:09:31 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Migrating Access's DateValue to SQL Server#
Just came across a very annoying bug when migrating from Access to SQL Server.

Access's base date is December 31, 1899 which is represented by the serial number 1. If the existing queries are using the DateValue function this is very important.

SQL Server's base date is January 1, 1900 which is represented by the serial number 0.

So, when migrating from Access to SQL Server and the existing Access queries use DateValue you may have to do a hack around like I did, create user functions for DateValue and CDate that add 2 to the serial number.

You may ask, who cares if the float value of the datetime is off. Well, in this case there are people connecting via excel which also uses the DateValue function and expects the same base date as Access.

To recap, Access and SQL Server have different base dates and SQL Server is zero based while Access is one based.

Fun, Fun

Monday, October 20, 2008 7:44:16 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

New Toys - Apple TV#

I recently purchased an Apple TV to replace Netflix. So far I'm very pleased, not quite the selection of netflix but the convenience is awesome. I'm never sure when the urge to watch a movie or tv show will come up and now it does not matter.

The cost is a little pricey, $3.99 for a movie and $1.99 for tv shows. At those prices I could go broke pretty quick so I have to watch how much I use it. Everything should be a dollar cheaper; come on a $1.99 for an off air tv show...

All in all I do enjoy it, and they add more movies every day. If you are looking for a convenient way to watch/listen to movies, tv, pictures and music then this may be the ticket.

Saturday, May 17, 2008 2:02:54 AM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

I Think I'm in Love#

MacPro.png

Tuesday, May 13, 2008 3:16:53 PM (GMT Standard Time, UTC+00:00) #    Comments [1]  | 

 

Windows 2008 Backup and Restore#

In Windows 2008 the backup and restore comes with an option for a full backup which basically means it will take an image. This has come in very handy because I do not need any third party software now get an image and restore it on new hardware, like when my raptor hard drive unexpectedly crapped out.

Monday, May 12, 2008 1:54:13 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Choosing a Database Modeling Tool#

I have been using many different database modeling tools for SQL Server to figure out which one would work best for me. Some of the features I'm looking for are:

  • Quick table creation and editing
  • Easy and quick to add or edit relationships
  • Can create different schemas
  • Can generate a database script for specific schemas
  • Can compare model to an existing database and generate alter script
  • Can compare model to older version of model and generate alter script

In the past I have used Sybase's Power Designer Data Architect but now that I'm paying for it out of my own pocket it seems a bit too pricey. Power Designer is a complex tool to use that does a lot but is in need of some user experience expertise.

So I started cheap, not recommended. I first looked at Database Spy by Altova, not truely a database modeling tool in my mind because I can not generate the ddl needed to create the database out of the tool. There are some nice features of Database Spy like intellicrack sql editor and quick editing and exporting of data.

Next I tried Happy Fish. I really like this tool; the most user friendly interface of any tool I have used though it does lack on looks, no fancy color gradients here. Creating, changing and generating ddl for the model was breeze. There is only one feature missing in the product which made me not choose it, there is no support for generating alter scripts from and existing database or an older version of the model. I was really disappointed when I found this for two reasons, one the tools is just so easy to use it is almost fun (I said almost) and two, it has a compare with database feature which had my hopes up but it falls short.

In the lineup next was DDS-Pro by Chilli Source. Did not expect too much from this product and did not get much, I think I had it installed all of 15 minutes before I was already convinced it did not meet my needs. It did however leave behind a nice present in my system32 directory, an old version of sqlcmd which then broke my database build because the "-S" did not exist long ago.

And now I can stop looking as I have found the affordable database modeling tool, ModelRight. This tool is not as easy to use as Happy Fish but works fine none the less. The big feature for me is being able to compare the current model with a database or an older version of the model and generate an alter script. This is a fairly common task when maintaining or extending existing software, which in my mind makes any database modeling tool that does not do it worthless.

Saturday, May 10, 2008 9:35:41 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Running Projects using OnTime#

I have chosen to use Axosoft's OnTime software to help manage projects. This is a very powerful and adaptable piece of project management software with many strong features. My biggest reason for choosing OnTime over FogBugz was the user interface was more intuitive to the business user. I like to get the business involved as much as possible on projects and if they can not figure out how to use the software then it is the wrong tool for the job. Personally I think FogBugz does some things very well and in a lot of ways allows a knowledagble user to be very efficient using it but the fact remains that the learning curve is too steep for business users to use it, they just do not have time to sit down and learn it.

Honestly there is almost to much out of the box with OnTime so I simplified it. Out of the box it comes with separate areas for features, defect, tasks, incidents and a wiki. I chose to turn off the defects and tasks and rename features to backlog items. I also added a custom field for backlog item type which can be scenario, feature, defect, or task. The reason I did this is I like working from one prioritized list and it just simplifies the whole process. I have also modified the workflow process each backlog item goes through (another great feature of OnTime).

There are many more customization that I may do in the future but this is my first pass through OnTime and it is working pretty good so far. There is also developer sdk which I'm actually using on one project to call the OnTIime web service to submit incidents from a web site. Incident is something else I preferred to change and call them tickets instead.

While I am happy with OnTime there is a downside, it is slow. Not slow enough that I will not use it but noticeably slower than FogBugz.

Monday, May 05, 2008 2:31:19 AM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Back to Blogging, Finally!#

It has been a while since I blogged and there is a reason for that. A lot has changed in a very short time for me. Our family grew with the addition of Chloe and starting my own company Clydesdale Software.

It has been a great time with Chloe, she started sleeping through the night at three weeks which frankly concerned us at first but now is a blessing in disguise. Chloe is full of smiles and very talkative, it seems like she really wants to be part of any conversation. All I gotta say is I'm not paying the cell phone bill when she is older:)

Business is going well, sometimes too well. While I welcome all the business I'm sure my wife would be happy with less since I'm working all the time. There are some very exciting things I have been working on which I will be sharing some information on shortly.

Thats all for now.

Monday, May 05, 2008 2:05:19 AM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Thanks for the heads up MSN Messenger!#

MSNOther.jpg

Thursday, February 21, 2008 2:59:48 AM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Is Gigabit Ready for the Consumer?#

After purchasing two consumer grade gigabit switches, the NetGear GS108 and the Linksys SD2008, and having them both fail I really started to think if gigabit was ready for the consumer. I would have to say from my experience with consumer grade gigabit switches that it is definitely not ready for prime time.

The good news is as a consumer you can still have gigabit, you just may pay a little bit more for it. I would recommend purchasing business class switches. The switches I'm using are the Dell PowerConnect 2708 which I'm very impressed with thus far; though it does not take much to impress me at this point, staying turned on is enough:)

Sunday, February 17, 2008 1:35:06 AM (GMT Standard Time, UTC+00:00) #    Comments [1]  | 

 

Multiple WAN IPs#

In a previous post I talked about how I was dd-wrt to route multiple WAN IPs. Well, ever since that post I have been screwing with it because it has not been working quite right. I finally figured it out with the help of some forums out there. Use the below script in the Firewall section under Administration->Commands to route multiple WAN IP's to internal IPs:

ip addr add [extra wan_ip]/29 dev vlan1

iptables -I FORWARD -d [internal ip] -j ACCEPT

iptables -t nat -I PREROUTING 1 -p all -d [extra wan ip] -j DNAT --to [internal ip]

iptables -t nat -I POSTROUTING 1 -p all -s [internal ip] -j SNAT --to [extra wan ip]


The main piece I was missing was the first line which puts the extra wan ip on the same vlan as the wan ip the router is using.


Hopefully this will save someone from having to scroll through forum posts looking for an answer.

Sunday, February 17, 2008 1:20:16 AM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Microsoft Remote Desktop for Mac#

To my surprise MS Remote Desktop for Mac does exist!

Monday, February 04, 2008 11:27:14 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

New Mac for the New Year#

So I decided to make the switch, yes I have gone over to the Mac side. Since I do all my work anyway in virtual machines my host OS just needs to be a thin layer that allows me to check email, write blog posts, surf the web, etc. Well, OS X fits the bill and it uses considerably less memory than Vista. My virtual machines running VMWare Fusion seems to run faster as well.

One of the things I love about OS X is stuff just works! Example, needed to add my network printer; OS X already found the printer and I just had to make it my default. If I want to get into the guts of things I just open a bash terminal and I'm on my way.

Many software vendors are now offering versions of their products for Macs that it has not been an issues thus far finding the software I need. I'm also starting to look at the Xcode environment and exploring how to build software for Mac's. A new year a new challenge. Now don't get me wrong, I spend a lot of time on the .NET side of things and that is not going to change but every once in a while I need something different.

Live in a Mac, work in Windows!

Saturday, February 02, 2008 3:11:05 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

VMWare Fusion not painting#

So I'm in the process of switching my main computer over to being a MacBook Pro. I work on VMs all the time and my other windows laptops/desktops are running VMWare Workstation so the natural choice for my new Mac was VMWare Fusion.

VMWare Fusion seemed to work flawlessly at first but then I ran into an issue using GoDiagram. GoDiagram would not paint correctly, it would create a window effect where I would see what was behind it (like looking through a window). My first thought was it must be a buffering problem so I googled around and found nothing. It turns out the solution is simple, going to Virtual Machine->Settings->Display and check Accelerate 3D graphics solved the issue.

Tuesday, January 29, 2008 3:38:02 AM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Thursday Jan. 31: The Big Event!#

The Big Event is coming to Denver on Thursday January 31st.  What is it, well here is a summary.

“Do you miss the old Dev Days events?  Do you wish that you could attend a TechEd or PDC, but don’t have the time or budget to get to one? 
Well the Big Event is for you.  Come spend a day with us as we delve into developer and architect topics during the day.  We’ve got a mix of some your favorite local and Redmond presenters. 
 
We’ve got a fantastic Keynote from the Patterns and Practices  team in Redmond, tracks for Architects and Developers as well as a chance to see some new Microsoft technology in person.

 
Sessions for Architects include:
• Why the User Experience Matters
• Agile Development at Microsoft
• The Live Platform

Sessions for Developers include:
• Exposing and Consuming Data in the Microsoft Stack
• Office as a Developer Platform
• What’s New in Visual Basic 9”

Hope to see you there!


Monday, January 21, 2008 11:07:31 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Continuous Integration: Jetbrains Team City#

I’m making the switch to Jetbrains Team City.  For years I have used Cruise Control .NET and I consider myself pretty knowledgeable in the workings of it.  I can say hands down that I can get a new build machine up running quicker using Team City (which I do not know too much about) than using CC.NET.

Team City walks you through the configuration which then points at your build file.  It also has a nice little feature for displaying build outputs on the web site which is useful for nightly build outputs.  There is Visual Studio integration so if you want to run a personal build all you have to do is click a button in Visual Studio.  If the personal build passes then the code is checked in, otherwise the errors need to be fixed.

Did I mention there is a free version which is what I’m using!

Saturday, January 19, 2008 3:32:26 AM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Chloe has arrived!#

We are excited to announce the newest member of our family, Chloe Luif.  She made her appearance at 8:09am on January 17 and weighed in at 7 lbs and is 20 inches long.  Mom and Dad are doing well and baby is enjoying long naps.

 

ChloeLuifAndFamily

Thursday, January 17, 2008 9:01:39 PM (GMT Standard Time, UTC+00:00) #    Comments [4]  | 

 

IIS Application Pool Security Hole#

The other day I was automating some IIS routines such as creating and editing application pools.  I found that the user and password for the application pool can be retrieved in plain text very easily using the code below.

string serverName = Environment.MachineName;

DirectoryEntry appPools =

   new DirectoryEntry(string.Format("IIS://{0}/W3SVC/AppPools", serverName));

appPools.RefreshCache();

 

foreach (DirectoryEntry entry in appPools.Children)

{

   Console.WriteLine(

      "User: " + entry.Properties["WAMUserName"].Value +

      " Password: " + entry.Properties["WAMUserPass"].Value);

The above sample is going against IIS6.  The moral of the story is watch what user you use for IIS app pools.

Sunday, December 30, 2007 7:43:53 PM (GMT Standard Time, UTC+00:00) #    Comments [1]  | 

 

Dell XPS m1330 Take Two#

So I decided to buy another m1330, but this time upgrade a bit.  I went for the 64GB solid state drive and the LED display.

The solid state drive is awesome, it boots up a full 15 seconds faster than my other m1330.  Finally I have a laptop that can run VM’s at a decent speed off of the internal hard drive.  I also installed 64 bit Vista so now I have 4 gigs of ram which is nice.  Installing 64 bit Vista was an interesting task, but in the end I have everything working except the fingerprint reader application.

At first I really did not notice a difference with the LED screen but after using it for a while and then looking at the regular screen on my other m1330 I really noticed a difference.  It seems much easier on my eyes.

There was a great comment on my last post about the HDMI output.  If you right click on the volume control in the system tray and choose playback devices you can choose HDMI for audio output.

Sunday, December 30, 2007 6:59:04 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

AccountManagment in .NET 3.5#

I can’t believe it took this long to get a better way to manage users and groups through code!

There is a new namespace in .NET 3.5 System.DirectoryServices.AccountManagement which allows easy management of users and groups via code.

Below shows how easy it is to get the local IIS_WPG group:

 PrincipalContext context = new PrincipalContext(ContextType.Machine);
 GroupPrincipal iisWpgGroup = GroupPrincipal.FindByIdentity(context, IdentityType.Name, "IIS_WPG")

It used to difficult to even find if a user was a member of a group.  Now there is a “Contains” on the group and there is also LINQ which is what I used.

var addedUser = iisWpgGroup.Members.SingleOrDefault(principal => principal.SamAccountName == "User1");

The above will return the member if they are there or null if the member is not in the group.  It is also stupid simple to add and remove members from a group.

Add Local:

iisWpgGroup.Members.Add(context, IdentityType.Name, “User1”);

iisWpgGroup.Save();

Add Domain:

PrincipalContext domainContext = new PrincipalContext(ContextType.Domain, domain);
iisWpgGroup.Members.Add(domainContext, IdentityType.SamAccountName, “User1”);

iisWpgGroup.Save();

Remove:

var user = iisWpgGroup.Members.SingleOrDefault(p => p.SamAccountName == “User1”);
if (user != null)
{
       iisWpgGroup.Members.Remove(user);
       iisWpgGroup.Save();
}

Tuesday, December 04, 2007 5:16:07 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Windows Meeting Space, Its Free!#

Maybe I’m late to the party but I just stumbled across Windows Meeting Space which is a collaboration tool to share applications just like GoToMeeting or Live Meeting except it is free, well almost free. Windows Meeting Space comes with Windows Vista which as cool as it is to have a free web meeting tool it will be a while until enough people adopt Vista to have it be a viable option.

WindowsMeetingSpace

Thursday, November 29, 2007 3:00:06 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Updating WCF Endpoint Address Programmatically#

Simple but useful.  Say you do not have a conventional config file for your wcf service address, such is the case for compact framework apps.  Another case is with Visual Studio load testing projects in which you can use different properties in the test context to set the service location.  In both case you would want to change the service address programmatically which is quite simple but sometimes not intuitive.  A sample is below:

 service = new ServiceClient();
           
string serviceLocation = "http://testserver/TestService1.svc";
EndpointAddress address = new EndpointAddress(serviceLocation);
service.Endpoint.Address = address;

The service location "http://testserver/TestService1.svc" can come from anywhere (i.e. test context properties), I just chose to hard code it in for this example.

Thursday, November 22, 2007 7:03:18 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Routing Multiple Static IP's#

Recently I switched from Comcast (Cable) to Speakeasy.net (DSL) so I could get static ips.  After I got four static ips I found myself saying “Great, now what?”.  Realizing quickly I had no idea how to route traffic from specific ips/ports I went on the hunt.

First I researched different firmware.  I decided to use the DD-WRT firmware for my WRT150N router which gives telnet access has a web interface to update the firewall.

Next I found a good article on WRTrouters that illustrated how to route multiple ips through the firewall.  There are a few things missing from the article, 1) POSTROUTING is not needed if you are just trying to route incoming traffic 2)  Using PREROUTING for ips and ports is not covered, nor will the scripts in the article work for ports.  With those two things said the article gave me a jumpstart on what to do.  I needed to route ips and ports to different servers.  The below is the script I came up with which works great for routing ip traffic for a specific port to another ip on a specific port.  The nice thing is you can route traffic from one port to another port even though I’m not doing that. (The ips have been changed to protect the innocent.)

iptables -t nat -I PREROUTING -p tcp -d 57.63.155.40 --dport 21 -j DNAT --to-destination 68.100.241.60:21
iptables -t nat -I PREROUTING -p tcp -d 57.63.155.40 --dport 1723 -j DNAT --to-destination 68.100.241.60:1723
iptables -t nat -I PREROUTING -p tcp -d 57.63.155.40 --dport 80 -j DNAT --to-destination 68.100.241.62:80
iptables -t nat -I PREROUTING -p tcp -d 57.63.155.40 --dport 443 -j DNAT --to-destination 68.100.241.65:443
iptables -t nat -I PREROUTING -p tcp -d 57.63.155.41 --dport 80 -j DNAT --to-destination 68.100.241.60:80

No that I have the firmware and I have the firewall routing rules it is time to update the router.  The DD-WRT control panel has a nice Commands tab under Administration.

Dd-wrtcommand

On the Commands tab you can update the firewall rules by clicking on Save Firewall then click Edit.  The Commands window will be populated with whatever is currently in the rc_firewall variable.  Copy the above firewall updates into the Commands windows then click Save Firewall

Dd-wrtCommandWindow

That is it, you should be routing traffic from multiple public ips using a cheap router.

*UPDATE*

I have found that trying to route using ports does not work as I expected thus the guidance provided by WRTrouters is a better way to proceed.  My updated iptables script is as follows:

iptables -t nat -I POSTROUTING -p tcp -s 57.63.15.40 -j SNAT --to-source 68.100.241.62
iptables -t nat -I PREROUTING -p tcp -d 68.100.241.62 -j DNAT --to-destination 57.63.15.40

I will continue to research other ways of routing multiple wan ips | port combinations to enable greater configuration through the firewall, but for now this will get the job done.

Tuesday, November 13, 2007 12:03:42 AM (GMT Standard Time, UTC+00:00) #    Comments [2]  | 

 

Vista: Screen Flashing When Connected to Projector#

I found this answer in a forum and it seems to work!

Microsoft has a service called Transient Multimon Manager (TMM). This (supposedly) makes it easier to run multiple displays. It also causes the annoying flash we all hate so much. It took me hours to pinpoint the exact process (which happened to be the Task Scheduler Engine), and even more time to pinpoint the exact task, so enjoy.

Here's how to fix that annoying black flicker on boot:


Click on the Start button (pearl? ball? orb?).
Type "Task Scheduler" and hit Enter.
On the left-hand side, click "Task Scheduler Local" (you should already be there, but just in case).
Expand "Task Scheduler Library," then "Microsoft," then "Windows," then click "MobilePC."
Up top, you'll see a task called "TMM." Click it, and on the right-hand side, click "Disable."
You're done. :)


There are slight drawbacks to the aforementioned solution:
I just tried this fix for my laptop, and the auto detection of the second monitor no longer worked. But you can still switch around to the external monitors manually though, and it seemed to work.

Monday, November 12, 2007 4:33:34 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Vista Compatible Eyedropper#
For any of you that have to do color matching for websites and whatever else eyedropper is a must.  I have used it for many years on Windows XP and just as I went to use it tonight it did not work.  Luckily there is a new beta version out that works on Vista.
Sunday, November 11, 2007 3:48:47 AM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Gmail has IMAP!#

I just noticed that gmail now supports IMAP.  Just log in to gmail and look under settings and you will see the option to turn on IMAP.

Sunday, November 11, 2007 3:42:46 AM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

The Measure of Success#

For a fun conversation gather your team and include people from marketing, sales and any other area of your company and pose these two questions:

  1. Why is the measure of success important?
  2. What is the measure of success?

You will get some great responses ranging from “The first question is just stupid” to some very enlightening answers.  Let everyone voice their opinions then put in a few ground rules.

  • The measurement has to be something the individual can directly effect.
  • The measurement has to be something that can be measured regularly.

After putting forth these guidelines the responses from people should begin to change a bit.  Instead of hearing measurements like revenue you will start hearing measurements like sales deals closed this week or new clients for the week.

The purpose of the conversation should be clear by the end.  Each individual will leave having a better understanding and appreciation for each role in the company.  Another beneficial side effect of this conversation is each person will find ways to help others achieve their goals (even if they do it with knowing it).

Thursday, October 18, 2007 1:13:54 AM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

VMWare Workstation 6.0 not Recognizing USB devices#

I ran into an interesting issue yesterday, usb devices were not showing up in my VM.  I decided to disable the Windows Firewall and it started working.  Next I  brought up TCPView and saw that tcp ports 49515 and 49516 were being used by VMWare Workstation.  In the Windows Firewall Exceptions I added the ports and the VMWare Workstation program and everything works with the firewall turned back on.  Problem solved!

VMWareFirewall

Wednesday, October 03, 2007 4:14:39 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

First impressions of xUnit.net#

xUnit.net is awesome!  Some very useful features, has everything you need for unit testing and some very useful attributes for data driven integration tests like:

  • AutoRollBack
  • DataViaOleDB
  • DataViaSqlServer
  • DataViaXls

It is very intuitive to use and is simple.  I’m still digging into it but I’m pretty stoked so far.

Friday, September 21, 2007 12:19:33 AM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

xUnit.net has arrived!#

A new testing framework is in town, xUnit.net.  Jim talks about it in his post.

I’m taking xUnit.net for a test drive as I type.

Go check it out!

Thursday, September 20, 2007 10:27:06 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

WatiN Test Recorder#
WatiN Test Recorder is a pretty cool tool for recording user actions.  I have used Watir Recorder in the past and I have been waiting for a .NET version and now there is one!  If you are in need of a test automation tool check out WatiN Test Recorder.  There is a nice flash demo on the home page.
Wednesday, September 19, 2007 2:53:06 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Custom Resharper Type Members Layout#

My good friend Daren May put together a custom type members layout for Resharper.  This a a newer feature in Resharper that allows someone to define a custom code format in xml.  To do this follow the steps below.

1) Go to Resharper’s “Options” page in Visual Studio

ResharperOptions

2) Select the “Type Member Layout” in the navigation tree then unselect “Use Default Patterns”.

ResharperTypeMemberLayout1

3) Take the contents of this xml file and paste it into the “Custom Patterns” window.

ResharperTypeMemberLayout2

4) Format your code in Visual Studio.  This can be done by using Resharper’s context menu or by hit ctrl+alt+F  Be sure to have the “Reorder type members checked”.

ResharperReformatCode

Wednesday, September 19, 2007 2:29:24 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

Acronis Disk Director in Action#

I recently purchased Acronis Disk Director instead of Partition Magic and I’m very pleased.  Disk Director is easy to use and makes editing disks a snap.  Check it out if you are in need of a good disk editing tool.

AcronisDiskDirector

Monday, September 10, 2007 9:13:28 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

It's a Girl!#

Today my wife and I found out that in January we will be welcoming a new little girl into our family.  I think she is actually smiling in the picture.  Watch out world, here comes another Luif!

BabyFace

Friday, September 07, 2007 8:13:57 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

JetBrains UnitRun "No such interface supported"#

I recently built up a new VM for my team and decided to use JetBrains UnitRun.  After installing UnitRun I started up Visual Studio 2005 I was greeted with the exception:

“JetBrains.ReSharper.Util.InternalErrorException: No such interface supported
StackTrace…..”

I also noticed that the [Test] attribute was not colored making it look like it was not being resolved though everything compiled just fine.  Turns out it is the namespacing.  This is not a UnitRun issue it is a Visual Studio issue.  I have something that looks like:

    4 using NUnit.Framework;

    5 

    6 namespace Foo.Bar.Test.UnitTests

    7 {

    8     [TestFixture]

    9     public class MockFixture

   10     {

   11         [Test]

   12         public void ExceptionIsDrivingMeNuts()

   13         {

   14         }

   15     }

   16 }

Notice the namespace has the “Foo.Bar.Test.UnitTests” and that [Test] attribute is not colored.  Visual Studio is resolving [Test] as the namespace “Foo.Bar.Test” instead of NUnit.Framework.TestAttribute.  So why have I not seen this sooner?  Well I use Resharper which resolves it to the correct reference and thus colors it correctly.  Looks like Visual Studio walks the using statements/namespace in reverse order and the first string match it finds it uses it.  This is illustrated by the below which works.

    5 namespace Foo.Bar.Test.UnitTests

    6 {

    7    using NUnit.Framework;

    8 

    9    [TestFixture]

   10    public class MockFixture

   11    {

   12       [Test]

   13       public void ExceptionIsDrivingMeNuts()

   14       {

   15       }

   16    }

   17 }

 

This is not something I’m willing to live with.  The underlying problem is the namespace so the fix I’m going with is to update the namespace to “Foo.Bar.Tests.UnitTests” which produces the below which works great.

 

    4 using NUnit.Framework;

    5 

    6 namespace Foo.Bar.Tests.UnitTests

    7 {

    8    [TestFixture]

    9    public class MockFixture

   10    {

   11       [Test]

   12       public void ExceptionIsDrivingMeNuts()

   13       {

   14       }

   15    }

   16 }

 

I guess another fix is to get everyone using Resharper…

Thursday, September 06, 2007 9:22:13 PM (GMT Standard Time, UTC+00:00) #    Comments [0]  | 

 

WCF Basics#

Recently I have been talking about and reviewing WCF (Windows Communication Foundation) implementations.  There are some basic pieces of information that each team seems to be missing.  WCF services are not your grandmother’s web service.  Many things differ from a WCF service and a .NET 1.1 Web Service.

  • WCF Data Contracts work on an opt in basis when the DataContractSerializer (the default) is used.  This means each member that is to be serialized needs to be decorated with the DataMember attribute.
  • The preferred mode of instance management for WCF is per call.  This means that for each call an instance of the service is created and then disposed once the call finishes.  This also means there are only as many instances of the services as there are calls.  There are three different types of instance management:  per call, per session, and singleton.  The per session instance management is how a .NET 1.1 web service works.  Per session instance management creates an instance of the service for the entire length of the session in which many operation (i.e. calls) can be made.  In the per session mode there would be an instance of the service for each client.  Singleton instance management is just what it sounds like, there is one and only one instance of the services for all calls.  Per call is the most scalable and singleton is the least which leaves per session somewhere in the middle.  Don’t confuse scalability with performance.  Performance actually goes the opposite direction; Singleton is the best and per call is the worst which again leaves per session in the middle.  Most systems I have been designing lately have been more message based so the per call instance management works best.  On a side note instance management is driven by behaviors which is a bit beyond the scope of this post.
  • Choose your bindings wisely.  When picking a binding be sure you know what you are picking and also know you are not tied to that binding for eternity.  Currently most cases I see are in need of the HttpBasicBinding because of the need for interoperability.  I also tend to recommend the HttpBasicBinding because none of the added features of the other bindings are needed.  Currently I point people towards bindings that can be hosted in IIS for simplicity sake.  It will not be long until bindings like the NetTcpBinding which supports the binary formatter can be hosted in IIS 7 using WAS (Windows Process Activation Service).
  • The difference between transport and message level encryption is an important point.  Transport encryption means having a secure tunnel to communicate over like SSL. Message level encryption means the message itself is encrypted so wherever the message goes it will need to be decrypted before it can be used.  As is the case with any encryption there is overhead.  Transport level encryption is faster than message level encryption.  In some cases when none sensitive information is being transmitted behind a firewall the option of TransportCredentialsOnly comes in handy.  This means that only credentials are passed along with the call but no encryption is used.  I would recommend thinking long and hard before deploying any solution with no encryption.

WCF in .NET 3.0 definitely has it short coming, like the DataContractSerializer not working with attributes, but it is much better than the .NET 1.1 way of doing web services.  If you are currently working with or thinking of working with WCF I would suggest looking at Web Service Factory created by Microsoft Patterns and Practices.