Welcome to MSDN Blogs Sign in | Join | Help

Uninstalling VS 2008 SP1 Beta and HTML designer update

Just in case you want to uninstall VS 2008 SP1 Beta, please remember that Web designer is a separate product so you may have to uninstall its update manually in Control Panel. Look for "Update for WebDesigner 2007 (KB945140)" and uninstall it after uninstalling VS service pack. The name will change in SP1 RTM though.

Video tutorials on HTML designer

Since VS is sharing HTML designer with Expression Web, many videos available for Expression Web may also be useful for Visual Studio users.

LearnExpression is a great site with many videos on designer tools and page layout: http://www.learnexpression.com/. There are also videos at the Microsoft Expression sites here: http://expression.microsoft.com/en-us/cc197140.aspx

Use CSS Layout in Expression Web

Sophisticated CSS-based Layout and Formatting

User CSS Style Sheets in Expression Web

Wireless mouse, HTML editor and idle time processing

Several people reported issues when toolbox, validation and/or server code intellisense do not work reliably on some machines. Turned our that the issue is related to wireless mouse driver broadcasting messages and preventing Visual Studio IDE from processing idle time. Rick Strahl blogged about this here and here. The problem also manifests itself in the OS when screen saver never activates and/or machine never goes to sleep. There are several KB articles on the issue, here is a combined one: http://support.microsoft.com/kb/555920

So why HTML editor seems to be more sensitive? And why IDE needs idle time processing at all? Why not use background threads, for example?

Application enters idle state when there are no more messages in the queue. On a fast machine this may happen even between keystrokes: I blogged about it here. Since we do not want idle time processing to affect typing, idle time processing is delayed a bit in order to avoid starting idle process between keystrokes. Different editors and components in VS may choose different delays depending on length of the idle time operation. For example, if operation is only going to take 100ms there is little reason to delay it at all. On the other hand, if operation is going to take a second, then we need to be sure that user activity has stopped. However, if a new message comes before delay interval expires, idle time never happens. Thus, if one editor delays idle processing by 200ms and another delays by 1000ms while wireless mouse driver broadcasts messages every 500ms, then former editor won't be affected while latter definitely will be.

Why do we need idle processing at all? Some operations, like HTML validation,  are lengthy and we don't want to block the UI for long. Therefore validation is running on idle, processing elements in chunks and yielding if there is a keyboard or mouse activity. Ideally operations like this should be happening in a background thread. Unfortunately, not all operations can be moved to background threads since not all interfaces in VS are thread safe and thus must be called in the context of the main (UI) thread.

In VS 2008 HTML editor some additional operations were added to idle loop (like toolbox building) which, I guess, made the loop too heavy. We are working on structuring operations better and moving certain parts back to the main code path in the next service pack. We are also looking into employing more background thread processing in future releases since this will allow us to avoid idle processing altogether.

Sharing designer between Expression Web and Visual Studio

As you probably know, Visual Studio 2008 and Visual Web Developer Express 2008 include designer that is shared with Expression Web. See my earlier post on this. Both Expression Web and VS are using same base code, but each team adds unique functionality. We share bug fixes and core feature set. For example, VS 2008 improved server control positioning, added .NET 3.5 and support for CSS overflow property. All these improvements will be available in Expression Web 2, currently in Beta. Expression Web 2 will also include fixes that are not in VS 2008 RTM since they were made to the designer after VS has shipped. These changes will appear in the next VS 2008 Service Pack (I don't have public date, sorry).

Note that designer is not shared as a binary, so installing Visual Studio 2008 will not update Expression Web 1.0 designer and install of Expression Web 2 will not change Visual Studio or Visual Web Developer 2008 RTM bits.We share base source code, but each team builds its own copy and authors their own setup. There are various reasons to this, both technical and logistical, such as different teams are using different set of tools. Developer division always dogfoods the most recent compiler, so VS 2008 is built using VS 2008 C++ and C# compilers. However, Expression team does not use "hot" compilers and instead use shipped versions.

Microsoft Web Authoring Component setup and Compatibility Pack for the 2007 Office system

I have found that a few people could not install Visual Web Developer 2008 or Visual Studio 2008 because Microsoft Web Authoring Component setup was failing on their machine. In order to diagnose the problem it is necessary to look into SetupExe(...).log files that can be located in the user TEMP folder. The file is long, but close to the end one can find actual error message. Often it is about some Office 2007 Beta component. Remember, designer is based on Office 2007 so its setup will fail when Office 2007 pre-release bits are installed. However, in some cases installed product did not appear in Control Panel. However, at the end of the SetupExe(...).log file one could find 

Catalyst beta product conflict check failed. Office Beta product conflict is detected on the computer, productcode={30120000-00B2-0409-0000-0000000FF1CE} Not showing message because suppress modal has been set.  Title: 'Setup Errors', Message: 'Setup is unable to proceed due to the following error(s): The 2007 Microsoft Office system does not support upgrading from a prerelease version of the 2007 Microsoft Office system. You must first uninstall any prerelease versions of the 2007 Microsoft Office system products and associated technologies. Correct the issue(s) listed above and re-run setup.

Quick Web search for 30120000-0020-0409-0000-0000000FF1CE releaved that is was Compatibility Pack for the 2007 Office system (Beta)". Look here for more details: http://www.brokenwire.net/bw/Programming/58/visual-studio-2008-installfest-problems-with-the-visual-web-developer

Compat pack can be uninstalled by running

 

msiexec /x {30120000-0020-0409-0000-0000000FF1CE}

 

as admin.

 

Absolute and relative positioning in Visual Studio 2008 Web designer

Design view in Visual Studio and Visual Web Developer Express 2008 provides several tools that help with absolute and relative positioning of controls. I'd like to describe how do they work and what kind of visual hints the designer provides.

How do I set my control position to absolute? Use Format | Position menu:

Format menu 

Unfortunately, because of a bug, the menu is disabled for <span> and <a> based controls. To enable the menu, add style="display:block" to labels or hyperlinks. This will be fixed in the next service pack. You can then use the Position dialog to set positioning mode:

 

In most cases you'll want absolute positioning. After setting the position you should be able to move the control around. There are two ways you can move the control:

Dragging the control

Watch the status bar, it provides hints about various options you have in moving and resizing 

Status bar

Designer also provides visual cues to which element is control's positioning container. This is important to know since absolute positioning in CSS does not work the same way it works in Windows Forms. Controls are not always positioned relatively to their immediate parents. Instead, they are positioned relatively to their containing block. For absolutely positioned controls that would be the nearest ancestor that has position attribute set in its style or a body element. When you select absolutely positioned control, designer display four guides and highlights the positioning contaner.

Here is an example when element is in a div, but is positioned by another, outer div

 

In this example button appears to be in <div>, while, in fact, it is in the <body> element.  

Designer also supports relative positioning. Relative positioning is tricky though. It is not relative to the parent control. Instead, relative position describes shift of the element from its normal position in the layout.

 

As you can see, if element is relatively positioned, designer only draws two guides instead of four. Although rendering seems odd, this is exactly how FireFox renders the page:

 

Unfortunately, IE7 does not render the page same way FireFox and Visual Studio 2008 Web designer do:

 

In order to help with element alignment, designer provides a grid, ruler and ability to snap element position to the grid. You can activate this functionality in Tools | Options

As well as in the View menu

PHP coloring in Visual Studio 2008

Now, this is a creative way of using C++ colorizer to colorize PHP in VS 2008 :-) It won't work in VWD Express though since it employs C++ editor as PHP colorizer.

Spell checker update 2.1: a few bug fixes and couple of new features

Bug fixes:

  1. <param>Text</param> was not handled correctly.
  2. Comments in <% %> blocks were not included in spell checking.
  3. Spell checking terminated prematurely under certain conditions after encountering <% %> block.
  4. REM VB comments were not always handled correctly.
  5. Vista setup issues fixed (hopefully)

New features:

  1. It is now possible to add word to "ignore" list. The list is global and is stored as a text file.
  2. You can also add words to the Office active custom dictionary.


Spell Checker 2.1

List of word to ignore is a Unicode text file and stored in your user roaming profile folder. It is shared across VS 2005 and VS 2008 add-ins if you have both versions installed.

Spell Checker 2.1 ignore list location

Microsoft Office custom dictionary file is also a Unicode text file that is stored in the roaming profile in the Microsoft\UProof folder

Microsoft Office custom dictionary location

You can either either file in Notepad. Alternatively, you can edit list of words in the Office custom dictionary using Microsoft Word facilities:

Microsoft Word menu

Microsoft Word proofing options Microsoft Word custom dictionary editor

Since using custom dictionary and ignore list introduces certain perfomance hit (which depends on the dictionary size), you can turn it off in rules.xml file located in the Spell Checker installation folder (typically C:\Program Files\VS 2008 Spell Checker Add-In ) and change useOfficeCustomDictionary and/or useIgnoreList to 0.

<options>
    <
useOfficeCustomDictionary>1</useOfficeCustomDictionary>
    <
useIgnoreList>1</useIgnoreList>
</
options>

For multilanguage spell checking, please look here and here. More details on how spell checker works and its various options can be found here

Important note: Add-in does not work with Visual Web Developer Express as Express editions are not extensible.

Visual Studio 2005 Add-in download

Visual Studio 2008 Add-in download

Troubleshooting

If after setup add-in does notnot show up in Visual Studio Tools menu, try installing component in admin mode. Save downloaded MSI file on disk, locate command prompt icon in the Windows Start menu (typically in Accessories folder), right click on it and select Run As Administrator. Then run MSI file from the admin command window. If, for some reason, add-in still does not appear in Visual Studio, try running regsvr32 vsspellchecker.dll from the admin command prompt in the add in installation folder. Some more information about add-in registration is here.

How to select language for spell checking in code comments

A few users asker how to select language for spell checking in the code comments. Egil Hansen (see comments to http://blogs.msdn.com/webdevtools/archive/2007/12/13/spell-checker-for-html-asp-net-jscript-vb-c-css-and-c-for-visual-studio-2005-and-2008.aspx#comments) discovered Microsoft Office 2007 Language Settings application in the Office Tools folder:

 You can use it to change default editing language in Office application and it should also change default language in the spell checker add-in.

Compatibility problem between VS 2008 and Office 2000 and how to fix it

A few users discovered that design view in VS 2008 and Visual Web Developer Express 2008 may get broken when Office 2000 is installed. See, for example, http://forums.asp.net/p/1194475/2061103.aspx#2061103 and http://forums.asp.net/t/1191630.aspx. Actually, the issue is wider and may affect Office 2003 installation as well. The problem manifests itself when machine has path to the Office folder with older version of fpcutl.dll specified in the system path. User might do this so they could run Office from the command line. However, adding Office path to the system path causes OS to pick the older dll when VS 2008 designer tries to loads its components. You can learn more about how OS loads dlls in the LoadLibrary API documentation.

As a workaround, try setting path to the VS 2008 designer (typically Program Files\Microsoft Web Designer Tools\VWD) before path to the Office folder or remove path to the Office folder completely from the system path. For Office 2000 this is normally Program Files\Microsoft Office\Office. Adding VWD path before Office should not affect Office applications or FrontPage 2000 since they use custom dll discovery mechanism.

 

Troubleshooting Spell Checker setup

If after setup Spell Checker does not appear in the Tools menu, try the following

  1. Try installing add-in as administrator. Setup needs to register COM components so it needs access to Local Machine registry key. You may want to save MSI file to disk first and then run it.
  2. Try registering component manually by running regsvr32 vsspellchecker.dll from the command line in the installation folder.
  3. Verify that Add-in appears in the registry. Here are screenshots of the VS 2005 add-in registration:






Spell checker for HTML, ASP.NET, JScript, VB, C#, CSS and C++

Following Visual Studio 2008 release I updated my Spell Shecker add-in so it works with VS 2008 as well as added some new functionality. So here is version 2.0, updated for VS 2005 and now available for VS 2008.

Usual disclaimer

This software is provided "AS IS" without any warranty, implied or otherwise. I wrote this software in my own spare time, it is not supported by Microsoft Corporation in any way. The software is provided in binary form, free of charge. If you wish to send me a bug report, suggestion or ask a question, please use my blog. You can post question or suggestion in the comments.

What's new in version 2.0:

Spell checker now supports text verification in:

  • HTML style comments <-- HTML -->
  • ASP.NET server side comments: <%-- ASP.NET --%>
  • JScript, C# and C++ comments: // C++ style comments
  • CSS and C style comments: /* C style comments */
  • VB and VBScript style comments: 'This is VB comment


Spell checking is supported in style and script blocks as well as in JS, CS, VB, CSS, CPP ahd H files. There are two separate binaries for VS 2005 and VS 2008. The can be installed side by side if you have both VS 2005 and VS 2008 installed on the machine.

Requirements:

Microsoft Visual Studio 2008 or 2005, any edition except Express.
Microsoft Word 2003 or 2007

Installation

Close Visual Studio
Download and run VSSpellChecker2005.msi or VSSpellChecker2008.msi.
Run Visual Studio
Open a Web site or standalone HTML, ASP, VB, C#, JS, VBS, CSS or CPP file.
You should see Spell Checker entry in the Tools menu.


Uninstall

Close Visual Studio
Open Control Panel
Go to Add/Remove Programs
Locate Spell Checker Add-in for Visual Studio 2005 or 2008 and click Remove.


How to use the Spell Checker

Open a Web Form, HTML, ASP, JS, VBS, CS, VB, CPP or CSS file and click Tools | Spell Checker. Spell check may take 10-15 seconds on decently sized files. There is no immediate progress indication, but you can see that squiggles appear one by one under misspelled words. Double click on the misspelled word brings list of suggestions. <Cancel> closes the suggestion list. Spell checker messages also show up in the Error List as informational messages. They are not entered as errors or warnings so they don't break builds.

VS 2005 screenshot:

Spell Checker for VS 2005

VS 2008 screenshot:

Spell Checker for VS 2008

As before, Spell Checker support mutiple languages in HTML markup, it detects lang attribute specified on elements, extracts ISO language and uses it to specify appropriate dictionary for the Office spell checking engine.It uses default Office spell checking language in code comments:

Multilanguage spell check

In order to be able to spell check multiple languages you may need to install Microsoft Office 2003 Proofing Tools or an appropriate Office 2007 Language Pack. If you never used particular language dictionary in Word, you have to try it before it becomes available in the Spell Checker add-in. Many dictionaries are installed on demand and if particular language was never activated in Word, the dictionary may be still missing. Open Word, type something in the desired language and run Word spell checker at least once to make sure it works and dictionary is installed.

Customization

You can customize spell checker behavior by editing rules.xml file located in Program Files\VS 2005 Spell Checker Add-In or VS 2008 Spell Checker Add-In. You can exclude certain elements and add more rules for attribute checking. You probably want to do that if you are using custom controls and want spell checker to verify spelling in custom control attribute values. All element and attribute names much be in lowercase. You don't have to close the HTML document or Visual Studio after editing the file, the file is loaded every time spell checking is performed.

<?xml version="1.0" encoding="utf-8"?>
<rules>
  <!-- Exclude content of script and style elements from spell check -->
  <exclude name="script" />
  <exclude name="style" />

  <!-- Check 'value' attribute on all elements without a namespace -->
  <element name="*">
    <attribute name="value" />
  </element>

  <!-- Rules in ASP namespace -->
  <namespace name="asp">

    <!-- Check all attributes ending in 'text' as well as tooltip attribute in all ASP.NET elements -->
    <element name="*">
      <attribute name="*text" />
      <attribute name="tooltip" />
    </element>

    <!-- Special rule for asp:Calendar -->
    <element name="calendar">
      <attribute name="caption" />
    </element>

    <!-- Add more rules for ASP.NET elements here if needed -->
  </namespace>

  <!-- Add rules for custom controls here if needed -->
 
</rules>

Important note: Add-in does not work with Visual Web Developer Express as Express editions are not extensible.

Visual Studio 2005 Add-in download

Visual Studio 2008 Add-in download

Troubleshooting

You may have to run as admin during the setup since add-in needs to register COM components. If, for some reason, add-in does not appear in Visual Studio, try running regsvr32 vsspellchecker.dll from command line in the add in installation folder in Program Files.

Enjoy :-)

How to set CSS validation to warnings

I blogged earlier about ability of VS 2008 and Visual Web Developer 2008 to display HTML and CSS validation errors as warnings. Unfortunately, there is a small bug in the setup so although dialog displays that default setting is 'warnings', in fact, CSS issues are still flagged as errors. To fix this please do the following:

1. Go to Tools | Options | Text Editor | HTML | Validation and set HTML/CSS to errors (uncheck the option).
2. Click OK.
3. Repeat #1 but now set the option to warnings.

Click OK and you should be set.

Common problems installing Microsoft Web Authoring Component

When you are installing VS 2008 or VWD Express 2008 you may encounter failure when Microsoft Web Authoring Component fails to install. There are two known reasons:

1. Setup may encounter conflict with Windows Update on Vista when both setup and Windows Update are trying to access same file. The issue will be resolved in Vista SP1, meanwhile workaround is to reboot machine and attempt setup again.

2. Pre-release Office 2007 software is installed on the machine. Most common case is XPS Document Writer (can be found in the Control Panel). You have to uninstall any pre-release Office 2007 pieces since HTML designer in VS 2008 includes Office 2007 RTM components and hence is not compatible with Office Beta bits.

WAC setup logs can be found in the TEMP folder, they are named as setup*.log. If you sort files by date, you should see most recent ones and can peek inside for more technical information. If you are going to submit a bug or need assistance, please attach .log file to the bug in Connect or, if you are seeking help in ASP.NET forums, please list error code and error message from the log file in the forum post.

It is done

You already know from Soma's and Scott's blogs posts that Visual Studio 2008 and .NET 3.5 have been released and available for download at MSDN. Visual Web Developer Express 2008 has also been released and is available for download. Difference from Visual studio 2008 is largely the same as in VS 2005, you can find description of major differences here. Otherwise VWD Express provides new HTML and Web Form designer, full spectrum of CSS editing tools, Split view, nested master pages, JScript intellisense and validation, full Ajax support, ability to target .NET 2.0, 3.0 or 3.5 etc, etc. We hope you will enjoy it :-)
More Posts Next page »
 
Page view tracker