Scott Hanselman

Building your own Windows Media Center Edition 2005 Home Theater PC System

February 15, 2005 Comment on this post [21] Posted in Programming
Sponsored By

My co-worker Krishnan is truly the gadgeteer. He has more techie stuff than anyone I've ever known, including myself. He is also an expert on all things HD and Media-y. So, I asked him "should I buy a Media Center PC or build?" I had picked out a lovely $2500 system.

UPDATE - June 2005: Make sure your motherboard and case match. If you click on the D6 link below, be aware that depending on stock on hand Newegg.com may offer you a "similar" motherboard. For one reader they recommended an ATX mobo and Micro-ATX and that's not cool. Also, while note that the Ahanix D6 is not the 601. I currently recommend the LARGER standard ATX Ahanix 601. Make sure you measure as some of these cases are pretty deep.

He said that he just built one from scratch for around $1500. Here's what he did:

This system is totally HD ready, and Krishnan said he taped 11 hours of 1080i SuperBowl content into about 43gigs without a hitch. He's using it as his primary PVR now.

Does anyone know if you can somehow "coerce" or upgrade (laterally?) Windows XP Pro into being a Media Center machine? Perhaps my existing main machine (with specs better than these) could do double duty, without reinstalling, etc.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

More great "Effective Presentation Tips"

February 15, 2005 Comment on this post [3] Posted in Musings
Sponsored By

My buddy Venk (Venkatarangan, the RD from Chennai) has posted his tips for effective presentations and they're excellent, surpassing my own attempt from a few years back.

He's even seen fit to make his tips available via PDF. I highly recommend you check them out if you give presentations, or have any coming up.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

ASP.NET HotFix 887219/MS05-004 may break and confuse IIS and ASP.NET (404s)

February 10, 2005 Comment on this post [4] Posted in ASP.NET
Sponsored By

Here's an interesting one from Jeff Berkowitz and Phil Hochstetler:

Phil has discovered that MS hotfix 887219 / MS05-004 (http://www.microsoft.com/technet/security/Bulletin/MS05-004.mspx), released last Wednesday, completely breaks our site.  At least on one test machine--happily we caught it before it reached Production.  With the hotfix installed, all our virtual roots (three of them, one containing a web application and two containing collections of web service pages) return 404s exclusively.  Backing out just this one hotfix solves the problem.

The fix was found by Phil on Google Groups: Go to IIS Admin, open Properties on Web Site, Home directory tab, Local Path text box: make sure there is no trailing slash.

 

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

ViewStateUserKey and "Invalid_Viewstate" when posting back during Forms Authentication

February 09, 2005 Comment on this post [7] Posted in ASP.NET | ViewState
Sponsored By

From my point of view, I like ASP.NET because it's at least consistent. Anytime some crazy crap happens, at least it makes sense once the dust clears.

We've got a "Workflow" ASP.NET Server Control that i s very snazzy. It's a templated user control that handles all the state transitions one has to deal with when showing and hiding different panels during a Wizard-style operation.

So, you can setup Next and Previous or whatever buttons you like, hook each up to any WorkflowStep and there you go. It's a simpler thing that the UIP. Anyway, as with all ASP.NET 1.1 Postback-like things, it postsback to the current page.

Today someone who was creating an Enrollment and Signon workflow got this Exception during a PostBack:

Exception: System.Web.HttpException
Message: Invalid_Viewstate
Source: System.Web
   at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
   at System.Web.UI.Page.LoadPageViewState()
   at System.Web.UI.Page.ProcessRequestMain()

When you get this exception the standard list of things to check are:

  • If this is a cluster, edit <machineKey> configuration so all servers use the same validationKey and validation algorithm.  AutoGenerate cannot be used in a cluster. 
  • Viewstate can only be posted back to the same page. 
  • The viewstate for this page might be corrupted.

However, this isn't an error that you'd likely see on a single development ox, so something had to be up. The only interesting and different thing about this situation was that the user, in step 4 of this 7-step process, gets logged into Forms Authentication. When I say "gets logged in" I mean, a cookie is sent to them.

Here's the flow of what happened and why it's a problem:

  1. Un-Forms-Authenticated Client (no cookies) does a GET and receives some standard ViewState.
  2. Client fills out form, POSTs back. ViewState is decoded, life goes on.
  3. During Page processing, user is "logged on" and a Forms Authentication cookie is set out (queued up more like it).
  4. Additionally more ViewState is sent back, not encrypted.
  5. Now Forms-Authenticated Client (cookies) fills out form, POSTs back. ViewState from step 4 is returned to the server.
  6. In Global.AuthenticateRequest(), the cookie from this client is cracked open and a valid SecurityPrincipal is put on the current Thread. Now, User.Identity.IsAuthenticated is true, and User.Identity.Name is set to some string.
  7. In the Page.Init() this line executes, which I've mentioned before. This adds another layer of protection to the User's ViewState.:
    if (User.Identity.IsAuthenticated){ViewStateUserKey = User.Identity.Name;}
  8. Then, after Page.Init() but before Page.Load(), the internal method LoadViewStateFromPersistanceMedium() starts to open up the ViewState that was passed to us. This was the non-protected non-encrypted viewstate from step #4.
  9. Exception occurs, because we now are trying to decrypt ViewState with a key that wasn't present when the ViewState was originally generated.

Moral: Don't change ViewStateUserKey when there is pending ViewState that hasn't been posted back and cracked open yet.

However, you can ONLY change Page.ViewStateUserKey in Page.OnInit, so we do a Response.Redirect after the Forms Authentication Cookie is sent out. This avoids any potential trouble with logging a user in on a postback, and cleans up the workflow considerably.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Zen of Web Services - Join me at the Boise .NET Developers User Group

February 09, 2005 Comment on this post [2] Posted in ASP.NET | Web Services | XmlSerializer | Tools
Sponsored By

I'll be in Boise on 2/17 at the Boise .NET Developers User Group giving a "two hour talk on angle brackets" as Simon Fell once describe it so astutely. It's my famous (in my own mind) "Zen and the Art of Web Services" talk, also known as "WS-SoWhat?" (also known as WS-BFD) and "How I stopped worrying and learned to love WSDL."

If you're in, around, near, or adjacent to Boise on 2/17 at 6:30pm, come hang out with me and mention that you saw it on my blog. I'll also show about four dozen free tools and utilities that will make your life easier. Come see my talk and I promise it won't suck, plus Law&Order is a repeat that night anyway.

Will Web Services save the world? More importantly, will they save you time? We'll separate the good from the bad and dig into the WHY of Web Services and the HOW of the .NET Framework. We'll go low level and sniff packets on the wire and we'll go high level and design business documents with XML schema. We'll auto-generate Business Domain Objects and Messages. We'll discuss the meaning of the WS*.* specifications, interoperability and get our heads around the "Zen" of Web Services and see where .NET succeeds and where it falls down. This talk will be as technical as you want it to be, but it will also be valuable for the Business Person or Project Manager who really wants to answer the question "Web Services: So What?" Doesn't sound like the typical Users Group meeting, does it? You'll just have to come by and find out!

Ever wish you could launch Visual Studio.NET and go “File|New Enterprise?”  Well, you can’t just slap [WebMethod] on your existing stuff and go to market.  Web Services and WS*.* have turned out to be the biggest buzzwords since ActiveX – let’s really dig in technically and find out what’s going on.  We’ll look at:

  • The Primordial Ooze that we called CSV files up until XML Schemas today
  • The Internals of XSD.EXE and the XmlSerializer
  • We’ll ILDASM and Reflect(or) our way through System.Web
  • Examples of replacing XSD.EXE with your own generated code
  • Exactly how Visual Studio.NET promotes Microsoft’s view of The Matrix, and how you can be more like Neo, and less like Neo’s cube-mates and co-workers.
  • How to use Web Services in any context, and how to promote Interop with other languages.
  • How to sniff SOAP on the wire and why you should care
  • How XSD Types map to CLR Types and how to deal with the NULL problem
  • How WSE applies to you, and how to CYA as we wait for Indigo.

Now playing: Dave Matthews Band - Stay (Wasting Time)

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.