Tuesday, February 17, 2009

ASP.NET CodeBehind vs. CodeFile

I use Visual Studio 2008. Once and a while I get a .NET error that causes me to modify the @Page directive from CodeBehind to CodeFile, or visa-versa.

Folks tend to give all types of lengthy explanations on when to use one vs. the other. Here is a quick explanation...

.NET Web Sites ---> Use CodeFile
.NET Web Apps ---> Use CodeBehind

Done. Any questions?

Tuesday, February 3, 2009

Remove / Uninstall old devices (network card)

I've run into this twice during the past month so I figured I had better post something about it.

Once and a while I remove something like a network or graphics card from a computer. If I do this while the computer is off, then the next time the computer is turned on, the old device is still there, sometimes hidden. Attempts to install a replacement device may either fail because of "not enough resources" or something else like a PCI slot conflict.

First, before uninstalling a device, use the device manager and perform an Uninstall. If you do that, the information below won't be needed. But if you are like me and remove device while computers are off (normally old ones sitting in closets), you may need to do the following...

Start the computer and open a console window (may want to run with Admin privs for Vista or later operating systems).

Set the following environment variable:

set devmgr_show_nonpresent_devices=1

Now open the device manager via the console window (must be done via the console window since this is where the new environment variable exists).

devmgmt.msc

On the View menu, enable "Show Hidden Devices" then find the old/removed device and uninstall it.

For best results, reboot!

Can't RDP? How to enable / disable virtual machine firewall for Azure VM

Oh no!  I accidentally blocked the RDP port on an Azure virtual machine which resulted in not being able to log into the VM anymore.  I did ...