Category Archives: silverlight

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)?

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.

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.

Intel gets into the App Store game – but where does Silverlight fit in?

Intel has announced its Atom Developer Program including a new app store. The idea is to encourage a flow of applications that are well suited to netbooks, rather than general desktop applications that tend to get pressed into service because they are there, but may not be well suited to the smaller screen and more limited resources typical of netbooks versus full laptops. No doubt Intel has its eye on Apple’s successful iPhone App Store, which enhances sales of the hardware as well as providing a ready-made sales channel for independent software vendors, and wants to do the same for netbooks.

In order to participate as a developer, you have to sign up for the program, which will cost $99 annually though currently it is free. An interesting twist is that the developer program is a component market as well as an application market. Write a cool component, and you can get paid whenever any application that uses your component is sold. Intel handles all the business details, for a cut of course.

Intel is supporting two operating systems, Windows and Moblin, Intel’s Linux distribution. Your applications must be one of the following:

  • Native Windows (I am not sure whether .NET is allowed)
  • Native Moblin
  • Java
  • Adobe AIR

A puzzle is that Intel’s press release makes several references to Silverlight as a cross-platform runtime; yet although there is a Linux version of Silverlight, called Moonlight, there isn’t any exact equivalent to AIR for desktop Silverlight and I am not clear how Silverlight fits in any of the categories above. I may be reading too much into this; but perhaps all will be explained when Silverlight 4 is unveiled at PDC in November? Here’s what the press release says:

“Using Silverlight’s cross-device, cross-browser, cross-platform technology, developers will be able to write applications once and have them run on Windows and Moblin devices – expanding the reach of Silverlight applications to more consumers, regardless of whether the device they’re using is a PC, TV or phone,” said Ian Ellison Taylor, general manager, Microsoft Client Platforms and Tools.

Note that despite the above quote, Moonlight 2.0 is still in beta, and no current phones include the Silverlight runtime.

Apps must be delivered in one of the following forms:

  • .msi (for Windows*)
  • .jar (for Java*)
  • .air (for Adobe® AIR*)
  • .deb (for Debian Mobilin/Linux)
  • .rpm (for RedHat* Linux)

All applications in the store are subject to Intel’s approval (called validation):

The validation process checks your code for suitability for the Developer Program, licensing and legal issues, and some basic functionality.

Here’s the checklist. Note this requirement:

Runtimes and technologies the application can support can only be any of the following: Moblin* Native, Windows* Native, Adobe AIR*, Java FX *, and Microsoft* Silverlight*.

Hmm, Silverlight again.

Intel gets 30% of your revenue. You can also market components and if your application uses a paid-for component a share of the revenue will be paid to the component vendor. Free applications and components are also permitted.

I really like the checklist – I wish all desktop applications conformed to some of the requirements. Like this one:

The application will completely uninstall when desired, and leave no garbage files behind.

are great to read.

You can sign up here, though the SDK is not yet available.

One curious facet of the program is that although it is specifically for the Atom, in most cases your application will likely run fine on other processors. I am not sure if Intel will do anything to ensure that only Atom-powered computers use the store.

In May I posted that we should get ready for more app stores. This is really coming to pass now, with Adobe’s offering which I mentioned yesterday, Nokia’s Ovi, as well as others for Android, Palm Pre and so on.

Sony’s Flash advantage for PlayStation 3 vs Xbox 360

Sony’s PlayStation 3 includes a web browser and for some time it has been possible to view BBC iPlayer content there. The iPlayer is based on Adobe Flash. The attraction of this approach is that the console is already plugged into the home TV, so it is a relatively seamless shift from conventional broadcasting, provided you can figure out how to operate it using a game controller.

According to the BBC’s Anthony Rose, people are figuring this out big time, now that Sony has both enhanced Flash with h.264 support and full-screen hardware acceleration, and added an iPlayer icon to the PS3 menu (I should think the latter counted for more than the former). He’s revealed on the BBC Internet blog that:

… iPlayer on PS3 now accounts for a massive ~10% of all iPlayer viewing, overtaking Mac (8.5%) to be our 2nd most popular platform for IP-delivered content.

I find that impressive given that the PS3 is still marketed primarily as a games console.

The obvious question: what about Xbox 360, which is inherently more than capable of the same feat? The problem is that Flash is not supported on the 360, nor does it have a web browser. You can watch TV via a 360, by using it as a Media Center Extender, but that means getting quite a few other pieces in place in your digital home, including a Media Center PC with a TV aerial plugged into it – and even then, you are not getting iPlayer, just digital TV.

There are a couple of solutions that come to mind. One is that Microsoft could get together with Adobe and support Flash on the 360. The other is that Microsoft could get a move on with its Silverlight support on 360 and persuade the BBC to serve up iPlayer content for Silverlight as well as Flash. Both are technically feasible; the first would be easier for the BBC but embarrassing for Microsoft, which is promoting its own video streaming technology, while the second would be expensive for the BBC.

Another party which is likely to be watching with interest is ITV, which has its own catch-up service. This used to be based on Silverlight but now seems to be pretty much all Flash, perhaps because of quality problems or simply to take advantage of the wider deployment of the Flash runtime. Even though it does not have its own icon on a PS3, you could watch ITV Player via the browser.

Catch-up viewing is popular, and this sensible Flash-based development alongside existing Blu-ray support gives Sony’s machine a substantial advantage over the 360 when considered as a home entertainment device, rather than merely a games console. I’d expect this to be a significant factor as buyers make their choices in the coming Christmas season.

Finally, I wonder what other interesting potential there is for runtimes like Flash or Silverlight on a game console that is wired directly into the family home? Could there be a PS3 app store in the console’s future?

Update: A couple of informative comments below observe that there is a way to get iPlayer on the 360 via WMV download and Media Center; and that Sky Player is Silverlight-based and coming to Xbox. So it is not game over yet.

The desktop versus web application debate

I posted a piece entitled Desktop applications are dead which attracted the following comment:

Web apps have plenty of cons too. You seem to only be looking to the Pros.

There’s something in it; though the article is a little more nuanced than its title. There’s also another debate to be had around the question of what a web application really is. If thousands of lines of JavaScript are executing on the client, is it a web app? If it is running in Flash or Silverlight is it a web app? If it is running out of browser (Adobe AIR, Silverlight, JavaFX) has it crossed the border to become a desktop app? This last case is particularly interesting, since although something like AIR should probably be categorised as desktop, its programming model is normally that of a web application with an offline cache.

The semantic discussion can distract from the real issues. The ascendancy of web applications has a lot to teach software developers. The enforced simplicity, even crudeness, in the user interface of early web applications brought some surprising benefits: users generally liked the minimalist approach and ease of navigation. The page model, intended for documents, turns out to work for applications as well.

Another big lesson: users value zero-install extremely highly. The routine of go to the web page – run the app is easy to understand. Some find it easier than finding an application shortcut in the Windows Start menu, and that is after the potentially painful business of running setup.

Still, I am slipping into reiterating the advantages of web apps. What about their cons? What about the pros of desktop applications?

I still use desktop applications a great deal: Microsoft Office, Live Writer, Foobar, Visual Studio, Eclipse, all the things I listed in 10 Mac alternatives to Windows utilities. Doesn’t that prove that desktop applications are still important?

It does; but there is an important qualification. None of these are line of business applications of the type which occupy so much of the time of corporate software developers and contractors.

The real point: if there is a discussion about whether a particular project should be implemented as a desktop or web application, it is not the web application advocates who need to make their case. Rather, it is the desktop advocates who need to show the particular reasons (which may be good ones) why only a traditional local install will do.

It is also important to follow the curve on the graph. The list of things that can only be done by desktop applications gets shorter with every upgrade to the web platform – whether you think of that as HTML/AJAX, Adobe Flash, Microsoft Silverlight, or [insert your favourite web technology].

Ten years ago, a web version of Photoshop seemed an unlikely prospect. Today, here it is. Office and email is going the same way, even if it is not quite ready for all of us; Microsoft will have to accept that or lose its business.

I don’t follow Rich Internet Applications with such interest because they are cool, but because they are the future of the client – and increasingly the present as well.

BBC trying out HTML 5, video element

The BBC has an HTML 5 demonstration using the video element. The video itself is encoded in both Ogg and H.264. In the screenshot below I have just clicked on a navigation image to jump to a specific place in the video. The demonstration is meant to work in Firefox, Safari and Chrome, though for me it only ran in Firefox (3.5).

There is a detailed comment from the BBC’s Sam Dutton on why the proof of concept was put together here. There is an interesting remark on why the BBC is interested in this approach, which does not require a plugin like Adobe Flash or Microsoft Silverlight:

Flash and other Rich Internet Applications (RIAs) provide something like this already via timeline scripting, but RIAs are ‘black boxes’, using compilers and obfuscators to hide code and data: great if you want to protect intellectual property, whereas we needed to provide a mechanism whereby data and the code acting on it were open and accessible. HTML 5 and the jQuery JavaScript framework gave us the tools we needed without requiring extra plugins or proprietary software.

From a technical perspective, Dutton remarks that the HTML 5 solution is more efficient if you want to synchronize other elements with the playing video:

The HTML 5 audio and video elements remove the need for player plugins, work like any other HTML element in terms of styling and positioning, and standardise the programming interface for playback control. Less well known is that these elements emit a timeupdate event (at a frequency adjusted to fit available processing and memory) which removes the need to poll a player for the current time position. This makes media scripting far more efficient, since there is no need to run a loop or use setTimeout. In tests run on several machines we found that timeupdate events are emitted regularly and frequently (particularly in Firefox), whereas polling a media player for current video time is unreliable.

Dutton adds:

… it’s early days for us on this and there are a number of serious challenges before this becomes anything near mainstream – if ever.

The BBC is an influential site and its experiments will attract keen interest from those watching the evolution of web video.