Cyprich.com

Occasionally Relevant Insights from a Software Builder

By

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

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.

By

How To Rotate Your Screen Display

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.

By

HTML 5 Support for Visual Studio 2010

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>
<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.

By

How to Redirect a WordPress Page to a URL

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.

By

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

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.