There seems to be a bug in Visual Studio 2010 when adding references to Silverlight projects.  You can add “regular” .Net references just fine using the add reference dialog.  However if you use the browse feature to find a reference in an “unusual” location, Visual Studio is supposed to record that location along with the reference in the .csproj file.  It includes the location via the HintPath property.

At my company, we use build machines and we don’t like to install a lot of software on them.  So in source control we have a folder (assets\lib) that includes all of the necessary .dll files that we need to build or projects.  When we add references to our project, like for a Silverlight control library, we add it from the assets\lib\Silverlight folder, even though that library is installed on my local machine.  Anyway, when I tried doing this in Visual Studio 2010 (I’m upgrading our existing 2008 solution), VS 2010 isn’t including the HintPath.  If you aren’t careful, you may not realize this is happening.  That’s because since the library is installed on my machine, the build works just fine, except it pulls the .dll from the wrong place.  If I were to try this build from my build server, it would fail though. 

Anyway, here is the workaround.  It’s a pain but it works…

  1. Add your references as you would normally do it via Visual Studio.
  2. Right click the project file in the Solution Explorer and choose Unload Project.
  3. Once the project is unloaded, right click again and chose edit.  This will open the file, and xml document, in Visual Studio.
  4. Find the incorrect reference in the file and edit it manually.  You’ll need to make it look something like this:
    <Reference Include="System.Windows.Controls, Version=2.0.5.0, Culture=neutral, 
    PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL
    " > <HintPath>..\..\..\Assets\lib\Silverlight\System.Windows.Controls.dll</HintPath> </Reference>

  5. Save the file and close it.
  6. Reload the project.

When you are done you can verify that it works.  Here’s how…

  1. In Visual Studio, choose Tools > Options.
  2. Find the Projects and Solutions section and select Build and Run.
  3. In the section “MsBuild Project build output verbosity”, select “Detailed”.
  4. Now build your project.  When you do so, you’ll see a lot of details of what goes on in the Output Window.  You’ll need to find the output that relates to the file that you specified, in my case it is System.Windows.Controls and the important output looks like this:

    Primary reference "System.Windows.Controls, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35".

          Resolved file path is "C:\Projects\MC\BackOffice\UI\branches\2010Migration\Assets\lib\Silverlight\System.Windows.Controls.dll".

          Reference found at search path location "{HintPathFromItem}".

  5. You will note that it tells you specifically which path was used to resolve the reference!  And if you are so lazy that you don’t want to read the entire path used, you see that it says the reference was found at the search path location “{HintPathFromItem}”.  That means it used the path you specified.

I hope this helps!  Good luck and let’s hope they fix this bug soon.

We went to the beach for a long weekend as a family of three, we came home as a family of four!  Here are the details of our adventure.  Read it if you want or just look at the pictures!

On Thursday afternoon Rebecca went for her weekly checkup at the doctor.  Our baby was due in 3.5 weeks but they said she was doing great and had nothing to worry about.  We should go enjoy ourselves at the shore.  We were both really looking forward to the long weekend.  We had just found a new house, sold our house (although both closings are in September), and we have a baby on the way.  Plus our son Ben was really hitting his stride as a two year old, mastering the art of “No”.  So some time off was really in order.  We had a nice relaxing day on Friday, the weather was perfect and Ben was having a blast playing in the sand.

IMG_0014IMG_0023

Ben at the beach playground with cousins Hannah and Sam.  And Ben playing with Hannah (and Uncle Andy)

Part 1 – Controlled Panic:  Later that evening we were headed for a walk on the boardwalk with family.  Ben and I were a few minutes ahead of Rebecca.  When Rebecca didn’t follow us, we had to head back to see what was up.  We met up with Rebecca and she said “I think my water just broke”.  FYI, that didn’t happen when Ben was born so she wasn’t positive what was happening.  There was a lot of family at the house and lots of opinions and ideas.  “You should call the doctor”, “You should pack up and leave”, “Relax and go for a walk”, etc.  We called the doctor back home.  Keep in mind, we’re on the Jersey shore near Atlantic City, about 1.5 hrs from home.  The doctors advice was to head right to the hospital.  After water breaks anything could happen, and happen fast.  I thought, the last thing we want to have happen is to deliver a baby on the side of the AC Expressway.  Next, we had a nice family discussion/argument about which hospital to go to.  There were three to choose from.  My brother-in-law and sister-in-law took charge of that and called to figure out which is best.  That was a big help.  By this time it was about 8:30pm.  The next problem to deal with was how to get Ben to sleep.  Since it is the beginning of the summer, the house is a bit strange to him and he wanted me to sleep in the room with him.  I laid down for a while and every minute felt like an hour.  He finally fell asleep, we packed up and we were off to Atlanticare Regional Medical Center Mainland Campus. 

IMG_0796 On our walk before things got interesting.  Ben’s with cousin Sylvia (Sylvie) but Ben calls her “So-be”.  I think he is love with her.

One nice part of this whole crazy situation is that we had plenty of people to help with Ben.  If we were at home we would have had to find someone to come over and watch him for the night, plus we’d need people to help out all weekend long too.  Instead, we just drove off.  Well, first we spewed out a bunch of instructions about how to keep him happy while everyone nodded their heads saying “Sure, we’ve got it”.  Most of it didn’t matter, we knew he’d be in great hands if they followed our advice or not.

Part 2 – Hurry Up and Wait:  We got to the hospital and finally were in our room by around 11pm or so.  The staff now told Rebecca that since her water broke, she had to stay in bed.  Rebecca was seriously unhappy with that information.  When Ben was born she was told the best way to work through labor and keep things moving was to be up and around.  And she wasn’t that far along, so we’d likely not have a baby until the next day!  We both slept in the hospital but I’m sure that everyone knows you can’t really get much sleep in a hospital. 

Part 3 – Time to Rock and Roll:  Around 5:30 am they gave Rebecca a shot of Pitocin to move things along.  At 6:30 they injected some pain killers into her epidural and at 7:30 am on July 3rd Sarah Maya Schwam was born!  She weighed 5 lbs, 12 oz and was 19.25 inches long.  As a side note, I thought she looked shorter than that.  This week the pediatrician measured her at 18.5 inches.  I’m not sure what is up with that.  Being 3.5 weeks early, the staff was a little concerned and put the NIC unit on alert.  But after a check up, they decided that she was ok to stay with us and they’d keep an extra close eye on her.  That was a BIG relief to us.  10 fingers, 10 toes, and TONS of dark brown hair and cute as a button (whatever that means). 

IMG_0028 IMG_0808 IMG_0815 IMG_0821 IMG_0831 IMG_0850

Part 4 – Now What?:  OK, so we’ve got a healthy baby but we are pretty far from home with no “baby stuff”.  Well it turns out you don’t need too much stuff and in our neck of the woods (even down at the shore) there are always stores around.  My sister-in-law Dawn hit the drug store for some diapers and stuff, and a little boutique at the beach for a few outfits.  But you can’t leave the hospital without a car seat!  We planned to send the family out to Baby’s R Us to buy a new one when a few friends came to the rescue.  Neighbors Megan and Glen were on their way to the shore for July 4th when they saw my email baby announcement.  They offered to stop at our house and pick up the baby seat and other supplies and drop them at the hospital!  How cool is that?  We were all set!

IMG_0849 IMG_0840 IMG_0860

Our family including Aunt Dawn, Megan (who came to our rescue) and Sarah, and the four of us leaving the hospital via the required wheel chair.

Part 5 – Home At Last:  After 2 nights in the hospital (3 if you count the night before Sarah was born) everyone was released and we went back to the beach house.  It was Monday of a holiday weekend and we didn’t want to get stuck in any traffic coming home so we spent the night at the beach.  Of course, we didn’t have a bassinette there so we had to improvise with a drawer!   By noon on Tuesday we were finally back in our house!  It was great coming home and Benny was really happy.  I think the trip was toughest on him.

IMG_0865 IMG_0869 IMG_0883

Sarah with Rebecca’s dad, with my Mom, in her drawer (it looks safe and comfy, right?). 

What a crazy “vacation” this turned out to be!  It would have been a lot harder without our family that helped out so much with Benny.  He had a great time playing at the beach with his cousins.  I have no idea how we could have got through this without the family helping out.  Now Benny is totally in love with Sarah, like nothing I have ever seen before.  He just wants to kiss her and hug her and tickle her and just be around her ALL of the time.  “I want Sarah” is the new phrase heard around the house… over and over and over again.  We’re glad he likes her but it is making us a little crazy.  I’ve been told that this will wear off pretty soon and he’ll get used to having her around.  Having a sister certainly did not cure the “terrible two’s”.  This little guy really tries to run the show around here.  Lucky for us he’s still a sweet kid most of the time.