Wednesday, June 07, 2006

We have the distinct honor this month to welcome Aaron Skonnard to the Utah .NET User Group.  We were all too happy to bump the meeting back a week (to the 15th) to accommodate his hectic schedule.  We hope this doesn't put undue contraints on everyone's schedules and that we have some great attendance.  It looks to be a fantastic meeting.

Aaron will be talking about Biztalk 2006 - something to which he's been devoting an inordinate amount of time :).  We invite all to attend.  Enjoy the meeting, the pizza, the comaraderie!

Time: 6:00 PM
Date: Thursday, June 15th, 2006
Place: Neumont University (10701 South River Front Parkway, South Jordan, Utah) (click for a map)

Wednesday, June 07, 2006 8:08:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Tuesday, June 06, 2006

I've been playing lately with a lesser-known feature of Virtual PC called a Differencing Disk.  Essentially, this feature allows you to have multiple virtual machines that drive off of a single 'base' virtual hard drive (vhd).  You can, therefore, set up your base OS on a stand-alone VPC and then create a “differencing disk” over it.  All of your changes get written to your disk and not the base.  In fact, it's recommended that you go and mark your base disk as readonly so you don't inadvertently alter it, thereby causing your differencing disks to run amok.

A major advantage of this approach is you don't need to have multiple copies of your OS VPC floating around.  They tend to get very large, very quickly.  Case in point, I have a VPC that I use that is roughly 10 GB.  Making multiple copies of that beast to test various configurations and changes is nightmarish and takes a frighteningly long time to copy.  This approach is so much more manageable.

Provided multiple parties have the same base VPC, it also gives you the ability to share your changes/differences seamlessly and with a much smaller, more manageable footprint.  It's easier to download a 250MB archive than a 6 GB VPC image.

The steps to create a differencing disk are pretty easy:

  1. Create a new Virtual Hard Disk (File --> Virtual Disk Wizard).  Note, this is NOT the same as creating a new virtual machine.  When creating a Differencing Disk you must create the disk before you create the virtual machine.
  2. In the wizard, select 'Create a new virtual disk'.  Click Next.
  3. Select to create 'A virtual hard disk'.  Click Next.
  4. Identify the location for your disk (this will be the differencing disk storage location).  Click Next.
  5. Select to create a 'Differencing' disk.  Click Next.
  6. Select the base VHD file - the OS disk to base your differences on.  Click Next.
  7. Click Close.

NOTE:  I also found this great resource which identifies the steps above graphically: http://dotnet.org.za/matt/articles/2413.aspx  Way to go Matt!  Great resource.

At this point, you simply need to create a new Virtual Machine using your differencing disk you just created as the hard drive.

It's pretty easy and it makes working with VPC much more of a pleasure.  Your hard drive will thank you - and so will your customers/team that can use your differencing disk without having to download a whole stinking image.

 

Tuesday, June 06, 2006 8:08:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, June 01, 2006

The other day I took the opportunity to install Microsoft Windows Vista Beta 2 on my 'old' laptop.  The old one is a pretty decent machine too: Dell Inspiron 8600, 2.0 GHz Centrino, 2GB RAM, 60 GB drive, etc, etc.  In fact, it was my primary laptop until just recently when I upgraded to a Precision M90...but's that's a different story.

I've got to say I LOVE Vista.  It is awesome.  I'm not just saying that because I have drunk the Microsoft Kool-Aid, but rather in spite of it.  Even for a Beta, the OS is slick, reasonably fast (though it's sure to be much faster once it hits RTM).  But talk about polish.  No, I don't mean sausages.  I'm talking about shoe-shine.  I have seen demos of the OS before, and many screenshots, but it doesn't quite hit home until you actually use it and have first-hand experience.

Granted, there is now another learning curve as many things in the core OS have changed, been renamed, or been moved, but so far I think it's all been for the best.  It is remarkably easy to navigate and the controls at your fingertips are so much more usable.  I particularly enjoy the bread crumbs navigation bar where each step is a selectable button with an associated drop-down menu of other options at that step.

Sure, I can see how many believe that MS took note (finally) from the Mac world and others (and with good reason), but they managed to keep the nice, sleek Windows look and power and stepped it up a notch visually, more so than the other OS's.  You remember the scene from Jurassic Park where Dennis (the computer geek) was so excited upon seeing the shaving cream can via which he should smuggle the dinosaur DNA?  I used to think that was pretty over the top, but that's how I feel.

I'm hooked and eagerly await the RC versions and RTM.  It's like moving to VS.NET 2005.  Once you're there, it's hard to go back to VS.NET 2003 (though I have to work in it daily).  I fear the same holds true for Vista and XP.

Thursday, June 01, 2006 7:29:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [6]  |  Trackback
 Wednesday, May 31, 2006

We ran into a peculiar issue today at work were we had a new laptop that simply could not see other computers on the network.  We could ping them by IP address, but no name resolution was occurring.  We troubleshot it as one normally does (e.g. making sure that the DNS server was right, checking NetBIOS settings, etc, etc).  Upon running ipconfig /all, however, we saw that the Node Type was set to Peer-Peer rather than Mixed or Hybrid.

This setting cannot be changed via the Windows UI (at least not as far as I'm aware), but you can set it in the registry.

All we had to do was open the registry (via regedit, regedt32, etc) and change the following setting:

Key:     HKLM\SYSTEM\CurrentControlSet\Services\NetBT\Parameters
Setting: DhcpNodeType
Value:   8

Valid values include 1 (Broadcast), 2 (Peer-Peer), 4 (Mixed), and 8 (Hybrid).

Once the box was rebooted all was hunky-dory.

Wednesday, May 31, 2006 7:04:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Friday, May 26, 2006

I had the privilege today of conducting a “Brownbag Session” over lunch at SelectHealth today.  The topic was Visual C#.  For the most part the team is new to .NET (and C# for that matter), though some in attendance did have some limited exposure.  We hit on several topics mostly revolving around language and syntax, but we talked about classes, partial classes, properties, generics, iterators, anonymous methods, delegates, and quite a bit more.

There's only so much you can do in a 1 hr block, but I think it went over pretty well and I hope they were happy with the results.  I was.  Thanks for the opportunity to present - as always, it's a great pleasure!

Friday, May 26, 2006 8:19:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Monday, May 22, 2006

I'm developing a web service in ASP.NET 1.1 through which I need to transfer files.  There are a myriad ways in which I could accomplish this, but rather than roll my own, which I am sometimes inclined to do, I wanted to use some built-in functionality.  This functionality can be found in WSE 2.0 and DIME (Direct Internet Message Encapsulation) - thanks Fabio for reminding me.  Believe me, it pains me that I cannot use WSE 3.0 and MTOM with .NET 2.0, but such is not possible with this project - at least not yet.  But transferring the files would be orders of magnitude easier via MTOM, but alas, here we are.

Shortly after I set up the web service and tested it locally, I wanted to ensure that it would work remotely.  The machine to which I have it deployed is running on a Virtual PC running Windows Server 2003.  I could see the nice ASP.NET web service description page navigating via my browser to the .ASMX file, but when I attempted to access it via code, I was first presented with the following error message:

System.Net.WebException: The request failed with HTTP status 401: Unauthorized.
   at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
...

Oh, that's right, I need to include some credentials to access this particular web service.  Therefore, I added the following snippet of code below my client proxy declaration:

ServiceWse svc = new ServiceWse();
svc.Credentials = CredentialCache.DefaultCredentials;

Once I did that and ran my test harness I was greeted with a slightly more inocuous error:

Microsoft.Web.Services2.Security.SecurityFault: An error was discovered processing the <Security> header ---> System.Exception: Creation time in the timestamp can not be in the future.
--- End of inner exception stack trace ---
at Microsoft.Web.Services2.Security.Utility.Timestamp.CheckValid()
at Microsoft.Web.Services2.Security.Utility.Timestamp.LoadXml(XmlElement element)
at Microsoft.Web.Services2.Security.Utility.Timestamp..ctor(XmlElement element)
at Microsoft.Web.Services2.Security.Security.LoadXml(XmlElement element)
at Microsoft.Web.Services2.Security.SecurityInputFilter.ProcessMessage(SoapEnvelope envelope)
at Microsoft.Web.Services2.Pipeline.ProcessInputMessage(SoapEnvelope envelope)
at Microsoft.Web.Services2.InputStream.GetRawContent()
at Microsoft.Web.Services2.InputStream.get_Length()
at System.Xml.XmlScanner..ctor(TextReader reader, XmlNameTable ntable)
at System.Xml.XmlTextReader..ctor(String url, TextReader input, XmlNameTable nt)
at System.Xml.XmlTextReader..ctor(TextReader input)
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
...

As it turns out, WSE will utilize a timestamp to verify security tokens between the SOAP sender and receiver and if the two computers' clocks vary by more that the default tolerance of five minutes, it will fail.

One solution would be to synchronize the client to the server, but that's a pain and may not properly work in a global scale which would be required by my particular application.

This baffled me for a few minutes because the time on my local PC and the time on my VPC were the same; that is, they appeared the same.  I quickly saw that the VPC's time, though the same with respect to hrs, minutes, and seconds is relative to Pacific Time whereas my laptop is on Mountain Time.  So they ultimately varied by 60 minutes, well over the default tolerance.

The solution is to alter the web.config file on the server and the client application's configuration file to include an override to the tolerance.  I set it to allow for up to a day (24 hrs) in difference to accommodate for any discrepancy that may arise.

<configuration>
   <configSections>
      <section name="microsoft.web.services2" type="Microsoft.Web.Services2.Configuration.WebServicesConfiguration, Microsoft.Web.Services2, Version=2.0.2.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
   </configSections>
   <microsoft.web.services2>
      <security>
         <timeToleranceInSeconds>86400</timeToleranceInSeconds>
      </security>
   </microsoft.web.services2>
</configuration>

I'm actually very happy that I had this situation arise now rather than after I had deployed because I now remember that I have to test for time zone differences.

Monday, May 22, 2006 9:29:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [3]  |  Trackback

Resharper 2.0 was released by JetBrains today!  I have been anxiously awaiting this release since November of last year at the debut of VS 2005.  Being an avid fan of Resharper 1.0 - 1.5.1 for VS 2003, I was very excited about the prospect of getting similar yet advanced functionality in both VS 2003 and VS 2005.  Well, today (finally) the wait is over.

I've since downloaded them (both versions) and am in the process of installing.  The VS 2003 installation went smoothly and without a hitch, but the VS 2005 is taking a LOOOONG time during the application of some VS.NET hotfixes.  Anyone else have similar issues?  It's not like the sitting there idly, though the installer does indeed look stalled - it's not providing any feedback whatsoever.  I'm using FileMon and Process Explorer to watch the installation and it is indeed working, it's just taking forever and the UI doesn't give any feedback.

Monday, May 22, 2006 4:33:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Tuesday, May 16, 2006

If you're creating a Web Service and you run across an error that resembles this:

Server Error in '/MyVirtualDirectory' Application.

Parser Error
...
Parser Error Message: Could not create type 'xxx.MyWebService'.

Don't worry, it's not that difficult to fix.

First of all, make sure your website is indeed within a Virtual Directory running the proper version of ASP.NET.  This can be ascertained in IIS.

Barring that, make sure you have deployed your website's DLLs into the proper \bin directory.  I ran into this error because my virtual directory is actually housed within another virtual directory/site that had it's own assembly references and I had removed them in my web.config like this:

<compilation defaultLanguage="c#" debug="false">
   <assemblies>
      <clear />
   </assemblies>
</compilation>

Once you do that, you effectively lose reference to your own DLLs.  Simply add yours back, along with the others you need (Web Services will require System.Xml and System.Web.Services).

Your web.config file may resemble this for ASP.NET 1.1:

<compilation defaultLanguage="c#" debug="false">
   <assemblies>
      <clear />
      <add assembly="System.Xml, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Custom=null" />
      <add assembly="System.Web.Services, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, Custom=null" />
      <add assembly="My web service dll here" />
   </assemblies>
</compilation>

 

Tuesday, May 16, 2006 3:11:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [5]  |  Trackback

I meant to blog about this a few weeks ago, but was reminded today that I had not yet done it.

On Wednesday, May 31st, Microsoft will be hosting a PASS (Professional Association for SQL Server) Code Camp which looks to be a lot of fun and very exciting.  The event is free and open to all, but you are requested to register.

To properly cite:

Utah PASS SQL Code Camp
Wednesday, May 31, 2006
Microsoft Offices
Salt Lake City, UT

PASS Camp is a Free one day SQL Server community building event being presented by PASS and the Official PASS Chapters Salt Lake City and Utah County SQL Users groups. These will be short and in-depth sessions to learn about SQL 2000 and SQL 2005.Visit the website below for more information and to register.

http://utpasscodecamp.mollyguard.com

Hope to see you there!

Tuesday, May 16, 2006 2:08:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Monday, May 15, 2006

I found this handy little tip today when I had to send CTRL+ALT+DELETE to a remote desktop session (which always ends up being processed by the local machine and not the remote one).  The keystroke is CTRL+ALT+END.  Handy to know and remember!

Monday, May 15, 2006 8:02:00 AM (Mountain Standard Time, UTC-07:00)  #    Disclaimer  |  Comments [50]  |  Trackback