Visual Studio 2008 released, available on MSDN now

Microsoft has released Visual Studio 2008 with .NET 3.5.  The full version is up on MSDN now, and the express edition can be downloaded here.  I’ve been really looking forward to this, LINQ, Lambda expressions and extension methods, plus built in JavaScript debugging & intellisense.  But one of the best features IMHO is that we’ll be able to step into the .NET framework code while debugging.  That’s going to be awesome.

To download the Visual Studio releases, you need to do it from the ‘Top Subscriber Downloads’ section, it’s not actually available in the normal subscriber downloads section.  Probably to reduce server load.  VS2008 Professional is a 3.81GB download, so make some room.

Microsoft providing the .NET source code with VS2008

I already posted this on the tumblelog, but I think it bears repeating: With the next release of Visual Studio, the common .NET assemblies will be provided with source code

Today I’m excited to announce that we’ll be providing this with the .NET 3.5 and VS 2008 release later this year.

We’ll begin by offering the source code (with source file comments included) for the .NET Base Class Libraries (System, System.IO, System.Collections, System.Configuration, System.Threading, System.Net, System.Security, System.Runtime, System.Text, etc), ASP.NET (System.Web), Windows Forms (System.Windows.Forms), ADO.NET (System.Data), XML (System.Xml), and WPF (System.Windows).  We’ll then be adding more libraries in the months ahead (including WCF, Workflow, and LINQ).  The source code will be released under the Microsoft Reference License (MS-RL).

You’ll be able to download the .NET Framework source libraries via a standalone install (allowing you to use any text editor to browse it locally).  We will also provide integrated debugging support of it within VS 2008.

Continue reading

ReSharper 3.0 released

JetBrains have released ReSharper 3.0, but I think they may have to re-brand it, as it now has extensive VB.NET support too:

ReSharper is proud to enable Visual Basic .NET development, providing full support and a host of productivity features. Visual Basic developers will be sure to enjoy a truly enhanced Visual Studio experience thanks to ReSharper’s quick navigation and search, all the important code refactorings, full-fledged code assistance, code completion & generation, code templates, and a lot more.

Maybe they can call it ReCLR or ReNetter or something like that…

Silverlight (aka WPF/E) announced

Microsoft has taken the covers off its high-def Flash competitor, Silverlight.  The browser plugin is available for Windows & Mac for IE, Safari & Firefox (but not Opera for some reason).  It’s still only the February WPF/E CTP that is available for download, this is really just a marketing name change and launch (ala Atlas becoming ASP.NET 2.0 AJAX Extensions).

Not being a flash developer or a graphic designer, there really isn’t a whole lot I could intelligently contribute to this discussion, so I’ll just point you to a whole bunch of other smart people.

[via OffBeatMammal]

Always implement the ToString() method

One of the great features of Visual Studio is its debugging interface.  The ability to watch variables change through the code and inspect them on the fly is invaluable.  The on-hover inspection and quickwatch dialogs are great if you’re dealing with lots of variables or long lists that need analysing.  Being able to view the value of a whole list of objects at once is great.  But this only works for simple data type objects (string, int, float, etc.).  More complex objects just show the fully qualified type name.  This can become really frustrating if you’ve got a long list of objects and you’re trying to find a specific one. 

The reason for this difference is that when it’s displaying your variables, the watch dialog does an implicit ToString() call to display the ‘value’ column.  If ToString() hasn’t been implemented, it calls the ToString() method of the base object type, which as mentioned, just returns the fully qualified type.  However if you do implement ToString(), it can be a God-send when you’re debugging.

Here’s a trivial example:

Continue reading

ReSharper 3.0 Pre-Beta release

JetBrains have released the first EAP version of ReSharper 3.0.  According to the 3.0 Roadmap, the 3.0 release is going to be mostly about adding in VB.NET support for ReSharper.  There is a full list of changes for this build available here.

VB specific changes:

  • Rename works in Visual Basic
  • The following refactorings work in Visual Basic:
    • Rename
    • Move type to another file
    • Copy type
    • Move static members
    • Introduce variable
  • Live templates work in Visual Basic (not all macros work; no bundled templates)
  • Type name completion (Control+Alt+Space) works in Visual Basic
  • Smart code completion (Control+Shift+Space) works in Visual Basic

Non-VB specific changes:

  • TO-DO Explorer (try ReSharper -> Windows -> To-do Explorer)
  • Solution-wide error analysis (enable it by checking the ReSharper -> Options -> Highlighting -> Analyze whole solution checkbox)
  • Automatic member reordering (configured at ReSharper -> Options -> Member Order; configuration UI is plain XML for now as the options are not finalized yet)
  • More context actions and quickfixes
  • Suggestions
    • Make field read-only
    • Make parameter type more specific
  • XAML is supported (to the extent of recognizing symbols declared in XAML files and resolving some references; more will come in future builds)

Download here.  I’d highly recommend installing this in a Virtual PC image if you use your machine for development normally. I’m using the Orcas CTP image, that way I get to test two things at once. 

Use Powershell to delete all bin & obj folders

I sometimes need to remove all intermediate & resulting build files from a Visual Studio solution, either due to version conflicts or because of permissions issues. Powershell just made that job a whole lot easier.

Here’s the command to remove all obj & bin folders from a path (assuming you’re in the path now):

Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse }

If you’re not in the correct folder just replace .\ with the full or relative path. You’ll still need to close down Visual Studio first, the -Force switch will override permission failures, but not process locks.

Note: this does a forced delete without prompting for confirmation, so you’d better be really sure you want it all gone. I highly recommend tacking a -WhatIf after the last -Recurse to do a dry run first to see what will be deleted, i.e.:

Get-ChildItem .\ -include bin,obj -Recurse | foreach ($_) { remove-item $_.fullname -Force -Recurse -WhatIf }

YMMV, but this has saved me much annoyance. If you know of any other handy scripts, drop them in a comment. Share the love!