June, 2011

How to Fix: “The name ‘HttpUtility’ does not exist in the current context”

By on June 30, 2011

The HttpUtility class is a part of System.Web in Visual Studio and should be available in .NET 4.0. If you include this library in your application and an error is being generated, check the properties of the project. In the Application tab, the Target framework should not be a Client Profile, but the full framework, i.e. .NET Framework 4 (see image below).

Setting Target Framework in project properties.

If this doesn’t fix the error, then add System.Web as a reference to your project (see image below).

Adding System.Web to references.

The error should be corrected after these changes are applied.

How To Rotate Your Screen Display

By on June 24, 2011

Every once in a while, I see someone who accidentally rotates the display output on their monitor. Its typically upside down, but it could also be rotated to the left or right. There are no obvious key sequences in Windows that can do this and it would have the average person contacting their IT department or local computer expert for help.

Why would there be a feature in Windows for rotating the display? Many wide screen monitors can be rotated to a portrait position instead of the default landscape one. When you do this, you need to rotate the screen display to match the new physical position. This is typically done through your computer and not from the monitor’s controls.

Rotating the screen is very easy. Press and hold both the Ctrl and Alt keys, then while still holding them, press an arrow key. The left/right keys will rotate in those directions, the up key will rotate the screen 180 degrees, and the down arrow will restore the screen to the original landscape reading position.

Rotating a screen can a fun way to annoy co-workers, but you need to keep in mind that when you change the screen orientation, all of the desktop icons are reset and it make time to place them back to where they were originally located.

HTML 5 Support for Visual Studio 2010

By on June 17, 2011

Mads Kristensen published his Web Standards Update for Visual Studio yesterday which gives it full HTML 5 support (see image below). The update only works with SP1 versions of Visual Studio (full version and express) and can be downloaded here.

This update gives intellisense support for HTML 5 pages, CSS 3, and additions to JavaScript (i.e. geolocation and DOM storage). The only problem is that when you create a new web page or form, it doesn’t give you the HTML 5 DOCTYPE and html settings.

This is what is created in a new web form:

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>

and this is how is should be formatted for HTML 5:

<!DOCTYPE html>

This isn’t a big deal but hopefully future versions will have this fixed.

HTML 5 is important to learn because the web is moving towards it and it will be heavily used in Microsoft’s new Windows 8 operating system. Microsoft recently showed applications for Windows 8 written entirely in HTML 5 and JavaScript.

HTML 5 Validation in Visual Studio 2010.

How to Redirect a WordPress Page to a URL

By on June 13, 2011

A page in WordPress can be easily redirected to a URL without using a plugn. It just requires a little knowledge of HTML. In the Title of the page, add <a href > code which points to the URL that you want to display.

On my blog, I created a Forums page which has the following code in the Title:

<a href=’http://forums.cyprich.com’>Forums</a>

Forums is the actual page title that will appear on the blog (see image below).

Redirecting a WordPress Page to a URL.

This is not an approved method of redirecting UR’s with WordPress and it may not work with all themes. You can include target=’_blank’ if you want to open the page in a new window instead of overwriting the current window.

Visual Studio 2010 Build Error: Unable to find manifest signing certificate in the certificate store

By on June 9, 2011

This error can appear during a project build in Visual Studio if you decide to create a stand alone installer when the project was initially set to use ClickOnce technology. The error message can occur when the signing certificate (.pfx) is deleted or the project is moved to another computer.

To prevent this message from displaying, right click on the project and select Properties. Click on the Signing tab and you will see the Sign the ClickOnce manifests checkbox selected. Remove the check here and then you can re-build the project without errors.

Turning off ClickOnce for a Visual Studio project.

A More Powerful Way to Administer Passwords (control userpasswords2)

By on June 1, 2011

Windows users typically modify their login accounts through the User Accounts or Computer Management apps in the Control Panel. This would typically be sufficient for performing the most common tasks, such as changing your password.

I recently activated an Administrator account through a registry hack in Windows XP. This was done by adding Administrator as a dword and setting the value to 00000001 in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon\SpecialAccounts\UserList. Administrator is then an option to login to Windows, along with the administrator account that you created when Windows was installed. There is no way to delete the old administrator account through the Control Panel options because its the default administrator account. In order to delete it, you need to use another app.

In the Start menu, select Run (or press WindowsKey R). Enter control userpasswords2 in the Open text box, and press OK (see below).

Starting control userpasswords2.


The User Accounts dialog box will open. You can change any password by selecting the User Name and pressing the Reset Password button. Access level can be changed by pressing the Properties button. You have many more options here than in the Control Panel for setting the access level.

The User Account main dialog box.


The advanced tabs offers the ability to set passwords for network shares by pressing Manage Passwords. This option can be done manually through the command line. The advanced options also gives you the ability to require users to press Ctrl-Alt-Delete to login to their account. This will increase the security of your computer because it will prevent a hacker on the outside from gaining login access to your machine.

The Advanced tab in User Accounts.