Category Archives: .net

WPF not Windows Forms gets the Windows 7 love

Microsoft’s Scott Guthrie has a blog post today about what’s new in Windows Presentation Foundation 4, and one of the things he mentions is Windows 7 multitouch support – as also described in this walkthrough – and integration with the Windows 7 taskbar, jump lists, icon overlays and so on. Taskbar support is wrapped in the System.Windows.Shell namespace in PresentationFramework.dll.

This means that Microsoft is making it easy for .NET developers to support Windows 7 in WPF applications. However it is not extending the same love to developers using Windows Forms, the older GUI framework. That said, there is always the Windows API Code Pack which covers many Windows 7 features including the taskbar and jump lists, or you can do your own COM and native code interop. No doubt with a bit of effort all the features can be be integrated into a Windows Forms application.

Still, there’s no doubt that Microsoft is now steering us towards WPF rather than Windows Forms for new desktop development. About time, you may say, considering that WPF first arrived in 2006. While that’s true, there have been good reasons to be cautious about adoption. WPF apps use more resources than Windows Forms applications, require the .NET Framework 3.0 or higher, and for a long time were talked down even by Microsoft as unsuitable for line of business applications.

That tune has now changed, though when you consider the large numbers of existing Windows Forms applications, and the fact that developers contemplating radical revisions or new projects may well be looking at web or rich internet clients, WPF is still something of a hard sell.

On the other hand, the improvements Guthrie describes are significant, not only for Windows 7 features, but also key areas like cached composition for graphics, which can greatly improve performance, and a new text rendering API.

It’s also worth noting that Windows Forms was never a great framework. It wraps the old Windows GUI API which makes resizable layouts and scaling for different display resolutions difficult, as well as lacking all the multimedia and effects goodness in WPF. Another factor is that WPF is designer friendly, with its own Expression Blend design tool. Windows Forms has nothing like that.

WPF has a family connection to Silverlight, which was originally called WPF Everywhere. Microsoft’s idea is that we code in WPF for the desktop, and transition to Silverlight for applications that require broad reach. So far though, mass migration to WPF has not happened, and Silverlight has an independent life as a platform for browser-hosted .NET applications that work cross-platform. Developers have many other choices for broad reach applications, including HTML and JavaScript, Java, and Adobe Flash.

Is it possible that broad adoption for Windows 7 could see renewed interest in WPF and Windows development? I think it will happen to a limited degree, but will not really disrupt the underlying trend towards web and cross-platform.

Visual Studio 2010 and .NET Framework 4.0 – a simply huge release

I’ve been exercising the new beta 2 of Visual 2010. It is hard to encapsulate in a few words because this is a simply huge release. OK, so I did download the Ultimate version; but the changes at every level seem greater than in Visual Studio 2008. One of the reasons is that this is the first full update to the .NET Framework since version 2.0 in late 2005. Versions  3.0 and 3.5 extended 2.0 but did not replace it. Another factor is that Visual Studio 2010 has a new editor built with Windows Presentation Foundation, and has a different look and feel than its predecessor. In addition, there is a new language, Visual F#, though I don’t hear much buzz about it; I think elevating IronRuby or IronPython to this status would have attracted more interest – but they are dynamic languages, whereas Visual F# is a functional language. 

When you are assessing Visual Studio you are in part assessing Microsoft’s platform, and as that platform has sprawled, so too has the tool. It is now so large that it is difficult to have in-depth knowledge of the entire thing. I also notice this when speaking to Microsoft folk about the product.

So what is new?

If you need to acclimatise, I suggest you start with What’s new in .NET Framework 4.0. This is a large topic in itself. Some of the things to look out for are What’s new in the Base Class Library, including Complex numbers, Location API, IObservable<T> for observable collections, and other tweaks and enhancements.

Then there are things like in-process side-by-side execution – the ability to run two versions of the Framework at once in the same process, which is remarkable.

Parallel programming with PLINQ and the Task Parallel Library is another major topic.

COM interop is changing; you no longer need to deploy Primary Interop Assemblies, because the compiler can include only the types you need in your application.

Next, take a look at what’s new in specific frameworks, such as WPF version 4 and ASP.NET MVC 2.

After that, you might be ready to look at new stuff in specific languages: including the dynamic keyword in C#, implicit line continuation in VB, lambda expressions in VC++, the concurrency runtime, and the arrival of Visual F#.

With that sorted, check out the new tools in the Visual Studio IDE. I’m thinking of the new code editor, the updated WPF visual designer, the new visual designer for Silverlight, and the Tools for SharePoint development; and not forgetting the updated modelling and application lifecycle management tools.

But isn’t this the era of cloud computing? That’s another part of the problem; the Windows-oriented tools seem less important if you are immersed in the latest cloud news. That said, don’t forget Windows Azure, though I was disappointed to find that the Windows Azure Tools for Visual Studio are a separate download, and not done yet.

I’m impressed that Microsoft seems to be pulling all this together successfully; it is a significant integration task. And as ever I’d be interested in what developers think – was the new code editor really necessary? Is Microsoft addressing the right areas? Has Microsoft done enough to support new Windows 7 features? And is performance OK in this version (it was a problem in beta 1)?

Blast from the past: how Adobe praised XAML at PDC 2003

I’ve been trawling back through material from Microsoft’s Professional Developer’s Conference in 2003 for a piece that will be posted shortly. I believe that the vision that was presented at PDC 2003, and how it fell apart, sheds a lot of light on why Windows is as it is today.

In doing so I came across this snippet about Adobe’s participation in the PDC keynote. It’s still online in Microsoft’s PDC press release:

Adobe Systems, a leading developer of software for consumers, creative professionals and enterprises, demonstrated the possibilities for ISVs created by integrating the new "Avalon" presentation technology and declarative programming techniques for Windows. Using these technologies, a prototype version of Adobe After Effects showed how developers could unify documents, cutting-edge graphics and media. For example, developers would now be able to build animated charts and graphs that are linked to back-end data sources to produce a smart solution that displays stock prices, sales and other information within a high-end professionally designed format.

"Many developers have not taken the visual design of their applications seriously enough, with the most innovative work restricted to creative professional software and games," said Greg Gilley, vice president of Graphics Applications Development at Adobe. "Longhorns new Avalon technology brings the designer and developer closer, so they can truly collaborate on creating software applications that are as beautiful as they are functional."

The odd thing is, this quote could come from the Adobe MAX 2009 conference from which I have just returned. “Animated charts and graphs … linked to back-end data sources” is what we saw in applications build with Mosaic, Adobe’s new framework for LiveCycle ES2 clients.

The difference: Adobe is doing all this with Flex and MXML, not XAML, and the client platform is the Flash runtime, not Avalon running on Windows.

Gilley of course was speaking before Adobe’s acquisition of Macromedia (and Flash and MXML) in 2005. Furthermore, nobody at PDC in 2003 could have guessed how long it would take Microsoft to deliver XAML.

Technorati Tags: ,,

Visual Studio 2010 to launch March 22 with Azure, Team Foundation Server for all

Microsoft has announced more details about Visual Studio 2010 and .NET Framework 4.0. Beta 2 of both products is available round about now, at least for MSDN subscribers, while thee are a few interesting packaging changes:

  • No more roles – there will be three paid-for versions of Visual Studio, Professional, Premium and Ultimate. I’ve been told that Premium will be pretty much the current Development and Database editions combined, while Ultimate has everything.
  • Team Foundation Server comes with every version, meaning that all Visual Studio developers will be able to use it if they choose. General Manager Jason Zander has the details of TFS Basic, which can even run on the client machine.
  • There will be a number of Azure hours bundled with each edition, so that developers can get started with Microsoft’s cloud platform without further payment. For example, Visual Studio 2010 Premium will come with 750 Azure hours initially, though this will supposedly reduce to 100 hours at a later date.

Visual Studio 2010 includes a new editor based on WPF, and users have complained of performance problems. Apparently this has been addressed, though now that beta 2 is out we will soon discover for sure.

I’ve also learned that the price of Visual Studio is increasing, by around 9%. To soften the blow, Microsoft has a special offer for those with current MSDN subscriptions when Visual Studio 2010 is released. These subscribers will get an automatic upgrade, not only to the equivalent 2010 edition, but to the one above. Thus, Professional subscribers will get Premium, and Team System subscribers will get Ultimate.

There is also an MSDN redesign, though it looks minor to me, and the most important section, the reference library, seems little changed. There is a ton of useful material on MSDN, but I still find Microsoft’s plethora of development and technical sites confusing to navigate, especially with specialist sites like Silverlight.Net offering overlapping content.

Ars technica has a handy product matrix.

Silverlight data, image upload example code

Some time ago I created a simple example of CRUD (Create, Retrieve, Update, Delete) in Silverlight with ASP.NET – you can view it online here. I originally posted it in April; see this post for details. Several people asked me for the code and I’ve not done so until now – mainly because of the hassle involved in making a Visual Studio solution portable as a demo. The Silverlight app was originally written in Visual Basic and I’ve now ported it to C# for convenience. The version on this site runs on Mono, but the demo code is for Visual Studio 2008 on Windows – there really is no difference apart from the database code.

One issue I had with the demo was providing a database. I wanted something easier than just providing the SQL to create a database, ideally a solution that would just open and run immediately. I tried using SQL Server Compact Edition but Microsoft has actually hard-coded something that stops you using this for an ASP.NET application and I got an exception accordingly. I’ve therefore used Access. I wouldn’t consider this for a real web app, but it is convenient for a demo.

The code is somewhat retro – no entity framework, no WCF, no LINQ – except an expression to filter the datagrid – and old-style ASP.NET Forms Authentication. It would be good to convert it to use RIA Services, which I may do if I can find the time. This may mean the code is no use to you at the moment.

Although it is a simple app and not production-ready, I found it interesting to do. Silverlight code is easy to write, but interacting with remote web services for all the content is more challenging. There are flaws – for example, I’ve not handled what happens when multiple users edit the data simultaneously.

There are a few little hacks too. For example, I have an edit form where you can upload an image. I want to have the image display as soon as it is uploaded, but found that if I try to display it in the WebClient’s OpenWriteCompleted event handler it fails; somehow the file is not quite ready to be served. I use a timer to insert a small delay.

Another issue was faking synchronous web service calls.

Anyway, I’ve now uploaded the code and you can find it here. If there is enough interest I’ll put it in a repository to make it easier to add bug-fixes and so on.

Future of Web Apps cheers the independent Web

The Future of Web Applications conference in London is always a thought-provoking event, thanks to its diversity, independence and character. That said, it is a frustrating creature at times. The frustration on day 1 was the barely functional wi-fi, which ruined a promising interactive application called HelloApp, built with ASP.NET MVC. HelloApp would have told us who we were sitting next to, what their interests were, their twitter ID and so on. Microsoft must be disappointed since the developers, some of them more used to technologies like PHP and Ruby, said how impressed they were with the framework and Visual Studio. The poor connectivity was a shame, and a bad slip-up for a web application conference. Even the speakers had to work mostly offline – cloud devotees beware.

Ryan Carson at the Future of Web Apps London, 2009

FOWA has been at London Excel recently, but this event was back to its earlier venue of Kensington Town Hall, more crowded but a better atmosphere and easier to get to. I suspect a little downsizing, but much prefer it. Organizer Ryan Carson has his heart set on enabling start-ups, proffering business advice and uniting developers, designers and money folk, though many attendees are not in the start-up category at all. When revealing the results of a survey showing that many web app hopefuls had less then 1000 site visitors a month he shook his head despairingly “you’re never gonna build a business on that kind of traffic”.

Carson has excellent contacts and the day kicked off with Digg’s Kevin Rose on how to get those visitor numbers up – he should know if anyone does. Rose exceeded my expectations with tips on massaging your visitor egos, avoiding analysis paralysis, hanging round event parties to meet influencers even when you can’t afford to attend the event, and even how to hack the press.

After that the day was disappointingly low-key, at least until midday. Then we got Francisco Tolmasky from 280 North and it all changed. Tolmasky’s line is that we should use pure web technology but with the richness of desktop applications, and to enable this he’s put forward cappuccino, a JavaScript framework inspired by Apple’s Objective C and Cocoa – Cappuccino uses Objective-J. This now has a visual development tool (web-based of course) called Atlas, and in Tolmasky’s demo it looked superb. See here for more details.

The surprising twist is that after developers told Tolmasky that they (or their companies) were not willing to trust code to the web, 280 North came up with a desktop version of Atlas with the added ability to create desktop applications as well. I am not clear about all the runtime details, though it no doubt involves webkit, but Tolmasky’s differentiator versus alternatives like Java or Adobe AIR is that Atlas uses only web APIs.

We heard a lot at FOWA about social media, how to use it for marketing, and how to integrate it into applications. Cat Lee from Facebook gave us a breathless presentation on how simple it is to hook into Facebook Connect. It was OK but it was a sales pitch, and that never goes down well at FOWA. 

The later afternoon sessions were excellent. Bruce Lawson of Opera gave us an entertaining overview of how HTML 5 would make life easier for developers. There was nothing new here, but nevertheless a revealing moment. He showed some rich media working in HTML 5 and made the comment, jabbing at Adobe Flash and Microsoft Silverlight, that the web was too important to place control in the hands of any one vendor. A loud and spontaneous cheer went up.

This was echoed later when Aza Raskin of Mozilla gave us a browser-centric view of social media, suggesting that the browser could broker our “social graph” by integrating with multiple identity providers. Raskin’s line: social media is too important to be in the hands of any one vendor.

The Guardian’s Chris Thorpe gave a bold presentation about how the Guardian wants to embed itself in the web through its open platform. Like most print media, the Guardian has many challenges around its future business model (disclaimer: I write for the Guardian from time to time); but Thorpe’s presentation shows that his newspaper is coming up with an intelligent response, promoting interaction and building out into the wider web rather than erecting paywalls. Having said that, maybe the Guardian will try other business models too; it is a journey into the unknown.

Overall a day for social media and the open web, and a good antidote to the more vendor-centric conferences at which I often find myself. Next week, for example, it is the Flash-centric Adobe MAX; and having heard very little about Flash at FOWA that will make an interesting contrast.

Flash spell check developer upset by competition from Adobe Squiggly

Grant Skinner is the developer of Spelling Plus Library, a spell checking engine for Flex, Flash and AIR. He is displeased that Adobe has now released Squiggly on Adobe Labs – a free component that does the same kind of thing. Skinner refers to the general lack of commercial Flash components:

One of the things that the Flash world really lacks is a strong commercial component marketplace. We have a thriving OSS culture, which is awesome, but while it is very prolific it rarely creates highly reliable, documented, and well-supported libraries. It’s a weakness of the platform, especially when you look at the hundreds or thousands of enterprise class commercial components available for languages like Java or C#.

It is an interesting point. I have always found it intriguing that the commercial component market is so much dominated by Microsoft, thanks perhaps to its early success with VBX and then ActiveX controls for Visual Basic. Despite the maturity of Flash and its popularity among developers, I can more easily name companies with commercial Silverlight components than Flash equivalents – companies like Devexpress, Infragistics, ComponentOne, and Telerik.

Skinner is therefore upset that Adobe has picked a spell checker for its free offering:

When Adobe spends a large amount of resources building a spelling component that directly competes with one of the few successful commercial components in the Flash world, it frustrates me.

though I imagine the impact on his sales is a large factor in his reaction.

The truth is that component vendors always have to play this game of trying to stay ahead of what developers can get for free, either from open source or from what is bundled into the core SDK.

Note that Intel’s just-announced AppDeveloper program for Atom netbooks includes a component marketplace for AIR. I am not sure how significant it will be, but it is another outlet for Flash component vendors.

Microsoft, Moonlight and open source

I was surprised by the announcement that Silverlight is being ported to Intel’s Moblin Linux, which I’ve already reported both here and on The Register. It feels like a u-turn from Microsoft, which had previously stated that while it would build Silverlight for both Windows and Mac, Linux support was to be done by Novell. This is from the 2007 press release:

Microsoft will work with Novell Inc. to deliver Silverlight support for Linux, called Moonlight, and based on the project started on mono-project.com … Microsoft is committed to ensuring that organizations have the best tools and resources to begin building Silverlight-based solutions with the broadest possible reach. The decision to work with Novell to offer Silverlight support for the Linux platform is in direct response to customer feedback, and both companies are optimistic about the impact this extended partnership will have in the industry.

Now, given that Microsoft has long expressed an intention to bring Silverlight to mobile devices, and that many mobile devices run some variety of Linux, you can argue that the Moblin announcement is merely in line with that strategy. This is what Brian Goldfarb told me – that the Intel deal is in the “mobile device” category, and therefore distinct from the work with Mono.

That said, if you look at the specs for something like Dell’s Mini 10v with Moblin – 1.6Ghz Atom CPU, 160GB hard drive, 1GB RAM, 10.1" 1024×600 display – it really has more in common with a traditional laptop than with, say, a mobile phone. Further, I’m getting the impression that this will be a full Silverlight 3.0 implementation, not a cut-down version like Flash Lite, complete with the Silverlight version of the .NET Framework.

If Microsoft had announced this kind of deal in the early days of Silverlight, it would have have been encouraging for open source advocates. Even though this Silverlight for Moblin is not an open source project, it extends support for a key Microsoft technology to Linux users. Silverlight developers may well prefer that the same code will be running on Moblin as on Windows or Mac, subject to whatever has to be done to make the port work.

Unfortunately at this point the announcement is having an opposite effect, casting doubt on Microsoft’s ability to work with open source partners. The impression is that Mono was a useful means of ticking the Linux box for Silverlight’s launch – though the version which includes .NET is still not complete – but that when it really wants to support a Linux OS, Microsoft is quick to find another route.

It is stating the obvious to say that the open source community is wary of Microsoft. Everything the company does is eyed with suspicion. Microsoft’s official support for Moonlight, along with great work from people like John Lam who works on IronRuby, was beginning to soften some of that hostility. Miguel de Icaza, leader of the Mono project, has been a great bridgebuilder between Microsoft and the open source community – so much so, that Richard Stallman recently called him “basically a traitor to the free software community”. Stallman has done his cause no credit with this remark. “I think we officially hit a new low here”, says OS news.

A terrible moment then for Microsoft to snub Moonlight by doing its own thing with Intel for Silverlight on Linux. What was even more striking is that the company seemingly had no idea of the impact of its announcement, and that it might be a sensitive matter, and apparently did nothing to prepare the Mono team in advance for the obvious questions that would be asked.

What is more important – that Silverlight works smoothly on Moblin, or Microsoft’s relationship with the open source community?

Microsoft brings Silverlight – not Mono – to Linux via Intel

Yesterday I speculated about what was meant by the inclusion of Silverlight among supported runtimes for Intel’s Moblin Linux, which is being used on netbooks using the Atom processor. I had assumed it was some new development of Moonlight, Mono’s Silverlight implementation, but apparently this is not the case. Here’s what Microsoft’s Brian Goldfarb, director of the Developer Platform Group at Microsoft, said:

Microsoft and Intel announced today that the two companies have agreed to work together to bring support for Silverlight 3 to Intel’s Atom-based Mobile Internet Devices (MID). These Atom-based devices run on Windows and Moblin, an open source, Linux-based operating system targeted at Atom-based devices. In order to help bring Silverlight content to these devices, Microsoft has provided Intel with Silverlight source code and test suites, and Intel will provide Microsoft with an optimized version of Silverlight for Moblin devices that Microsoft can then redistribute to OEMs.

There are a couple of curious aspects to this. One is why Microsoft would not simply feed optimisations into the Moonlight project, which would benefit Silverlight/Moonlight on all Linux systems. Goldfarb did add:

The Silverlight for Moblin announcement is independent from Microsoft’s work with Novell on Moonlight. The Intel/Moblin effort is specifically about building great out-of-box experiences for consumers on Atom-based devices. Microsoft’s efforts with Novell remain critical as they build an open-source, compatible, and broadly available Silverlight solution for Linux.

Another is whether Intel/Microsoft are devising some way for Silverlight to run as a desktop application, rather than just as a browser plug-in. I’m hopping to clarify these points soon.

Intel has a press release here.

London Stock Exchange migrating from .NET to Oracle/UNIX platform

The London Stock Exchange has agreed to acquire MillenniumIT, and will be replacing its TradElect and Infolect systems with the MillenniumIT trading system. TradElect is based on Windows Server and .NET,  and was created by Microsoft and Accenture. Microsoft used to use the LSE’s system as a showcase for .NET scalability, but while it proved that .NET can work for large systems, the LSE suffered an outage in September 2008 that was rumoured to be the fault of TradElect.

I don’t know much about MillenniumIT but note that the company is a partner with Sun and Oracle and that the MillenniumIT Exchange brochure [pdf] states:

Operating System: UNIX or Linux

Database: Oracle

As Brian Bryson of IBM/Rational observes, it is short-sighted to lay the blame on the platform. Nevertheless, considering the high profile of this system and Microsoft’s active involvement it is at least an embarrassment.

The mitigation for Microsoft is that .NET has less to prove these days. Even if running a system as large and performance-critical as the London Stock Exchange was a step too far, particularly for Server 2003 and (apparently) SQL Server 2000, that doesn’t rule out Microsoft’s technology for more usual workloads; and there are improvements in Server 2008 and SQL Server 2008.

Still, I’d love to know more about why the LSE is abandoning TradElect and what the lessons are for those designing and implementing systems at this level.

The problems with TradElect are thoroughly debated in the comments here.

Update: Microsoft’s LSE Case Study from 2006 is here.

I have also received the following statement from a Microsoft spokesperson:

Microsoft continues to support some of the most demanding, mission-critical environments in the world and is constantly raising the performance bar with new solutions.  Most recently, Microsoft completed three different proof-of-concept projects for a major international stock exchange that demonstrate Windows Server 2008 and Microsoft .NET can successfully support very low latency trading activities, in the 100 microsecond range using standard 1 Gigabit Ethernet.  With the addition of Microsoft Network Direct, that latency is further reduced by 50%, which is industry leading performance.