Welcome to MSDN Blogs Sign in | Join | Help

What kind of extensibility would you like to see in HTML/ASPX editor?

Have you ever wanted to extend HTML editor Source view or perhaps modify some of the existing functionality? Perhaps you always wanted to write an add-in or a simple feature youself but lack of extensibility support (or lack of information on it) prevented you from doing it? There is a large amount of information available at Visual Studio Extensibility portal, but I do know that we in the Web Tools team don't currently provide rich extensibility support. For example, we do not expose element tree that our parser produces and it is not easy to modify context menus.

What kind of extensibility point you would like to see? Perhaps we could publish an add-on library you could use to access cetrain internal structures? If you do not feel like publishing your add-in ideas just yet, feel free to e-mail me with requests for extensibility at mikhaila-at-microsoft-dot-com. Feel free also to ask about Design view extensibility as well.

 

A lot of snow around Seattle

It has been heavily snowing for more than a week. I cleaned my driveway four times already, each time removing a foot of snow - good excercise :-). However, our street was only plowed once :-( so one really needs a high clearance car to get out. It is snowing every year and yet city does not have snow plows. Power went out twice - we are lucky to have a backup generator. It is still a mystery to me: every year we have snow, strong winds and heavy rain. And each time city and utility company are unprepared. Kids are having fun sledding and building snow forts though :-)

Posted by Mikhail Arkhipov (MSFT) | 1 Comments
Filed under:

Russian VS 2008 SP1 has been released

Пакет обновления 1 (SP1) Microsoft Visual Studio 2008 (установщик)

http://www.microsoft.com/downloads/details.aspx?displaylang=ru&FamilyID=fbee1648-7106-44a7-9649-6d9f6d58056e

This is a coordinated release with Russian for SQL, MSDN, and the Orcas SP1 RUS Library.

Why there is no spell checking in Design view?

Some folks asked why VS 2008 and VWD Express 2008 do not have "live" spell checking like Expression Web or SharePoint Designer 2007? Designer is shared with Expression Web and hence code must be there, right? Correct. But there are licensing issues. Office spell checker and dicitonaries are not 100% Microsoft products (you can see copyright information in the Office Help | About information). Expression Web is an Office product so it is using Office spell checker engine directly, same way other Office apps do. Visual Studio is not Office product and hence it cannot directly use or ship components Microsoft may not have license for. My add-in uses separately installed Word via public interfaces which is different from direct usage of Office engine or reshipping third party components in a different application.

Where is Mikhail?

I have been posting in our team blog primarily. Maybe I should have cross posted, but I didn't. I will probably continue posting major articles on the team blog and redirect my blog to more technical subjects. Meanwhile, I hope you discovered that spell checker has been updated.

 

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

This article is obsoltete. Please look here for newer version http://blogs.msdn.com/webdevtools/archive/2008/11/29/spell-checker-update-2-2-full-support-for-vs-2008-sp1-simpler-setup-and-a-few-bug-fixes.aspx 

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.

More Posts Next page »
 
Page view tracker