Visual Studio 2010 and HW acceleration on Windows XP…

.Net, Visual Stutio, WPF 1 Comment »

Last week during the MVP summit in Seattle we’d the confirmation that the SP1 of Visual Studio was almost ready and today we’ve more details: “Visual Studio 2010 Service Pack 1 will be available March 9th for download for MSDN Subscribers, and will be generally available for download on March 10th, 2011” [from G.Duthie's blog on MSDN].

“While the Service Pack is mostly focused on improvements in response to feedback on Visual Studio 2010, one new feature I want to highlight is the integration of IIS Express into Visual Studio 2010. IIS Express, which was introduced with the new Microsoft WebMatrix editor, is a lightweight, yet full-featured version of IIS that can run without administrative permissions.”

Another important thing to notice about the SP1, is that it will disable the hardware acceleration of the IDE on Windows XP. Yes, you read correctly, despite WPF’s support for accelerated graphics, this feature will be disabled on XP (for VS only).


Background

When the version 3.5 of the .Net framework was released, Microsoft added a new software rendering engine in case the hardware was not able to do the job. This feature could be enabled at the Window level using the following code:

?View Code CSHARP
1
2
3
HwndSource hwndSource = PresentationSource.FromVisual(this) as HwndSource;
HwndTarget hwndTarget = hwndSource.CompositionTarget;
hwndTarget.RenderMode = RenderMode.SoftwareOnly;

With WPF4, this is now possible at the Process level using a single line of code:

?View Code CHSARP
1
RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly

Another trick you can use in your application is to determine whether your application is currently using hardware acceleration. You can do that by looking at the RenderCapability.Tier enumeration.


In your applications running on XP…

Now the immediate question that might come in your mind is: “If VS2010 is disabling HW acceleration on XP, should I do the same on my WPF application which is shipped on XP too ?”

I guess the answer is “maybe” and it actually depends on various factors:

  • does your user reported crash that seems correlated to video drivers issue ?
  • does your application extensively uses complex graphical effects (for example this is clearly not the case in VS2010) ?
  • what kind of hardware your users are using. Is this recent hardware (which are being downgraded to XP) or is this really old hardware ?

Maybe a good option is to let the user change this settings (while having a default value). In VS2010, you’ll be able to turn on HW acceleration back by using the settings dialog:


Anyway, I thought at the beginning it was a very weird decision. But after all; if the majority of the crashes they see in VS on Windows XP is linked to bad drivers, it makes sense.

MSDN Ultimate Subscription Giveaway

.Net, Events, Silverlight, Visual Stutio, Windows Phone 6 Comments »
IMG_0833 As a Microsoft MVP for this year, I got 3 MSDN Ultimate Subscriptions to share with friends and co-workers. I already gave 2 of them to co-workers and I’d like to offer the last one to one of my reader !

The “official” pricing for the MSDN Ultimate Subscription is $11,899. The subscription is valid one year and is not restricted to US only. The MSDN Ultimate has the following items (among many others – you can see the detailed list here):

  • Windows Azure Platform
  • Visual Studio 2010 Ultimate
  • Visual Studio TFS 2010
  • Expression Studio Ultimate
  • Windows 7, Windows Server 2008 R2 and SQL Server 2008
  • Microsoft Office Professional Plus 2010, Project Professional 2010, Visio Premium 2010

In order to take your chance to get this subscription:

  • let a comment on this blog post
  • explain what you would like to do with the subscription
  • share you blog address, community website or whatever to show how you’re involved in the .Net community

Contest is now over. The winner of the MSDN Ultimate License is Mike Strobel. Thank you all for letting a comment, I which I had more subscriptions to giveaway…

Mix10 starting today !

.Net, Events, Silverlight, Visual Stutio No Comments »

Mix10 is starting today and we can expect many cool announcements during the keynote. You can watch the keynote online at live.visitmix.com. I’ll try to give feedback as soon as possible. Because I’m not lucky enough to be in Vegas, I’ll watch the keynote tonight (French time !) at home with some coworkers.

Last information before the keynote, it looks like we’ll have some announcements about Silverlight running on Symbian devices…

Using Reflector to debug a .Net app in Visual Studio without the original source code

Tools, Visual Stutio 2 Comments »

Many .Net developers use to say “if you’re a serious developer, then you MUST Reflector”.

I would like to add another statement: “if you want to have an insight and powerful look at how things works internally, use Reflector Professional”.

Last Wednesday, RedGate released a new version of Reflector. You’re probably going to download it soon or later because your actual version is going to expire. When you’ll download the free version, you’ll automatically get a trial (14 days) of the professional edition. Nice, but what’s so special about this edition ?

Let’s see a demonstration of what can be done using Reflector Pro. The following is not an ad for RedGate, I’m just totally amazed by their new feature :-)

1. Reflector is now integrated into Visual Studio (2005, 2008 and 2010 RC):

2. Select the “Choose Assemblie to Debug…” option to select .Net assemblies for which you don’t have the source code. In this example, I’m using one of the Blend3′s assemblies:

3. Once the process is completed, select the “Explore Decompiled Assemblies” option:

4. Browse to your target assembly and select an interesting type:

5. Put a breakpoint in the code, like you do every day when you debug an app:

6. Run the executable

7. Debug Blend3′s source code ! Use breakpoints, step into methods, inspect variables…

And that’s it. With Reflector Professional, you can:

  • Decompile third-party assemblies from within Visual Studio
  • Step through decompiled assemblies and use all the debugging techniques you would use on your own code. This is incredibly powerful as we saw by debugging Blend3″s source code !

Reflector Professional is available for about 195$ on RedGate website

PDC09 : How VS2010 was built with WPF ?

.Net, Events, Tools, Visual Stutio, WPF No Comments »

PDC09

In my last blog post, I did a review of a PDC09 Session “Advanced performance tuning with WPF”. Today, I’m doing a review for another very interesting session “How VS2010 was built with WPF ?”. The video is available here.

vs2008tovs2010

Why did Microsoft choose WPF for VS2010 ?

  • Technological: prove the capabilities of WPF4
  • Architectural
    • Separated presentation
    • Support for long range road map (+10 years)
  • Key VS2010 features need it: Editor, Architecture Editor, Parallel tools debugging
  • Take an opportunity to give feedback for WPF4: when VS2010 development started, .Net 3.5 SP1 was just shipped and it was the right time to give feedback for the new features and fixes for WPF4.

It is worth noting that VS2010 is a project that is being watched carefully inside Microsoft. We can expect that more Microsoft applications will move to WPF in the next coming years.

What WPF features are used ?

  • Declarative UI using XAML
  • Databinding
  • Styles and templates
  • Application Resources
  • Interop Win32 (because they did not have the time to rewrite everything using WPF or because features doest not need to use WPF for example de WinForms designer…)
  • Integration with the message loop (to deal with particular focus issues)
  • New text stack (part of WPF4) based on DirectWrite

Staged approach

  • Define data models: a huge diagramming and architectural exercice
  • Replace the main window with WPF (only the window not its content !) to start the mix approach (managed/unmanaged, WPF/Hwnds)
  • Write new managed components: Window manager, command bar presentation
  • Scout with other VS teams
  • Test, Test, Test…

What were the challenges ?

  • Mixed mode application: native and managed code; WPF and HWNDs (Win32 or WinForms)
  • Keep existing extensions working and allow new extensions to take advantage of WPF
  • Don’t “stop the train” other teams were working at the same time on the product to add new functionalities
  • Text clarity
  • Performance
  • Focus management

You can watch the session here if you want more detail and demos of what I mention in this post.

Using Snoop to take a look at VS2010 !

.Net, Visual Stutio 7 Comments »

Update 18th january 2011: as Cory pointed out, the latest version of Snoop is now available on CodePlex.

If like me you’re curious about how big WPF applications are made, you probably tried to use Snoop to inspect the visual tree of Visual Studio 2010 Beta2. And you probably had a problem because Snoop wasn’t able to detect the devenv process of VS2010:

I wasn’t sure about the cause of this problem, but I grab the source of Snoop and took a look at the code that list the available window:

?View Code CSHARP
1
2
3
4
5
6
7
8
9
10
11
12
public void Refresh() {
	this.windows.Clear();
 
	foreach (IntPtr windowHandle in NativeMethods.ToplevelWindows) {
		WindowInfo window = new WindowInfo(windowHandle, this);
		if (window.IsValidProcess && !this.HasProcess(window.OwningProcess))
			this.windows.Add(window);
	}
 
	if (this.windows.Count > 0)
		this.windowsView.MoveCurrentTo(this.windows[0]);
}

I setup a breakpoint to find out what was wrong and discover that the window.IsValidProcess failed with the VS2010 process. Because I just wanted to check if it was the only reason why Snoop wasn’t able to inspect it, I hack the code to remove this test:

?View Code CSHARP
1
2
3
4
5
6
7
8
9
10
11
12
public void Refresh() {
	this.windows.Clear();
 
	foreach (IntPtr windowHandle in NativeMethods.ToplevelWindows) {
		WindowInfo window = new WindowInfo(windowHandle, this);
		if (/*window.IsValidProcess &&*/ !this.HasProcess(window.OwningProcess))
			this.windows.Add(window);
	}
 
	if (this.windows.Count > 0)
		this.windowsView.MoveCurrentTo(this.windows[0]);
}

And it’s working:

vs2010-snoop

Happy exploration with Snoop :-)

VS2010 Beta 2 coming today !

.Net, Visual Stutio No Comments »

In case you don’t have the info yet, VS2010 Beta2 is coming today October 19th for MSDN subscribers. It will be released to public on Wednesday (source).

Also, Visual Studio 2010 RTM will officially launch on March 22, 2010

vs2010

I’ll try to give some feedback as soon as I’ll be able to grab my copy and install it on ma workstation !

.Net4, WPF4 and VS2010 interesting links

.Net, General, Tools, Visual Stutio, WPF 2 Comments »

Since the release of VS2010 last week a lot of cool blog posts had been written. The thing is more than VS2010 itself, the Beta1 comes with .Net4 and WPF4 too, and that’s exciting too !

Because I didn’t have time yet to write my own feedback, I’m sharing some links I found the last couple of days.

Download

  • A full list of what is available to download (VS2010, .Net framework…) can be found here.

MSDN Documentations

  • .Net Framework4 Beta1: here
  • What’s new in .Net Framework4 Beta1: here
  • WPF4 Beta1: here
  • What’s new in WPF4 Beta1: here
  • VS2010 Beta1: here
  • What’s new in VS2010 Beta1: here

From Beta1 to Beta1 and RTM

  • Jaime Rodriguez wrote a very nice article today and share his “insider view” of what’s on the road to RTM.
  • Karl Shifflet explained on his blog what’s going to change in the DataBinding pipeline (no more dummy converter !)

Channel9

  • Interviews of WPF and Silverlight program managers.
  • Rob Releya is also talking on the new XAML stack available in the framework. More information can be found on his blog.

Other bloggers

And also, Blend3

  • Unni’s wrote an article about updates that had been made to Blend regarding user feedback on Connect.

Visual Studio 2010: Beta1 available with .Net4 and WPF4 included

Visual Stutio 2 Comments »

In case you missed it, Beta1 of Visual Studio 2010 has been announced yesterday.

vs2010

Since monday it is available to all MSDN subscribers, and will be avaible to the rest of the world on wednesday. Documentation has also been updated to show the new features of this release.

The download is on its way and I’ll try to post feedback as soon as I can, stay tuned !

Browse your codebase like a pro with ReSharper

Tools, Visual Stutio No Comments »

I’ve already blogged about R# a couple of times. There is no doubt: it’s a must have for any serious .Net developper. A few weeks ago I learned and setup new shortcuts to improve my navigation skills in Visual Studio.

Here are the results… If I want:

  • to find a Type I hit Ctrl+T
  • to find a File I hit Ctrl+Shift+T
  • to find a Member (in a file) I hit Ctrl+Alt+T (Note: I setup this one on my own using Tools/Options/Keyboard)

A search box opens and I can start searching instantaneously.

resharpernavigation1

Here are the basic scenarios :

  • I want to open the ViewModelBase class, I hit Ctrl+T and then VMB (R# is able to search using capital letters)
  • I want to go to the OnPropertyChanged, I hit Ctrl+Alt+T and then OPC (same as previous example)
  • Finally, to open the file in the Solution Explorer I hit Shift+Alt+L

It’s simply amazing the time we can save using those simple shorcuts. Of course, you need to be quite familiar with your codebase (if you just arrive on a project it will be harder :p)

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in