Navigation

Search

Categories

On this page

Instantiating Proxy for Out-of-Process ServicedComponent/Managed COM+ Component
Preserving ViewState in ASP.NET CompositeControl
Guest Operating Systems Supported by Microsoft Hyper-V
Re-enabling Hyper-V after replacing software RAID-1 (mirrored) drive on Windows 2008 Server
Budget SSD RAID-0 on Windows 7
MagicISO (MagicDIsk) is a Superb Free Virtual CD/DVD Drive Emulator
HttpVPN is Released - First Public Beta is Launched

Archive

Blogroll

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

RSS 2.0 | Atom 1.0 | CDF

Send mail to the author(s) E-mail

Total Posts: 71
This Year: 2
This Month: 2
This Week: 1
Comments: 32

Sign In
Pick a theme:

 Sunday, July 25, 2010
Sunday, July 25, 2010 3:23:48 PM (Eastern Standard Time, UTC-05:00) (  |  |  )

It appears that a client proxy instance for and out-of-process ServicedComponent expects the client to have a compile-time reference to the ServicedComponent assembly, unless ServicedComponent is either of different CLR version or has different bitness (either client or server is x64 while another one is x86). This creates a bizarre problem: if the client has no design-time reference to the ServicedComponent, Activator.CreateInstance(compoentClsID) fails if the component is of the same bitness and CLR version with a cryptic "Cannot load type" RemotingException, while working perfectly fine when ServicedComponent is of different bitness or compiled targeting different .NET Framework version. Google offered no insight, so I started thinking of why matching CLR and bitness would lead to failure. I started suspecting that when client and server have mismatched CLR/bitness attributes, runtime must be doing cross-process marshalling in somewhat different manner than when attributes match. Now what I needed is to ensure that same "deep proxying" is taking place when client and server have matching CLR/bitness. On the hunch I decided to use overloaded Type.GetTypeFromCLSID(clsID, "localhost"), and lo and behold, it worked! Now I have a client that at design time is only aware of ServicedComponent's interface, but does not hold a direct reference to it, and yet it is able to talk to multiple out-of-process ServicedComponent implementing same interface while having different CLR and bitness attributes. At the end of the day it turned out to be possible to instantiate ServicedComponent while knowing neither its CLSID at the design time nor having a hard reference to the assembly implementing ServicedComponent.

Comments [0] | | # 
 Friday, July 16, 2010
Friday, July 16, 2010 10:33:00 AM (Eastern Standard Time, UTC-05:00) (  |  |  )

I thought I knew ASP.NET. I started ASP.NET programming in 2001, and I started it with customer/server control development and was cranking them out with no problem. So theoretically I should not have struggled for six hours with a CompositeControl not being able to save nested controls' state between postbacks.

All it came down to is calling EnsureChildControls() from the OnInit().

[ToolboxData("<{0}:BogusCustomControl runat=server></{0}:BogusCustomControl>")]
public class BogusCustomControl : CompositeControl
{
   
Button btn = new Button();

    protected override void OnInit(EventArgs e)
    {
       
base.OnInit(e);

        this.EnsureChildControls(); // << This is it! This makes ViewState work for a CompositeControl
    }

    protected override void OnLoad(EventArgs e)
    {
        if (!this.Page.IsPostBack)
        {
            // Set value once to test whether it's preserved between postbacks
           
this.btn.Text = DateTime.Now.ToLongTimeString();
        }

        base.OnLoad(e);
    }

    protected override void CreateChildControls()
    {
       
this.btn.ID = "whatever";
       
this.Controls.Add(this.btn);

        base.CreateChildControls();
    }
}

 

Comments [0] | | # 
 Saturday, October 24, 2009
Saturday, October 24, 2009 4:32:20 PM (Eastern Standard Time, UTC-05:00) (  |  |  )

http://support.microsoft.com/kb/954958

BTW, Windows 7 and Server 2008 R2 have Hyper-V HAL drivers in them, so when those two are installed as guest OSes, they take advantage of hardware virtualization even during installation, which makes the installation process go much faster compared to other guest OSes, and at the end of the installation one does not need to install Hyper-V integration services.

Comments [0] | | # 
 Saturday, October 10, 2009
Saturday, October 10, 2009 8:24:54 PM (Eastern Standard Time, UTC-05:00) (  |  |  )

Software RAID-1 in Windows server has a pitfall worth remembering: redundancy is working only when Windows is booted and is up & running. When machine is booting, it loads the OS from whichever drive is selected as first in the boot order in BIOS. If failing drive happens to be the first - the one from which Windows Server boots up, then two things needs to be done:
- BIOS settings have to be changed so that healthy secondary drive is used for booting, and
- Secondary Plex has to be selected as a default boot drive in Windows Startup & Recovery configuration.

Having Hyper-V adds even one more step. Hyper-V does something as the boot time, and is apparently enabled only on the first drive in the boot sequence. After you have made healthy secondary drive the first in boot sequence, secondary drive's boot routine needs to be manually adjusted to include loading Hyper-V, or you will get the dreaded, useless "Virtual machine could not be started because the hypervisor is not running" error when starting a virtual machine. To update your newly-selected boot drive for loading Hyper-V, run a Command Prompt as Administrator and execute following command:

bcdedit /set hypervisorlaunchtype auto

Reboot the server again - this time your secondary drive is bootable as far as BIOS concerned, secondary plex is used to boot windows, and Hyper-V is made to be loaded from the secondary drive too.

Comments [0] | | # 
 Tuesday, August 18, 2009
Tuesday, August 18, 2009 10:52:47 AM (Eastern Standard Time, UTC-05:00) (  |  |  |  )

Update: here's a very good walk-through of setting up BIOS on Intel chipset motherboard for OCZ SSD RAID array.

Since I was about to clean up my system anyway, I decided not only to install Windows 7, but also bite the bullet and get two SSD drives and put them into striped RAID configuration. I did it last weekend and yes, rumors are true: the performance boost you get from SSDs, especially from RAID-0 SSDs is by far the most noticeable and exciting in a generation. (From this point on, spindle hard drives are entering their twilight years, and pretty soon they will be where CRT displays are now.) It's kind of perverse, but perf improvement is so drastic that it now takes less time for Windows to boot than for the motherboard to finish the POST!

Here are points that might be useful for those trying to do similar setup.

- Not every SSD drive can be used in RAID configuration. At this point you need to stick with SSD drives having Indilinx controller. 60GB MLC drives like OCZ Vertex, Corsair Extreme, and OCZ Agility (the one I got, see the review) - are all reasonably priced and will work well with mainstream motherboards-based RAID controllers, like Intel Matrix RAID. Two of these drives cost just a little over what single 128GB drive costs, but two 64GB drives give you two controllers, twice the amount of on the drive cache, and connection to two separate SATA channels, all of which delivers much better performance than a single 128GB drive for about the same amount of money.

- Windows 7 does have Intel Matrix RAID driver, so no need to do the F6 thing to load it during windows installation.

- If you are putting your drives into a desktop machine, you will need mounting brackets to fit 2.5" drives into 3.5" bays.

- Since both Windows 7 and SSD drives are relatively new products, load the latest BIOS for your motherboard before you even connect your drives for the first time. It's also a good idea to get a relatively recent motherboard and ensure your mobo does indeed have RAID functionality. For example, if your motherboard has Intel chipset, letter "R" in ICH10R "south bridge" chip name seems to indicate presence of RAID support.

- If your motherboard has Intel Matrix RAID, change BIOS settings to make sure you put your on-board SATA controller into RAID mode. It actually should be called AHCI+RAID, because RAID is still AHCI. Non-RAID SATA drives may still be used when SATA controller in RAID mode with no problem at all.

- Even though Windows 7 comes ready for SSD drives, tweaks like disabling SSD drive indexing will improve either drives' longevity or system performance. Also, Windows 7 may not see the RAID group as 100% SSD. What it means is that when Win7 realizes there is an SSD drive in the system, it's supposed to automatically turn off superfetch and disk defragmentation. In my case it did turn off disk defrag for my SSD RAID volume, but didn't turn off superfetch - maybe because I have a couple of regular hard drives also connected (although not members of the RAID array).

- If you wonder whether ATA Trim command (that helps to maintain SSD drives' performance) is going to work in RAID configuration, then the answer is not yet. Currently, the choices for SSDs connected to Intel matrix raid controller are either RAID, or TRIM, but not both together. The reason for that is Intel Matrix Storage Manager (MSM) driver does not pass through TRIM command - only MS SATA and IDE drivers for Windows 7 do. So for TRIM one needs to use Microsoft drivers, which do not support MSM RAID. So if you do RAID, you will need to use Intel MSM driver, and wait for some future version of MSM that can support TRIM in at least in RAID-0 and RAID-1 configurations.

- Next version of OCZ firmware for Agility and Vertex SSD drives is expected to have background "garbage collection" built in, which is supposed to reset NAND cells while drives are idling.

Here's a very good post about SSDs on Windows 7, plus an absolute must-read article about most popular SSD drives from AnandTech.com.

ATTO benchmarks:
Take a look a all-important 4KB transfer rates (most common case for non-server scenarios) - it does astonishing 178MB/s writes and 180MB/s reads:

Compare it with 53MB/s writes and 35MB/s reads of $440-worth, fastest 120GB MLC drive - OCZ Vertex Turbo:


...or with arguably the best SSD drive there is - $800 Intel X-25E SLC drive - it does 104MB/s writes and 120MB/s reads on 4KB block size:

 

Comments [0] | | # 
 Monday, August 17, 2009
Monday, August 17, 2009 10:42:59 AM (Eastern Standard Time, UTC-05:00) (  |  |  )

Whenever I setup a new Windows PC, I always forget which virutal CD/DVD software I use. So this is a note to myself: it's MagicISO. It allows to mount an ISO image right after the software is installed, without requiring a reboot, and it works with both x64 and 32-bit version of Windows, including Vista and Win 7. Great tool!

Comments [0] | | # 
 Thursday, July 30, 2009
Thursday, July 30, 2009 11:35:58 PM (Eastern Standard Time, UTC-05:00) (  |  |  |  )

HttpVPN™, a redistributable component for hosting web applications targeting home users and small businesses, is released as Beta. It makes web applications accessible on the web at MyOwnSecureWeb.com right after the installation and does not require users to fiddle with routers, set up DMZ, etc. Just a consumer-friendly, secure self-hosting of web apps.

Comments [0] | | #