VS2008 Beta 2 to RTM menu changes and readme

Mon, November 26, 2007, 02:07 AM under Orcas | VisualStudio
I started the Beta 2 to RTM changes on this post and then posted some breaking changes about this, that and the other and also posted some minor amendments here and there. To close it all off, below are the remainder differences that I observed:

1. If you access the Samples via the Help menu, you'll notice there is now a Readme displayed (apparently some people fell over at the first hurdle that the readme addresses).
2. Previously in web projects, you would access the "Manage Styles" and "Apply Styles" windows from the Format menu. Now the two menu items have moved to the View menu under their brother who was always there: "CSS Properties".
3. The Database Publishing Wizard is now built in to Visual Studio, no need for separate download:


For more, please do read the Visual Studio 2008 readme which includes the steps required to go from Beta 2 to RTM.

Go To Type Definition in VS 2008

Sat, November 24, 2007, 11:21 AM under Orcas | VisualStudio
I was reading this post on the VB blog about hidden gems in VB with the VS2008 release. I knew all of them until I came to item 8: the "Go To Type Definition" menu (I am not sure if this was functional in Beta 2...). This is available only on the variable declaration and it takes you to the definition of the type of the variable.

But hang on! Couldn't we always do that? Yes, we could: The existing "Go To Definition" menu does that if you execute it by right clicking on the type rather than the variable. So, the only benefit of the new "Go To Type Definition" menu is for scenarios where you are using local variable type inference and hence don't have the type explicitly appear in your code (in order to use the existing "Go To Definition" menu).

I thought that was cute, but something was bugging me about introducing a whole new menu item for this purpose. Couldn't the VB team simply go to the type definition if I selected "Go To Definition" on the Dim keyword? I checked with some C# code that uses local variable type inference, and indeed that is what it does when you select "Go To Definition" on a var. As it happens, I prefer C#'s approach on this one.

Regardless of what I prefer, I would have like some consistency here between the two language approaches but I am sure this is where the product teams tell me that they are catering for two different audiences and I don't want to open that can of worms again.

I'll finish off by saying that I prefer what VB means by go to definition for a type, as opposed to how C# does it. In VB, going to a type definition that is not in your code, is interpreted as going to the Object Browser. In C# (since VS2005), it disassembles the signatures of the type from the external binary and presents it in C# code in a separate file – yuck! Why can't C# just take me to the OB where I can see in a more concise format all signatures and documentation? There should be a separate command for disassembling the type in header style just in case I need to copy/paste something... Anyway... mini-rant over.

VS2008 works with SourceSafe 2005

Fri, November 23, 2007, 03:28 AM under Orcas | VisualStudio
...but you need an update. Please read this post for context and where to get the update.

Thanks to one of my readers (Martin Normak) for pointing this out to me.

VB WPF project with option Strict On in VS 2008 RTM

Thu, November 22, 2007, 02:56 AM under Orcas | VisualStudio
In my global Visual Studio project settings for VB projects I always have Option Strict set to On, so any new VB project I create has this setting without me having to do it manually every time.

If you do the same as me above, then when you create a Visual Basic WPF project in Visual Studio 2008 RTM, you may get a compilation error before you have a chance to write any code:

Option Strict On disallows implicit conversions from 'System.Windows.Application' to 'WpfApplication1.Application'.

Double click on the compilation error in your Error List window and it will open the offending file: MyWpfExtension.vb and specifically the ReadOnly Application property that returns an object of type Application. The problem is that the single return statement does not perform a cast:
Return Global.System.Windows.Application.Current
So you have to change it (or in fact choose the cool auto correction option to change it for you) to:
Return CType(Global.System.Windows.Application.Current, Application)

WARNING: The following step has the potential to irrevocably cripple your machine so take backups if you decide to proceed!

If you want to change this globally on your machine and are willing to take your life into your own hands and venture into unsupported territory then you can edit the following two files (you’ll need to unzip, edit the file, and re-zip):

%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplatesCache\VisualBasic\Windows\1033\WPFApplication.zip\MyWpfExtension.vb

%programfiles%\Microsoft Visual Studio 9.0\Common7\IDE\ProjectTemplates\VisualBasic\Windows\1033\WPFApplication.zip

Did I mention that the former action is not a supported scenario by Microsoft or endorsed by the product teams? Yes, good.

NewProject and AddNewItem dialogs in VS 2008 RTM

Wed, November 21, 2007, 04:54 AM under Orcas | VisualStudio
If you were running Visual Studio 2008 Beta 2 and have just moved to RTM, you'll find these minor changes in the New Project dialog:

1. When clicking on the top level Office node it shows you all the Office templates (2003 and 2007) as per the screenshot; before it would not show you anything.
2. There is a new Reporting node that has the "Reports Application" template that previously was under Windows.
3. The SharePoint Worklfow project templates now also appear under the Workflow node (in addition to appearing under the Office->2007 node).

You'll also find some minor changes in the Add New Item dialog:

4. All the WPF item template icons have had a face lift (as per screenshot above).
5. In client projects there is a new Reporting node (equivalent to item 2 above) that contains two templates: "Report" and "Report Wizard".
6. In a web project there is a new item template for Nested Master Page.

HTML, CSS, Script errors as warnings in VS2008 RTM

Tue, November 20, 2007, 05:03 PM under Orcas | VisualStudio
Comparing VS RTM to Beta 2, here is a good one:
Tools -> Options -> Text Editor -> HTML -> Validation

...enjoy the two new checkbox Options to treat errors as warnings :-)

An item placeholder must be specified on VS 2008 RTM

Tue, November 20, 2007, 07:45 AM under Orcas | VisualStudio
If you open your existing Beta 2 web projects with VS 2008 RTM, and you were using the new ListView (one of the 3 new web controls), you may face the following error:

System.InvalidOperationException: An item placeholder must be specified on ListView 'ListView1'. Specify an item placeholder by setting a control's ID property to "itemPlaceholder". The item placeholder control must also specify runat="server".

There are two changes to be aware of:
1. Instead of itemContainer (which is probably what you are using from Beta 2), you must now change the id to be equal to itemPlaceholder. Make this change and your project will compile.
2. The control that has the id="itemPlaceholder" does not get rendered at runtime anymore (it gets removed and replaced with multiple instances of the ItemTemplate). So if you were using for example a ul and had some CSS on it for the li, this styling is now lost. The solution, of course, is to place the outer element (e.g. ul) on its own and within it place a asp:Placeholder whose ID you set to "itemPlaceholder".

An example of both of the above:
<LayoutTemplate>
<ul class="myCSSrule">
<asp:PlaceHolder ID="itemPlaceholder" runat="server" />
</ul>
</LayoutTemplate>
Easy once you know how ;-)

Could not load file or assembly in VS2008 RTM

Tue, November 20, 2007, 02:34 AM under Orcas | VisualStudio
If you open your existing Beta 2 web projects with VS2008 RTM you may face the following error:

Could not load file or assembly 'System.Data.DataSetExtensions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.

The reason for this is that many of the pre-release Fx 3.5 assemblies did not have their version set to 3.5 yet (I covered that in this post), but now they do. So if you change the version from "2.0" to "3.5" in the web.config file your project will build fine again.

At the bottom of that same post I also mentioned the weirdness of System.DirectoryServices.AccountManagement and you'll be pleased to hear that it is now placed in the correct folder and does appear in the references dialog as well.

VS2008 RTM for non-MSDN subscribers

Mon, November 19, 2007, 11:01 AM under Orcas | VisualStudio
Judging by the amount of emails I received, not everyone is an MSDN subscriber and my smiley face didn't put you off from telling me that! So, for the non-MSDN subscribers, if you cannot wait for the general availability date early next year, download a trial now and upgrade later.

Visual Studio 2008 build version 9.0.21022.08

Mon, November 19, 2007, 03:11 AM under Orcas | VisualStudio
All MSDN subscribers can now down load the final RTM version of Visual Studio 2008. If you are not an MSDN subscriber, I guess this is a great incentive to join right now :-p

If you are looking for what is great in VS2008 compared to VS2005 go read my Top 10 hyperlinked list.

If you have been driving VS 2008 Beta 2 for a while and are wondering what is new in RTM then the answer is primarily bug fixes and performance boosts. Two (out of many) quick examples: I noticed many bug fixes for WPF projects and performance improvements not just in the WPF designer but also in script intellisense. There are also some minor enhancements and some aesthetic and usability improvements for example some windows render better on low resolutions such as the Client Application Services dialog. Another is that the UAC Settings option which was previously erroneously available for Office projects (instead of just executables) is now correctly disabled. Finally, we now get an Upgrade button on the About dialog:


I'll cover more of these Beta2->RTM changes over the next 2 days, so check back.