Feeds:
Posts
Comments

Archive for November, 2007

Most of my articles on this site are focused on WPF or Silverlight.   I work with many of the other technologies that are part of .NET too.  It’s just that I like the rich client technologies and this site is where I talk about them. You’re probably not surprised to discover that when I write about Visual Studio 2008 it’s likely to about something related to WPF.  But you know that WPF applications aren’t  the only thing that you can create with Visual Studio. Obviously there are plenty of other enhancements; I heard there were over 250 improvements to VS in the 2008 release.

Web Improvements

Scott Guthrie usually has detailed posts regarding the ASP.NET/AJAX tools.  Rick Strahl give his opinion about 2008, the install process, and C# 3.0 features.

Web programmers get JavaScript debugging, nested master pages, a new HTML designer, a usable CSS editor.  There is also a couple new controls too (LinqDataSource, DataPager, ListView).

Tools and Testing

I heard from Doug Seven that Jeff Beehler has a ton of links describing some of these new Visual Studio Team System additions. Doug’s right.

Language enhancements

VB programmers get a lot of new Intellisense enhancements.

You gotta love the new VB9 and C# 3.0 language features.

LINQ, LINQ, LINQ

There’s a river of  love pouring out of the .Net developer community for the new LINQ query syntax.  Not everybody likes it, of course, but overall LINQ seems to a very nice way to query information in your applications.

VSTO

I was talking to Ken Getz a couple weeks ago in Las Vegas.  Ken is the man to talk to when you want to know what is happening in the VBA/VSTO world.  He’s been an expert on Access and VBA since they were invented.  He says that VSTO in VS 2008 has made incredible progress, or as he put it ” I think they’ve finally hit critical mass”.

The Office developer gets great support in Visual Studio 2008.  You can create Office 2007 ribbons, work with Outlook form regions, add task/action panes and work with all the VSTO 2003 features.

You can build add-ins for Outlook, Word, Excel, InfoPath and Visio.  Apparently it is easy to build workflows for Sharepoint.

Even more

I could go on for another ten paragraphs.  Here’s a quick summary.

Improvements in the multi threaded debugger. Full source code for the .NET libraries and debugging into .Net library code, Unit testing for devices,   Compact LINQ, additional WF and WCF templates, JSON serialization for WCF.  Vista support is baked into VS 2008.

See for yourself. Find trial versions here.

Read Full Post »

You know it has to happen.  I’m guessing you’re either a developer or designer if you’re reading this  blog.    So you’ve work on projects of your own. No matter how much you test and fix your application there is always another bug.  You release the product, have a rousing ship party, and before you’ve had a chance to sleep off the champagne buzz one of your customers has filed a bug report.

Here’s a little cold November rain for all the Microsoft folks celebrating the release of VS 2008. Yeah, I’m talking to the Cider team. Guess what I found?

Toolbox Bug

Here’s the problem. Sometimes when switching from XAML view to WPF design view the toolbox doesn’t show any controls or elements.

vs2008bug

Steps to reproduce

  1. Create a WPF application.
  2. Dock the Toolbox window so that is always visible.
  3. Add a new WPF Window file to project
  4. Click the Collapse Pane button.
     image_thumb13
  5. Switch to XAML view.
  6. Close the Window.
  7. Reopen the same Window file.  You should be in XAML view.
  8. Switch to Design view.  Click the ‘Resume loading the designer link’.
  9. You will see the designer but no controls are visible on the Toolbox.

My first instinct is to click the Window in the designer, to set focus on the Window designer.  My thinking is that the IDE isn’t detecting that the Window is selected and therefore isn’t loading the correct sections in the toolbox.  That doesn’t work however. 

Here are a couple of stop-gap ways to get the toolbox in sync. 

  • Switch back to XAML and to Designer view
  • The toolbox will refresh and show the controls if you  close and reopen the Window file. 
  • The following will work occasionally: resize the designer window, use the zoom slider to zoom in/out.

Sigh.  Guess I’ll have to go a report this on connect.microsoft.com.

Read Full Post »

In part one I discussed the
Tools/Options/Text Editor/XAML/Miscellaneous section.

In part two I look at the XAML Formatting section. The XAML editor in Visual Studio 2008 is much improved over the 2005 Extensions version.

Auto Format

Developers are a picky bunch.  I can spend 30 minutes arranging my code/XML/html/xaml to my liking, getting the spacing just right, indenting each line so that my code is a work of art.  You could look at my code and five seconds later you’d be wishing that you could reformat it to your coding standards.  Some of us like our tools to auto-arrange our text, some of us go ballistic if the tool so much as moves a semi-colon or curly brace. 

In VS 2008 you can specify whether you want your XAML rearranged automatically or whether you’d like the XAML left alone unless you intentionally ask for an auto-format.

image

The Formatting/General screen is fairly self explanatory.

image

The following three events can trigger auto-formatting.

On completion of end tag or simple tag

Formatting occurs when you finish typing the end tag.  It can also happen when typing a simple tag. Simple tag is Micro-speak for a tag with no attributes (example <ListBox />).

On completion of start tag

Formatting occurs when you finish typing the element start tag.

On paste from clipboard

Formatting is triggered whenever you paste XAML from the clipboard into the XAML view.

Auto Delimiters with ‘Quotation Mark Style’

Well formed XML requires any XML attribute value to be delimited with either double quotes or single quotes.  Select your preference here.  I prefer single quotes when typing as I don’t have to use shift key.

Text Wrapping

Visual Studio has two settings that affect the length of text allowed on each line in the editor.  The first choice, Word Wrap, is part of the the Text Editor General section.  When Word Wrap is enabled your text flows to the next line whenever the text is wider than the width of the edit window.  Just like Microsoft Word.

image

In the following example lines 2 and 10 are wrapped.

image

Tag Wrapping is similar to Word Wrap but it happens only when your XAML is auto-formatted by Visual Studio.  You specify the maximum number of characters per line and VS arranges your tags accordingly.  Confusingly the Tag Wrap only happens when you add your elements using the Designer and not the XAML editor.

image

Attribute Spacing

On the Spacing screen we choose how we want our attributes and elements arranged on the page.

image

Preserve newlines and spaces between attributes

Your elements are left untouched.  Put as many spaces between attributes as you like, move your attributes to new lines. image

Insert a single space between attributes

The element occupies one line.  Attributes are separated with a single space.image

Position each attribute on a separate line

The element is split across many lines. Each attribute occupies its own line. This is the setting I use.

image

Note: if you move the attribute on the first line to a new horizontal position and trigger an auto-format (Ctrl-F,Ctrl-D) the subsequent lines will align with the first attribute position.

image

Position first attribute on same line as start tag

When unchecked, attributes are not allowed on the same line as the start tag.

image

Element Spacing

The following three values control what happens to blank lines that are between lines of XAML text.  I think you can figure out what they do.

image

To follow along with this example you need to have the final release version of Visual Studio 2008 installed.  Find trial versions here.

Read XAML Editor Preferences Part 1

-Walt Ritscher

RSS Like this article? Subscribe to the RSS feed.

Read Full Post »

The XAML editor in Visual Studio 2008 is much improved over the 2005 Extensions version.  Let’s take a look as some of the preferences you can change in the Tools/Options dialog.

image

Full XAML view

I like working in the XAML editor in Visual Studio.  Most of time if I want a WSYWIG editor I’ll use Expression Blend.  I’ll have to see if I like Visual Studios WPF Designer better now that it has shipped.  I do know that the XAML editor in VS is considerably better than the Blend editor. That means I tend to write most of my XAML in VS.

I’m happy to see the new “Always open documents in full XAML view” option.  Check this option and your WPF windows (including new files) always open in XAML view.  Glorious!

image

Auto Insert

The other two checkboxes on the XAML/Miscellaneous screen are fairly self explanatory.

Closing Tags:  When you finish typing the opening XAML element VS will automatically add the closing element.  Just like the VS XML editor.  Frankly, I can’t conceive turning off this setting as it saves so much typing.

Attribute Quotes:  Automatically insert two quotes “” and place the cursor between the begin and end quote.  Visual Studio has a some quirky behavior here though depending on whether you use TAB or = to complete your attribute value.

When you type the complete attribute (example, Background) and then type the = character VS examines your preference and auto inserts the quotes.  This only happens if you type the complete word and then =.

When you type a few letters  of the attribute (example, bac) , see the Intellisense drop-down showing your desired attribute name, and you press TAB Visual Studio ignores your preference and inserts everything (example Background=””).

I usually use TAB or the CodeRush shortcuts to enter my values as it is much faster than typing the whole attribute name.  For this setting I leave it checked.

 To follow along with this example you need to have the final version (RTM) of Visual Studio 2008 installed.  Find trial versions here.

Read XAML Editor Part 2 here.

-Walt Ritscher

RSS Like this article? Subscribe to the RSS feed.

Read Full Post »

I’ve been living in Visual Studio 2008 Team Suite (Beta) for the last four months.  Using VS2008 has been annoying and exasperating one minute and fun and productive the next.  Most of the pain points for me have been in the WPF designer and XAML editor.

Expression Blend Truncated menu bug

OK, this first one is not about Visual Studio but I’m glad to say that the problem is fixed. I wrote about this bug in October.  Expression Blend cuts off the right edge of the tool bar if .NET 3.5 Beta is installed.  FIXED.

image

XAML Editor not adding closing XAML tag.

Visual Studio 2008 beta never added the closing XAML tag.  That’s not a problem in RTM, VS correctly adds the closing XAML tag after you type the end ‘>’ for a XAML tag.  FIXED.

image

WPF Editor does not remember your preference for XAML/Designer view.

This bug was extremely annoying.  The first time you open a WPF item (Window, Page, UserControl) in the WPF Designer it show a split view.  WSYWIG designer on top, XAML editor on bottom.

image

Since the Designer was not very full featured I ( and most of the WPF developers I know) work in the XAML view the majority of the time.  You can switch from the split view (double click the separator between views or click the collapse pane button) to full pane view.  VS always shows the Designer Pane first so you have to click the XAML Tab.  Then you can work in the XAML view. Discouragingly, VS forgets this setting and you have to go through these steps again and again, even for files you recently edited.

This is fixed in VS 2008 RTM.  Hurrah! 

Also, for existing files, the Designer window opens considerably faster than before.  See more in the perf section below. Thumbs up.

Performance

Looks like the perf guys spent some time tuning up VS 2008.

Test Machine:  Dell 9300 1.86 with 2GB RAM, single core. Vista Ultimate OS.

  • Start Time: 2-3 seconds (From choosing shortcut on Start menu until IDE fully loaded.  (no addins enabled)
  • New WPF Project:  8 seconds for first project.  2.5 seconds for subsequent projects
  • New WinForm Project: 6 seconds for first project, 2 seconds for subsequent projects.
  • Add WPF Window:  6 seconds for first, 1.6 seconds for subsequent project items
  • Solution Rebuild:  Dec 2007 MSDN Magazine VB Mapping Example (20 seconds)

Property Grid

I don’t know what to make of the new 2008 PropertyGrid.  Compared to the WinForm PropertyGrid it is missing lots of features.  I think I’ll write a separate post devoted to the oddness of the WPF property grid.   The good news, the Cider team added a search box at the last minute.

image

Property Attributes and AutoComplete quotes

VS 2008 beta was inconsistent when auto-completing attributes.  Sometimes it wouldn’t add quotes.  It never added the end quote, you had to type it yourself.  Tedious. That’s been fixed in RTM.  In the RTM version you enter the first couple letters of the attribute(say wi for Width)  and press tab.  VS finishes the word Width, adds the = sign and two quotes and moves your cursor between the two quotes.  Another bonus, you can type the attributes in lower case and the auto-complete fixes the case when you press tab.

image

More investigation coming. Stay tuned.

-Walt Ritscher

RSS Like this article? Subscribe to the RSS feed.

Read Full Post »

Today Microsoft announced the release of Visual Studio 2008.   I was on the MSDN servers as soon as I heard about the release and an hour later I had the Visual Studio Team Suite ISO on my computer.  This should be a simple install but I’d installed the last VS beta on my laptop.  That means I need to be careful and do everything right or I might have trouble later.

Normally I NEVER install betas on my laptop.  Instead I put them on virtual images and run them from a second hard drive.  That didn’t work too well  for my WPF classes and conference talks though.  Running a virtual machine with a virtual video card and then showing WPF applications is slow.   Since I couldn’t show the power of WPF in a virtual machine I installed the VS 2008 beta on the laptop earlier this year. 

Uninstalling

I mounted the ISO and looked for a Readme file.  I found one, but it didn’t have any interesting information regarding uninstalling the beta bits.  A bit of searching on the Internet turned up this useful uninstall page.

First I uninstalled Visual Studio 2008 Team Suite Beta.  That took a long time, a couple hours to run.  The installer periodically popped up dialogs asking me to close certain windows.  Twice it informed me to close an application with a number for a name (8456, 4265).  Running Task Manager didn’t show any process with that name so after the uninstall completed I restarted Vista just to be safe.

Next I walked through the recommended list of applications to uninstall and removed each from my computer.  

  • MSDN Library for Visual Studio 2008 Beta
  • Microsoft SQL Server Compact Edition 3.5
  • Microsoft SQL Server Compact Edition 3.5 Design Tools
  • Microsoft SQL Server Compact Edition 3.5 for Devices
  • Microsoft Visual Studio Performance Collection Tools
  • Windows Mobile 5.0 SDK R2 for Pocket PC
  • Windows Mobile 5.0 SDK R2 for Smartphone
  • Crystal Reports 2007
  • Visual Studio Asset System
  • Microsoft Visual Studio Web Authoring Component / Microsoft Web Designer Tools
  • Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System Runtime
  • Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System Runtime Language Pack (non-English editions only)
  • Microsoft Visual Studio Tools for Office Runtime 3.0
  • Microsoft Document Explorer
  • Microsoft Document Explorer 2005 Language Pack (non-English editions only)
  • Microsoft Device Emulator 3.0
  • Microsoft .NET Compact Framework 3.5
  • Microsoft .NET Compact Framework 2.0 SP1
  • .NET Framework 2.0 SDK
  • Microsoft Visual Studio Codename Orcas Remote Debugger
  • Microsoft Visual Studio 64bit Prerequisites Beta (64-bit platforms only)
  • Microsoft .NET Framework 3.5

Vista’s ever-present search really helped.  I didn’t have to look through the entire list of installed apps.  Just type a few letters of the name of the application and wait for search to show me a filtered list of candidates.

image

Luckily the uninstall of Visual Studio 2008 removed most of the list of applications.  I only needed to run about 6 more uninstalls.  Then I restarted Vista again, just to be sure, and I am ready to install the RTM.

Installing the RTM

The install was smooth.  Took the normal 90 minutes to install VS 2008 and the MSDN help.  Ran Visual Studio and everything looks great.   Coming up, a post on the WPF development environment.  Did Microsoft fixed all the complaints about the WPF designer?  Stay tuned.

-Walt Ritscher

RSS Like this article? Subscribe to the RSS feed.

Read Full Post »

Apparently Microsoft has another site for sharing source code besides CodePlex.  I learned about Popfly Explorer today and decided to take a look.  First though, what about CodePlex?

From the CodePlex site
CodePlex is Microsoft’s open source project hosting web site. You can use CodePlex to create new projects to share with the world, join others who have already started their own projects, or use the applications on this site and provide feedback.

CodePlex permits developers to use a handful of tools to check out the source code.

If you are a developer or coordinator on a project than the following clients are available for free and can be used with CodePlex:

  • TortoiseSVN: A GUI source control client that integrates into Windows Explorer and provides edit-merge-commit and offline support.
  • CodePlex Client: A command line source control client that provides edit-merge-commit and offline support.
  • Teamprise: A GUI source control client that can run on Windows, Linux, or Macintosh and supports integration with Eclipse.
  • Team Explorer: A GUI source control client that integrates with Visual Studio 2005.
  • TF.exe: A command line source control client that comes with Team Explorer.
  • MSSCCI Provider: A MSSCCI provider that enables source control integration with MSSCCI enabled IDE’s such as Visual Studio 2003.

Overall CodePlex is a nice replacement for the ill-fated GotDotNet site.  CodePlex is built on top of Microsoft Team Foundation Server. GotDotNet got the ax earlier this year. 

Here’s an excerpt from Betsy Aoki reminiscing about the heady early days of GotDotNet.

Gotdotnet when it launched in 2000 was a symbol, created by an upstart team, to show the potential of .NET and a publishing mechanism that bypassed MSDN a bit to get the latest beta code and information out there. It pioneered .NET sample repositories and employee BlogX blogs and collaborative code-sharing workspaces all living on the .NET framework. It went nuts and took off like a rocket.

What is Popfly Explorer?

Popfly is a Microsoft site for creating web stuff.  Web pages and mashups are the two most popular types of web things you can build here. 

Popfly is the fun, easy way to build and share mashups, gadgets, Web pages, and applications. Popfly consists of a set of online visual tools for building Web pages and mashups, and a social network of creators where you can host, share, rate, comment and even remix creations from other Popfly users.

Popfly Explorer is a plug-in for Visual Studio 2005/2008 that lets you upload your VS projects to the Popfly site and share them with other Popfly users.  Like CodePlex you can use Popfly to store your project files on Microsoft servers instead of paying ~$3000 for a Team Foundation Server license.

Installing Popfly Explorer

I ran the installer after downloading from the Popfly site.  Since I was expecting this to be a simple utility the install seemed to take forever.  It took at least 15 minutes to finish. 

Loading a project

Once the install was done, I started Visual Studio 2008. Sure enough, there is a new Popfly menu available.

image

I opened the Popfly Explorer window and was prompted to enter my Popfly credentials.  You must have a Popfly account.  I’ve had an account since last Spring.  At that time you had to ask to be a Beta user.  I’m not sure if that is still the case.

image

Next, I clicked the Find button.   You can search by project name or username.

image

Yesterday I posted about the upcoming Word to FlowDocument converter due out later this month.  Michael Scherotter, the converter developer,  is having a LiveMeeting about his new tool and he told me that he has the source code available on Popfly.  Hence my installing Popfly Explorer.  To find Michael’s project I need to search for his profile.

image

There it is.  I clicked the link, and five seconds later had the project open in Visual Studio. Nice!

Conclusion

What do I think of Popfly Explorer?  So far, with less than an hour of experience, I like it.  It was seamless to download the project.  Time will tell.

-Walt Ritscher

RSS Like this article? Subscribe to the RSS feed.

Read Full Post »

Older Posts »