subtext, blog, aspnet comments edit

It’s been a long time in the making, but since the last time I tried to upgrade my blog to the latest Subtext failed so miserably, I wanted to build up a full staging environment and test the heck out of it before trying to do it in production. To that end, I got a Windows Server 2003 VM up and running, complete with my web host’s slightly-customized Medium trust configuration files and a copy of a recent database backup, and ran through the upgrade process.

Turns out it’s a good thing I did it in staging first. I discovered a few things that didn’t upgrade too smoothly so it’s good I caught them.

First, a couple of spots in the web controls changed from List<T> to Collection<T>, which isn’t a big deal but does cause a bit of a headache if you’ve got some custom stuff in App_Code that fails to compile because of that. Again, though, no big deal.

The showstopper ended up being this second problem: While the home page would load fine, going to any individual entry page would yield the Yellow Screen of Death with a FileIOPermission problem in Ssytem.Web.UI.ScriptManager:

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

Stack Trace:

[SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
   System.Security.CodeAccessPermission.Demand() +59
   System.Reflection.Assembly.VerifyCodeBaseDiscovery(String codeBase) +118
   System.Reflection.Assembly.get_CodeBase() +32
   System.Web.Handlers.ScriptResourceHandler.GetCodeBaseWithAssert(Assembly assembly) +31
   System.Web.Handlers.ScriptResourceHandler.GetLastWriteTime(Assembly assembly) +36
   System.Web.Handlers.ScriptResourceHandler.GetAssemblyInfoInternal(Assembly assembly) +58
   System.Web.Handlers.ScriptResourceHandler.GetAssemblyInfo(Assembly assembly) +59
   System.Web.Handlers.RuntimeScriptResourceHandler.System.Web.Handlers.IScriptResourceHandler.GetScriptResourceUrl(Assembly assembly, String resourceName, CultureInfo culture, Boolean zip, Boolean notifyScriptLoaded) +336
   System.Web.UI.ScriptManager.GetScriptResourceUrl(String resourceName, Assembly assembly) +114
   System.Web.UI.ScriptRegistrationManager.RegisterClientScriptResource(Control control, Type type, String resourceName) +115
   System.Web.UI.ScriptManager.RegisterClientScriptResource(Control control, Type type, String resourceName) +9

What the heck?

Turns out Subtext 2.1.0.5 ships with a copy of the ASP.NET AJAX 1.0 System.Web.Extensions assembly in its bin folder. On a system with .NET 3.5 SP1 installed, you don’t want the old one - you want the new one, particularly since it’s in the GAC and will run with Full trust.

To fix the issue, I deleted the local copy of System.Web.Extensions.dll from the bin folder and added the following bindingRedirect to the web.config file:

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
        <bindingRedirect oldVersion="1.0.61025.0" newVersion="3.5.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

Done and done. After that, everything seemed to work perfectly. There are a lot of new featues in Subtext 2.1.0.5 that I’m looking forward to taking advantage of, so now I’ve got to schedule some time to do the upgrade. Probably not this weekend - I really want to take it easy. But soon.

media, tv comments edit

Samsung
LN52A750We took some of our tax return and went to Best Buy and got a Samsung LN52A750 52” LCD TV. This was to replace the Sharp Aquos 37” TV we had. (The Sharp will go upstairs to our game room so we can have a more permanent Rock Band setup.) I was about to order from Amazon, but Best Buy/Magnolia met the Amazon price and having the ability to take the thing back to a local brick-and-mortar store if there’s any problem is a huge weight off my mind. I guess I’m old-fashioned that way.

All I have to say about this Samsung is… WOW. It’s seriously amazing. The clarity and colors on this thing are unbelievable compared to the Sharp. Without tweaking any of the settings, we plugged it in, turned it on, and started watching some of the shows we’d recorded on the DVR.

Watching The Unit, we seriously started wondering if they’d changed the film style or something since the last time we’d watched. The edges on things seemed crisper, the colors and contrast seemed better, and the motion seemed somehow different - smoother, perhaps, but just… sort of unquantifiably different. Clearer. It was almost like we were watching an IMAX documentary rather than a TV show.

When we started watching Heroes, though, we noticed the same thing - it just looks so much more crisp. That’s when we realized what a difference the TV was making. We didn’t even notice that in the store - that’s just something we saw when we got it home.

The other thing I was worried about was how the media center PC would hook up to it. With the Sharp, I had to run at a weird resolution that left letterboxing on the sides and I was afraid I was going to have to tweak some settings at a really low level to get full HD out of it. Not so! I connected it via HDMI and instantly got full 1920x1080p. No letterboxing, no problems, crystal clear. I seriously did a little dance when I saw that. I’m still smiling about it.

Anyway, I’ve admittedly only had it for a day, but Jenn and I are both floored by it. I can’t wait to try some serious gaming on this thing.

media, windows comments edit

For my media center solution, I’m using a Windows Home Server as my primary storage for everything - music, photos, DVD images, videos, computer backups… the whole shmear. I love it. I bought the 1TB HP EX-475 model and did a few upgrades, adding memory and filling out the drive bays.

After ripping all of my movie DVDs to the server, I had about 470GB left

  • plenty for music and photos, but not enough for me to rip my TV DVDs to the server and have those available in the library.

I considered adding storage through USB drives, but they recommend only plugging directly into the server’s USB ports and not using a hub… and there are only four ports. I know I’m going to use one of them soon for off-site backups. So… how to add drives in a scalable fashion?

The answer: Use the eSATA port on the back of the home server.

I picked up a Rosewill RSV-S5 5-bay eSATA port multiplier and two 1TB WD Caviar Green drives on a great sale at NewEgg. Plugged the drives into the port multiplier, plugged the port multiplier into power, shut down the home server, connected the port multiplier to the home server, and powered on the port multiplier then the home server. No software to install, no fuss, no muss. After adding the drives to the storage on the home server, I’m up to 4.55TB total storage with 2.2TB free!

My WHS control panel: 4.55TB total, 2.2TB
free.

The nice thing is I have three more eSATA bays free in the port multiplier so I can easily continue expanding. Plus I haven’t taken up the USB ports yet so I still have all of that to go, too. An easy upgrade that enables even easier future upgrades - you can’t beat it. Next to adding RAM, I’d say this is the most valuable thing you can do to your home server.

UPDATE 6/16/2010: Beware the WD Green drives. Only some of the model numbers perform well. I ended up replacing some of the ones I had bought when I originally wrote this post.

GeekSpeak comments edit

This process has been posted for Windows XP SP2 and Vista, but I tried both of those to no avail on this Windows 2003 system I’m working on. The idea: Replace standard Windows Notepad with Notepad2.

What I did to get it working:

  1. Logged in as Administrator.
  2. Downloaded Notepad2, extracted Notepad2.exe to my desktop, and renamed it notepad.exe.
  3. From the Vista instructions, I changed the owner of the file to the Administrators group.
  4. Made a backup copy of the original notepad.exe in C:\WINDOWS.
  5. Ran a batch file to copy the notepad.exe from my desktop into the SEVEN locations I found it under in the C:\WINDOWS folder.

Only by copying it literally over all seven of the locations I found it did the change finally take. Here’s the batch script that I ran from my desktop:

copy /y notepad.exe "%windir%\system32\dllcache\notepad.exe"
copy /y notepad.exe "%windir%\system32\notepad.exe"
copy /y notepad.exe "%windir%\notepad.exe"
copy /y notepad.exe "%windir%\$NtServicePackUninstall$\notepad.exe"
copy /y notepad.exe "%windir%\LastGood\notepad.exe"
copy /y notepad.exe "%windir%\LastGood\system32\notepad.exe"
copy /y notepad.exe "%windir%\ServicePackFiles\i386\notepad.exe"

It felt like the nuclear option to me, but it was the only way to make it work. (Should you choose to do this, you do so at your own risk - I’m not responsible if the system feels like you’re hacking it and sucks you in like in Tron or something.)