Category Archives: .net

What’s the story with IE9 and embedded Internet Explorer?

There is a certain amount of fuss over the fact that Apple’s latest mobile Safari does not give full performance when either embedded in another application, or pinned to the home screen.

It would help if Apple were more forthcoming on the issue; but in general you cannot assume that embedded browser components will behave the same way as the full browser, even when they share common libraries.

I did some quick experimentation with the released Internet Explorer 9 and the .NET Webbrowser control. First, I tried the SunSpider JavaScript benchmark. I had to use version 0.9 since the latest one gives an error in the Webbrowser control. No great surprise: the embedded version was substantially slower. I ran the tests separately, and for the .NET application I ran in release mode outside Visual Studio. IE9 completed in 314.6ms, the Webbrowser control in 578.2ms.

image

While that may seem a bad result for embedded IE, it could be much worse. Unfortunately I did not think to run this test before installing IE9, so I dual-booted into a Windows install that still has IE8 and ran the exact same application. At 6175ms it was more than ten times slower. It was slightly quicker in standalone IE8, but not by much.

image

Next I tried the Fish Tank demo, which tests hardware graphic acceleration.

image

There were two notable facts about my result here. First, the Webbrowser control reports itself as Internet Explorer 7. Second, the frame rate for the two instances was nearly identical. In practice it varied slightly and some of the time the standalone IE9 was fractionally faster, but still close. By way of reference, Apple’s Safari was around 10 times slower.

Update: embedded IE is slower on the Fish Tank than I first realised. 60fps is a kind of maximum for the demo. Embedded IE9 slows to 45fps with 50 fish, whereas full IE9 does not drop below 60fps until 500 fish on my system. It does makes the fans whir though!

My guess is that Microsoft is more concerned about compatibility than performance, when it comes to embedded IE. However, clearly there is significant benefit from IE9 even when embedded.

How can you get embedded IE not to report itself as IE7 and to use full standards mode by default? If it is like IE8, this can only be done on a per-application basis via setting a registry key. That is awkward for developers, who would prefer an API call to set this. I am not sure if there is any change for IE9.

Microsoft remakes WCF for REST and the web

WCF is Windows Communication Foundation, the part of Microsoft’s .NET framework that handles service-oriented architecture. When WCF was first designed Microsoft was betting on SOAP web services. SOAP is still widely used but since then the trend has been towards more web-friendly services based on REST (Representational State Transfer) and JSON (JavaScript Object Notation). Microsoft has always argued that WCF is flexible enough to support such alternatives.

That said, a project which I have become aware of here at QCon London is the WCF Web APIs, presented here by Microsoft’s Glenn Block. WCF Web APIs focus on support for REST, JQuery clients, and programming model simplicity for a variety of other clients such as Silverlight and Windows Phone. The bit that surprised me is that WCF Web APIs are not just another wrapper for WCF; it is a completely new library that does not build on the old WCF Service Model. The fact that it is called WCF at all is confusing, though of course it belongs in that space within the overall .NET Framework.

I have not had time to look in detail at the WCF Web APIs, but from what I have seen and heard they are well worth exploring, even if you have found the old WCF somewhat impenetrable.

Mono project: no plans for cross-platform WPF

Miguel de Icaza’s report from the Game Developer Conference is upbeat, rightly so in my view as usage of Mono is continuing to build, not only in game development with Unity, a development tool that uses Mono as its scripting engine, but also for mobile development for Apple’s iOS with Monotouch and for Android with Monodroid. These mobile toolkits also give Mono a stronger business model; many sites use Mono for serving ASP.NET applications on Linux, but without paying or contributing back to the project.

Mono is an open source implementation of C# and Microsoft’s .NET Framework.

That said, it is interesting that Mono is still struggling with an issue that has been a problem since its first days: how to implement Microsoft’s GUI (Graphical User Interface) framework on other platforms. Mono does have Gtk# for Windows, Mac and Linux, but this does not meet the goal of letting developers easily port their Visual Studio client projects to Mono. There is also an implementation of Windows.Forms, but de Icaza mentions that “our Windows.Forms is not actively developed.”

Apparently many tools vendors asked the Mono team at GDC when Windows Presentation Foundation (WPF) would be implemented for Mono. WPF is the current presentation framework for Microsoft.NET, though there is some uncertainty about where Microsoft intends to take it. I remember asking de Icaza about this back in 2003, when the WPF framework was first announced (then called Avalon); he said it was too complex and that he did not plan to implement it.

This is still the case:

We have no plans on building WPF. We just do not have the man power to build an implementation in any reasonable time-frame.

That said, Mono has implemented Silverlight, which is based on WPF, and there are some signs that Microsoft might merge WPF and Silverlight. What would the Mono team do then?

Miguel de Icaza says:

Silverlight runs on a sandbox, so you can not really P/Invoke into native libraries, or host DirectX/Win32 content inside of it.
There are other things missing, like menubar integration and things like that.

Of course, this is no longer true on Windows: Platform Invoke is coming in Silverlight 5.

Perhaps the Mono team will knuckle down and implement Silverlight with desktop integration, which would be good for cross-platform Silverlight and compatibility with Microsoft .NET.

Then again, it seems to me that Mono is increasingly divergent from Microsoft .NET, focusing on implementing C# in places that Microsoft does not touch, such as the mobile platforms from Apple and Google.

That is actually a sign of health; and you can understand why the Mono team may be reluctant to shadow Microsoft’s every move with Silverlight and WPF.

DevExpress developers ask for more Windows Forms, say Silverlight and WPF not ready

DevExpress, which creates add-on components and tools for Windows and Delphi, has posted its 2011 roadmap. This shows more convergence between components for Silverlight and WPF:

In essence, by the end of the year, the functionality of DXGrid, DXEditors, DXDocking, and DXRibbon will be the same across both platforms.

As for Windows Forms, or winforms, the roadmap says:

With regard to the Windows Forms controls, it is most likely that there will be a large number of smaller enhancements and new features rather than any large complex new control. The reason for this is simple: we believe that our offerings for this platform are very mature and robust.

Customers posting comments to CTO Julian Bucknall’s blog are not happy:

It is sad to see Winforms pushed back so much. WPF is still too slow on most computers for major apps and SL is not mature enough for a complete ERP app.

says Sigurd Decroos, while Heiko Mueller is more blunt:

Sorry guys, but with this roadmap I will not extend my subscription. I use only WinForms and ASP.NET and I’m not interested in WPF/Silverlight – WPF at this time for me is not suitable for my kind of applications (larger business Apps). Silverlight in my eyes is a dead technology – HTML5 is the future for rich internet applications.

Porting is also an issue says Ioannis Mpourkelis:

I believe that you should put more resources on the WinForms controls for 2011. Winforms is here to stay for many years, especially for the companies who want to support existing Winfroms applications. Currently it is impossible to port WinForms applicaitons to Silverlight and very difficult to port WinForms applications to WPF.

Check the full comments for more.

More evidence for the uncertainty around where Microsoft is going with its rich client API.

Update: Bucknall comments on this specific issue here.

Where is Microsoft going with its Rich Client API? Microsoft drops some clues as developers fret

A discussion taking place in a Windows Presentation Foundation (WPF) newsgroup, in a thread called WPF vNext, shows how Microsoft’s confused rich client development strategy is affecting developers, and offers some clues about what is coming.

Developer Rudi Grobler, who posted on his blog some wishes for Windows Phone, Silverlight and WPF, describes his difficulty in discerning Microsoft’s direction:

The strategy for the future is very vague… I daily get questions about should I use WPF or Silverlight? Is WPF dead? Is Silverlight dead? etc…

Jeremiah Morrill describes his frustration with WPF performance:

Microsoft has known of WPF’s performance problems since the first time they wrote a line of code for it.  You will be hard pressed to find a customer that hasn’t complained about perf issues.  And you will not have gone to a PDC in the last few years and not hear folks bring this up to the WPF team. This is 3rd party info by now, but I’ve been told the issues I have noted have been brought up internally, only to be disregarded.

and remarks his frustration with what has happened to Silverlight:

Silverlight’s strategy USED to be about cross-platform, get-the-runtime-on-every-device-out-there, but it’s obvious that is not the strategy any more.  What happened to Silverlight on set-top-boxes?  Android? I read an article that some people saw it on XBox, but nobody has talked about it since.  Cross-platform with OSX has become symbolic at best.

Developer Peter O’Hanlon describes how the uncertainty has affected his business:

I run a small consultancy, and I bet the company on WPF because I could sell the benefits of faster development time for desktop applications. We have spent a lot of time learning the ins and outs of the platform and saw that Silverlight gave us a good fit for developing web apps. In one speech Microsoft caused me months of work repairing the damage when Muglia seemed to suggest that these technologies are dead and Microsoft are betting the farm on Html 5. We hand our code over to the client once we have finished, and they ask us why they need to invest in a dead technology. I don’t care what you say on this thread, Microsoft gave the impression that html 5 was the way to go.

[…] Muglia’s statement about the future being html caused serious issues for my company. We lost two bids because the managers didn’t want to commit to "dead" technology.

Microsoft’s Jaime Rodrigues, WPF Technical Evangelist, offers the following response:

You are telling us to improve perf in WPF. We hear this loudly and we are trying to figure how to solve it. Unfortunately, there are a few pieces to consider:

1)      First of all,  a lot of our customers are telling us to invest more into Silverlight.  Let’s say (again made up) that demand is  4-to 1. How do we justify a revamp of the graphics architecture in WPF.  This is not trivial work; the expertise in this space is limited, we can’t clone our folks to 5x to meet everyone’s needs.

2)      Let’s assume we did take on the work.  My guess (again, I am not engineering) is that it would take two years to implement and thorougly test a release.  At the stage that WPF is at, a rearchitecture or huge changes on the graphics stack would be 80% about testing and 20% about the dev work.    It is not a trivial amount of work.   Would we get the performance you want across myriad of devices? We don’t know. WPF bet on hardware, and there is new devices out  there that are trading hardware for battery, weight, or simply for cost.  it would suck to do that much work, make you wait a long time, and then not get there. Let’s get real on the asks; you say "improve perf" but you are asking us to do a "significant re-write"; these two asks are different.

3)      By the time we get there, what will be a more powerful framework?  Silverlight, WPF, C++, or SuperNew.Next ??  we don’t know today.  We go back to #1 and look at demand We are in agreement that "customers" is the driving principle.

The WPF has looked at the trade-offs, and risk many times.  We are also looking at what customers need. Jer, to you it is all about graphics.  To many others, it is about data.  So, how do we serve all customers??
The strategy is exactly what you have seen/heard:

1)      WPF 4.5 is going to have some significant data binding performance improvements.

2)      We are not redoing the graphics framework, but we are doing a lot of work to let you interoperate with lower level graphics so that if you need more graphics perf you can get it, and still keep the RAD of the rest of the framework.

[…] Hope it helps; apologies if it does not, and again, wait for Rob Relyea or someone else to make it official.  That is just my 2c as a person who bet heavily on WPF but has seen the data that drives the trade-offs the team has to make.

This will be disappointing to former Microsoft evangelist Scott Barnes, who has initiated a Fix WPF campaign.

The problem though is lack of clarity about the strategy. Look at Rodrigue’s third point above. Nobody can predict the future; but what is Microsoft’s current bet? Silverlight, HTML5, or maybe SuperNew.Next – for example, the rumoured new native code UI for Windows 8 or some variant of it?

My own view is that the current difficulties are rooted in what happened with Longhorn and the fact that the Windows team abandoned WPF back in 2004. I’ve written this up in more detail here.

Lest this post be misinterpreted, let me emphasise that Microsoft has a good track record in terms of supporting its Windows APIs long-term, even the ones that become non-strategic. Applications built with the first version of .NET still run; applications built with Visual Basic 6 mostly still run; applications built for ancient versions of Windows often still run or can be coaxed into running. Build an application with WPF or Silverlight today, and it will continue to work and be supported for many years to come.

My guess is that events like the coming 2011 MVP Summit and Mix 2011 in April will bring some clarity about Microsoft’s mobile, tablet, Windows and cross-platform story for rich clients.

Update: Barnes has his own take on this discussion here.

Trying out MonoTouch – C# for Apple’s iPhone and iPad

I’ve posted an article on trying out MonoTouch, which builds on the open source Mono project to provide a means of developing apps for Apple’s iOS using C# and the .NET Framework.

It is easy to assume that since the .NET Framework is Microsoft’s technology, using a non-Microsoft implementation is risky. Then again, Mono is open source; and the more usage it gets, the better it becomes. MonoTouch is an important development for the project, since it is a commercial project which might actually be making some money for Novell/Attachmate. While it would be nice to get it for free, it is important that Mono makes business sense as well. MonoTouch has given the Mono project a significant boost.

Red Gate to charge for .NET Reflector, runs into storm of protest

Tools company Red Gate is to discontinue the free version of .NET Reflector, a popular tool for debugging and decompiling .NET code.

image

The tool itself is amazing. It takes advantage of the fact that .NET code is not compiled to native code until runtime. The code that is distributed is in .NET “intermediate language”, which means it can easily be decompiled. Reflector makes this as easy as opening a file. This is invaluable for debugging when you do not have the original source code, though a further implication is that if you want to protect your source code you need to obfuscate it.

Reflector was created by Lutz Roeder, who shared it freely with the community. In 2008 Roeder sold Reflector to Red Gate, stating:

Red Gate will continue to provide the free community version and is looking for your feedback and ideas for future versions.

Red Gate developed Visual Studio integration and some further features, offering a free version as well as a paid-for premium edition. Now it has decided this is no longer viable. Watch this video as distinctly uncomfortable CEO Simon Galbraith answers the question “Didn’t we promise that Reflector was always going to be free?”:

Right now owning Reflector doesn’t make commercial sense. Further development of Reflector doesn’t make commercial sense. Reflector’s a tool that needs to stay up to date. We need to spend money on it. At the moment we can’t do so in a commercially justifiable way.

We’re really regretful that we ever made such a statement that we were going to try not to charge for it. In hindsight we wish we hadn’t done that. It was never a promise by the way. Two years ago we thought we could make a success of it without having to charge for it, it turns out that wasn’t the case.

Galbraith says that Red Gate had expected two benefits from Reflector: sales of other tools to Reflector users, and up-sell to the premium version. Neither has really happened, he says, adding:

We know that people are going to be cross with us.

What has particularly annoyed users in the feedback forum is that the existing free version is time-bombed, and will expire on May 30th. So users will be forced to upgrade.

i have been a happy (paying) customer of red-gate for some time now – sql tools, .net tools.
i have told many other developers of your products – happy to explain how good they are and how awesome red-gate is.
i won’t be doing that any more. IMO you have managed to destroy your company reputation such that purely on principle i won’t be recommending you to anyone anymore.

says one user.

Reflector has actually been time-bombed for years. I have a download from 2008, and if I run it I get this message:

image

If I click Yes, I am told that automatic update is impossible and directed to the Red Gate download page. If I click No, the dialog closes. In either case, the Reflector executable deletes itself. This is not so bad if you can download another free version; but following the change of policy that will not be the case.

Red Gate might not have made money from Reflector, but now it has the opposite problem: bad PR because of withdrawing an existing and popular free tool.

The price for the new Reflector will be just $35.00; not much for such as useful tool. There is nothing wrong with a software company charging for its work. This is a difficult transition though, and the question is: would Red Gate have been better off releasing Reflector back to the community and ceasing its own investment, rather than making a renewed effort to make it a viable commercial product?

How is Windows Azure doing? Few mission critical apps says Microsoft

I attended an online briefing given by Azure marketing man Prashant Ketkar. He said that Microsoft is planning to migrate its own internal systems to Azure, “causing re-architecture of apps,” and spoke of the high efficiency of the platform. There are thousands of servers being managed by very few people he said – if you visit a Microsoft datacenter, “you will be struck by the absence of people.” Some of the efficiency is thanks to what he called a “containerised model”, where a large number of servers is delivered in a unit with all the power, networking and cooling systems already in place. “Just add water, electricity and bandwidth,”, he said, making it sound a bit like an instant meal from the supermarket.

But how is Azure doing? I asked for an indication of how many apps were deployed on Azure, and statistics for data traffic and storage. “For privacy and security reasons we don’t disclose the number of apps that are running on the platform,” he said, though I find that rationale hard to understand. He did add that there are more than 10,000 subscribers and said it is “growing pretty rapidly,” which is marketing speak for “we’re not saying.”

I was intrigued though by what Ketkar said about the kinds of apps that are being deployed on Azure. “No enterprise is talking about taking a tier one mission critical application and moving it to the cloud,” he said. “What we see is a lot of marketing campaigns, we see a lot of spiky workloads moving to the cloud. As the market start to get more and more comfortable, we will see the adoption patterns change.”

I also asked whether Microsoft has any auto-scaling features along the lines of Amazon’s Elastic Beanstalk planned. Apparently it does. After acknowledging that there is no such feature currently in the platform, though third-party solutions are available, he said that “we are working on truly addressing the dynamic scaling issues – that is engineering work that is in progress currently.”

Silverlight native extensions allow deep Windows 7 integration, but forget cross-platform

Microsoft has released Native Extensions for Silverlight, a set of libraries which enable access to Windows 7 features including taskbar Jump Lists; access to attached devices including webcams, cameras and phones; the sensor API for accelerometer support; and even the ability to intercept Windows messages. The ability to intercept Windows messages allows lots of interesting hacks as veteran Visual Basic developers will recall; it was one of the tricks used to overcome limitations in early versions of VB.

The native extensions are only available to out of browser applications running outside the sandbox; the user must consent to trust such applications. Silverlight 4 already had the ability to use COM automation. These new extensions simply build on this existing feature, providing COM automation wrappers for these Windows 7 APIs.

What this means though is that Silverlight developers can create applications that integrate deeply with the Windows 7 desktop and local hardware.

Another way of looking at this is that the subset of Windows applications that can be implemented in Silverlight rather than the full .NET Framework has now increased. It lends some support to the theory which I considered here, that a future version of Silverlight will be the application platform for the Windows 8 app store and for mobile devices running Windows 8. This is speculation though; Microsoft has not said much publicly on the subject. Silverlight is well suited to an app store since installation is easy, updates are near-automatic, and apps are isolated from the rest of the operating system.

The native extensions are Windows 7 only. Forget the Mac, these things do not even work on Windows XP. They only apply to trusted out of browser applications though. Silverlight running in the browser still has similar features on Windows and Mac.

Talk of Windows 8 on an smartphone shows Microsoft’s mobile confusion

During a conference call to discuss Intel’s latest financials, CEO Paul Otellini raised the possibility of putting the full Windows OS onto a smartphone, running a low power Intel SoC (System on Chip). The matter came up with Otellini was asked about the impact of Windows on ARM, announced at CES earlier this month:

The plus for Intel is that as they unify their operating systems we now have the ability for the first time: one, to have a designed-from-scratch, touch-enabled operating system for tablets that runs on Intel that we don’t have today. And secondly, we have the ability to put our lowest-power Intel processors running Windows 8 – or ‘next-generation Windows’ – into phones, because it’s the same OS stack. And I look at that as an upside opportunity for us.

The reasoning seems to be: if Windows 8 is designed to run well on mobile devices with ARM, it will also run well on mobile devices with an Intel SoC, which will let us put it on phones.

Note the point he highlighted: Microsoft unifying its operating systems. No more full Windows vs Windows CE; one OS from mobile to desktop.

Although that sounds compelling, the snag is that Windows is not well suited to low-power mobile devices, which is why Windows CE was invented in the first place. Microsoft can fix this to some extent by fixing the things that make it unsuitable, but it carries a heavy compatibility burden.

It also throws up the question: just what are Microsoft’s long-term plans for Windows Phone 7, which is built on Windows CE, has its own GUI mostly written in native code, and a development platform based on .NET – Silverlight and XNA – plus a native code SDK that only mobile operators and device manufacturers get to use?

At CES Microsoft Steven Sinofsky sort-of denied that Windows will encroach on Windows Phone 7 territory. “Windows Phone 7 is uniquely focused on the small form factor that Windows doesn’t focus on,” he said.

Nevertheless, the company’s decision not to use the Windows Phone 7 OS for tablets may make that inevitable. What is the difference between a smartphone and a small tablet? Does Microsoft expect developers to write apps designed for Windows on a small tablet and then rewrite them for Windows Phone 7 using Silverlight?

It does not make sense; and despite the Windows Phone 7 promotion included in CEO Steve Ballmer’s CES keynote, I was left wondering whether Microsoft’s new mobile OS really has a future.

That said, Silverlight abstracts the OS, so in principle Microsoft could use it to form a consistent mobile development platform irrespective of whether the underlying OS is Windows CE or full Windows. I am not getting that sense from the company though, and I’d expect the primary Windows SDK to remain based on C++.

I am struggling to understand how Microsoft expects this to work. App compatibility is the obvious benefit of full Windows; but two big issues are that most Windows apps are not touch-friendly and are not designed for small screens. Putting Windows on a tablet with a decent screen size and the dreaded stylus works to some extent, but will never compete with Apple’s iPad for usability. On smaller screens most existing apps will not work properly; and if Windows on small devices sprouts a completely new touch-friendly GUI, or borrows the one from Windows Phone 7, then app compatibility with desktop Windows will be limited.

It feels as if Microsoft’s Windows team is saying one thing, the Windows Phone 7 and developer teams saying another, and partners like Intel saying yet another. Windows Phone 7 was meant to be the thing that made belated sense of Microsoft’s mobile strategy, but even that now looks doubtful for the reasons stated above.

Microsoft is still a long way from having a coherent strategy for mobile devices, and that lack is damaging the company and helping Apple and Google to establish their competing operating systems.

Update: Mary-Jo Foley writes about Microsoft “Jupiter” which is a rumoured new user interface and application model designed for Windows 8 and its app store:

Jupiter is going to be a new user interface (UI) library for Windows, built alongside Windows 8. It will be a thin XAML/UI layer on top of Windows application programming interfaces and frameworks for subsystems like graphics, text and input. The idea is Jupiter will bring support for smoother and more fluid animation, rich typography, and new media capabilities to Windows 8 devices.

Is Jupiter a .Net technology, or XAML adapted for native code, or both? Is it one and the same as, say, Silverlight 6? That is not stated, though Senior VP Soma Somasegar helpfully (or not) said that:

some of the information in this post is not right and out of date, not reflecting Microsoft’s current thinking.

That seems to tacitly confirm that it fairly represents Microsoft’s thinking at some time in the not-too-distant past.

It would make sense to me if Microsoft used Silverlight to unify its application platform as mentioned above, and combining the XAML presentation layer with native code could address performance and memory usage concerns with .NET. This is the kind of news that would really give confidence to Silverlight developers, rather than the damage limitation PR that Microsoft has put out since PDC late last year.

On the other hand, I believe Somasegar when he says the information is out of date, so for the time being it is just another dose of uncertainty.