Sunday, November 27, 2011

VB.NET - How to obtain a DLL's file location (during run-time)

In order to obtain a running EXE's file location, you may use the method: System.AppDomain.CurrentDomain.BaseDirectory to get it. However, this method doesn't work similarly for a running DLL. This is because it would return the file location of the "container" that calls the DLL, but not the DLL itself.

So the proper way to obtain a running DLL's file location is to use the method: System.Reflection.Assembly.GetExecutingAssembly.Location

Many credits to this site.

Monday, November 14, 2011

Windows XP SP2 installation could not detect your internal harddisk? It's the AHCI/ATA setting in your computer BIOS.

Last night I faced a small glitch when I tried to reinstall a fresh copy of Windows XP Home Edition SP2 on a DELL Inspiron laptop which was pre-installed with Windows Vista - the internal harddisk which had been working fine with Windows Vista suddenly just "vanished" from the radar of the Windows XP installation. In other words, the Windows XP installation told me that there's no internal harddisk whatsoever detected on the computer.

Lucky for me, I read about this AHCI setting previously and I quickly went into the computer BIOS screen (just keep on pressing the F2 or DEL key when you start/restart your computer) and looked for this setting. When I found the place to change the setting (look for something that reads "AHCI" or "ATA") I just switched it from the pre-configured AHCI to ATA mode. After that I just saved the changes made and exited the BIOS screen (then your computer will restart automatically). And then I tried the Windows XP installation once again and finally got it working.

I read it in some Internet forums and some people said it's due to the lack of support for AHCI by the Windows XP Service Pack 2 (SP2).