Category Archives: windows

Hands On with Storage Spaces in Windows Server 8

Storage Spaces is a new virtual storage feature in Windows Server 8. I have the developer preview installed, but it took me a while to get Storage Spaces working – you need one or more unused hard drives. I finally managed to find a spare 150GB Sata drive and tried it out. Note that I am going to create a 1.5TB drive on this using the magic of thin provisioning, with data deduplication thrown in for good measure.

Step 1 is to go into the file services section of server manager and create a pool. A pool is a collection of one or more disks which you will use in aggregate.

image

Here I specify the pool name and the subsystem where it will find its disks. In my case it is the RAID controller built into the motherboard.

image

Success

image

Next task is to create a new volume. I’ve selected thin provisioning as I want a drive larger than the available space. If it runs out of real space, I will have to add another drive to the pool. I have also selected Simple layout, which means no resiliency. I am doing this for the demo as I only have one drive, but in reality I would always use one of the resilient options. They are apparently not RAID, even though they are like RAID.

image

Next I assign the new drive to a virtual folder, as I am bored with Windows drive letters.

image

I turn on data deduplication. This means that I can have several copies of the same file, but it will only occupy the space of one. If a file is mostly the same as another file, I will also save space.

image

Success again. Note that Windows formatted the new drive for me in a matter of minutes. It may help that most of the space does not really exist.

image

Here is my drive ready for use, with 1,572,730,876 KB free. Handy.

image

I am impressed with how easy Storage Spaces are to use, and that it works with cheap Sata drives.

Now, I remember that Windows Home Server had an easy to use storage system called Drive Extender. You could just add and remove drives. Is Storage Spaces a kind of grown up version of Drive Extender? I asked the Windows storage team and got a snooty reply. “We do not contrast our upcoming capabilities with those that might have been offered in the past as part of other Microsoft products.” However, the spokesperson did add:

Storage Spaces delivers a rich storage virtualization capability directly from within Windows. Two powerful new abstractions (Pools and Spaces) deliver multiple benefits including seamless and easy capacity aggregation and expansion ("just add drives to a pool"), optimal just-in-time allocation (via Thin Provisioning), resiliency to physical drive failures (via mirrored or parity spaces), continuous availability (via integration with failover clustering and cluster shared volumes), ease-of-management via integration with the rich new Windows Storage Management API (with WMI interfaces and associated PowerShell cmdlets), and "pay-for-play" via support for pools comprising heterogeneous media (e.g. SSDs and HDDs). Obviously, these are just a subset of features.

Obviously. I like Storage Spaces so far though, and the feature seems to bring some similar benefits to Windows Server users.

A few observations on Windows Phone 7.5 “Mango”

I received a Windows Phone running version 7.5 “Mango” for review yesterday. Here are some initial observations; I am not going to call it a review after such as short time.

image

There is still no screen capture utility – well, there is this one but it requires a developer accounts. So no screens, sorry. Microsoft should fix this – how difficult can it be?

Microsoft says there over 500 updates in Mango, and it does feel like a significant update, though retaining the look and feel of the first release. A half-version upgrade is about right.

Some things I noticed:

  • Task switching. Press and hold the back button, and swipe through running apps. This is excellent, better than iPhone or Android.
  • Voice control. This is expanded in Mango to include web search, text messaging and more. Tip: to see the commands, hold down the Windows key to go into speech mode, and click the help icon.

    It has great potential, especially with a bluetooth headset for true hands-free. I have a Plantronics Voyager Pro bluetooth headset, reviewed here. Using this guy, I can press and hold the call button on the headset, to put the phone into speech mode.

    I found this works well for calling people or simple searches, but general speech to text is not too good. I tried texting someone the message “Your parcels have arrived”. After several attempts, all of which were interpreted as various strings of garbage starting “George”, I gave up. I would still use it for making calls though; it seems that when the scope is narrowed to people in your contacts list, the interpretation is more reliable.

  • The search button is no longer contextual – it always takes you to Bing search. I think this is a retrograde step.
  • Local Scout is a feature that is meant to find restaurants, shops, things to do, and other handy information based on your location or the current map location. This is a neat idea, but when I tried it for my home town it did not work well. The first problem: I found that tapping the Local Scout tile is unreliable, and sometimes reports that Bing cannot find the location even when the location button in Bing Maps works fine.

    Fortunately you can also use Local Scout from Bing Maps. The Local Scout listing was not good though. Of the top 20 food and drink places, one had been closed for years, others were duplicated under old and new names, and there were hardly any ratings or reviews. Tap “Suggest changes” and you can submit changes to the address details or report closure, but you cannot add a review or rating, which seems a severe omission.

    I downloaded the TripAdvisor app which is a great deal more useful, mainly because of the amount of user-generated content.

    Maybe I’m missing something, but it seems to me that Microsoft needs to join a few dots here; Local Scout is only as good as its data.

  • Office and SharePoint integration. As soon as I gave Windows Phone my Live ID, it picked up my SkyDrive account and was able to open, edit and save documents there. I also hooked up Outlook to my own Exchange server, and added an Office 365 SharePoint account as well.

    SkyDrive support is new and a huge feature, especially considering that it is a free service. Editing features on the phone are limited, but you can include basic formatting.  More important, you can easily access what could be a large document repository.

    OneNote support is good, and notes made on your phone sync automatically to SkyDrive, where you can further view and edit them in a browser, or in desktop OneNote. I guess I can show a grab of the browser, which shows that the voice memo is inaccessible:

    image

    I discovered a few oddities. I was unable to link Windows Phone to my own SharePoint 2010 test server, receiving a message “We don’t support this authentication scheme”. Later I found this information:

Unless your organization uses a Microsoft Forefront Unified Access Gateway (UAG) server, you can only access a SharePoint 2010 site if you’re in the office and connected to your organization’s Wi-Fi network.

That is a considerable limitation. It did work OK with SharePoint on Office 365, except that for some reason I can find no way to create new documents on Office 365 – well, maybe in the browser. The Office Hub can create new documents on SkyDrive, but not on SharePoint, which is odd as the two have a lot in common.

Despite these issues, you get a lot out of the box for using Office on the move, particularly if you use a supported SharePoint configuration or SkyDrive. The on-screen keyboard is good too.

  • Music search. This is a fun feature. Go to Bing search, click the music icon, and it will try to recognize what is playing. It had no problem finding Katy Perry’s Teenage Dream. It struggled a bit with the more obscure Strangely Strange but Oddly Normal by Dr. Strangely Strange; but on the second attempt it found that too.
  • The social media features seem strong to me, though you are limited to the baked-in services which are Twitter, LinkedIn, Facebook and Windows Live (no Google+). You do have to link each service to your Live ID for full features; for example, you give permission to Windows Live to post to your Twitter account. The integration is smooth and if you spend your time juggling with these four services then this may well the phone for you. For example, you can post a message to all of them at once. I found the People hub good enough as a Twitter client.
  • Apps are still lacking. The issue is not the quantity of apps available, but their quality, and the lack of certain key apps. There is no official Dropbox app, for example, so you will need to use the web or a third-party workaround. On the positive side, the free Guardian app is great, especially since you can pin a section to the Start screen – I did this for Technology – and there are apps for WordPress, Amazon Kindle, the ubiquitous Angry Birds and some other essentials.

    I noticed that TripAdvisor has 61 ratings on the Windows Phone Marketplace, whereas the Android version has 39,930. That illustrates the scale problem Microsoft is facing.

  • Still no Adobe Flash.
  • Microsoft’s new Windows Phone site is clean and informative. Not always the case with Microsoft’s sites. The My Windows Phone site lets you find your, lock or erase your phone, once configured.
  • Internet sharing, which makes your phone into a wireless hotspot, is coming but subject to operator support and approval. This means you will likely pay extra for “tethering”. I have a free app which does this on my Android phone and find it useful, though whether it is worth paying extra every month is another matter.
  • Microsoft has introduced some features aimed at enterprises. In particular, Information Rights Management is now supported for Outlook and Office mobile documents. Another important feature is the ability to deploy custom applications as hidden apps, which do not appear in Marketplace searches, but can be downloaded from a link circulated internally. There is now a Lync (business messaging and conferencing) client for both Office 365 and on-premise Lync servers.

Future of Windows Phone?

My guess is that Microsoft is badly disappointed by the sales performance of Windows Phone to date. The problem is not so much the phone itself, but that it has failed to convince either the operators, or the retailers, or the general public, that it is something special and worth choosing ahead of either an Apple iPhone or Google Android device. In fact, typically retailers have few if any Windows Phones on display, and even customers asking specifically for one may be redirected to something else. The truth is, there is a disadvantage in having a minority-choice device, most obviously in the selection of apps available, but also in features that rely on user-generated content.

I asked about this problem at the Mango press launch and was told that the Nokia partnership will be the solution.

My review device is a first-generation HTC Trophy, and while it is decent enough it is not outstanding. Give Windows Phone some truly desirable hardware and a few must-have apps, and its fortunes will change, but that is not an outcome that I take for granted.

I do like the SkyDrive and Office 365 integration though, with the caveats noted above, and if I were Microsoft I would be pushing the value of those features.

Miguel de Icaza talks about Windows 8 and the failure of Linux on the desktop

At Microsoft BUILD earlier this month I arrived early to hear Anders Hejlsberg talk about the future of C#, and found myself next to Miguel de Icaza, co-creator of the GNOME desktop and of Mono, the open source implementation of Microsoft .NET. I took the opportunity to ask a few questions, which I have his permission to post.

I recall that when .NET was first announced in 2000, it was not long before de Icaza announced Mono. I was interested therefore to know his reaction to Windows 8 and the new Window Runtime which powers “Metro-style” apps. Will we get an open source implementation of Metro-style on Linux?

I don’t think so. To be honest, with Linux on the desktop, the benefits of open source have really played against Linux on the desktop in that we keep breaking things. It is not only incompatibilities between Red Hat, Unbuntu, Suse, but even between the same distribution.  Ubuntu from this week is incompatible with the one nine months ago. And then there are multiple editions, the KDE version, the Gnome edition, the one that is the new launching system.

When you count how many great desktop apps there are on Linux, you can probably name 10. You work really hard, you can probably name 20. We’ve managed to piss off developers every step of the way, breaking APIs all the time.

I’m heartbroken, that’s the bottom line.

What about compiling your Metro app for iOS or Android?

I think that Linux has a tough time on the desktop. And the desktop is starting to not matter any more. On the other hand, building WinRT is going to be a significant amount of work. A large chunk probably could be reused from Moonlight. But it is a lot of work, to be able to reuse existing Windows apps, and in the case of iOS they already have their own stack, and Mac has its own, Cocoa is really nice and we have .NET bindings for it.

So I think we’ll learn interesting lessons from Metro. There is stuff that will be useful on other platforms like the JSON reader. But I’m not going to spend any time on WinRT for other systems.

And we can speculate about how well Metro will work in the market …

They are Microsoft, it’s going to succeed. In three years they are going to have this thing on half a billion computers, so it will be out there.

It seems like they are going to use their muscle for two things. It’s going to be a tempting space [for developers], but if you want to go into the right distribution channel for that half a billion computers, you need to abide by the Metro guidelines. They are not going to give you full API access, they are going to give you the sandboxed version. Which is good, because it can finally fix the security problems on Windows. They are going to use their muscle to reset the rules for Windows.

Especially on ARM

Right, and it is needed, they definitely need to fix this mess, a lot of malware, spyware, and the fact that everybody is sysadmin, and has to reinstall their machine every so often.

I’ve heard the word “safe” a number of times.

Right, and think of an iPad, you don’t need to be a sysadmin.

Now, you could argue that by WPF not being available to everybody and being bound to .NET they limited the effect WPF would have had, whereas Metro gives this to C++ developers, but they’re saying, hey, you can’t call Win32, there is all the Win32 stuff you can’t call. You have to use Metro. So they might be repeating that [mistake], but maybe it’s eclipsed by the fact that there’s going to be a rush to the app store. It seems like there is a big enough carrot now.

How are you getting on with the Windows 8 tablet?

I have to say, I actually like Windows 8. I am not a Windows user. It’s probably the first time that I would use a Windows machine.

Miguel de Icaza is now at Xamarin, providing cross-platform tools for using C# and .NET to build apps for Apple iOS and Google Android.

A simple example of async and await in C# 5

I have been playing with the Visual Studio 11 developer preview and exploring its asynchronous features, specifically the async and await keywords which are new to C# 5.0. These features have actually been available as a CTP (Community Tech Preview) since October 2010, but I had not found time to try it.

I like to keep examples as simple as possible. I have a Windows Forms application which has a long-running task to perform, and I do not want to lock the UI while it runs. Here is my long-running function:

 private int slowFunc(int a,int b)       
 {          
 System.Threading.Thread.Sleep(10000); 
 return a + b;
 }

Yes, it takes 10 seconds! I am going to click a button on a form, call the function, and show the result on a label control.

Now, here is how I might try to achieve the goal of not locking the UI using Visual Studio 2010 and C# 4.0:

 private void button1_Click(object sender, EventArgs e)
 {            
 this.button1.Enabled = false; //prevent re-entry 
 var someTask = Task<int>.Factory.StartNew(() => slowFunc(1, 2));
 this.label1.Text = "Result: " + someTask.Result.ToString(); //oops, blocks calling thread 
 this.button1.Enabled = true;       
 }

Oops, this did not work at all! The reason is that although I have gone to the trouble of creating a Task in order to run the slow function on a background thread, my work is undone when I call the Result property of the Task object – since this blocks the thread until the Task completes.

Here is how you can fix it in Visual Studio 2010 – remember, there is an easier way in C# 5.0 coming up soon:

 private void button1_Click(object sender, EventArgs e)        
 {
 this.button1.Enabled = false;          
 var uiScheduler = TaskScheduler.FromCurrentSynchronizationContext(); //get UI thread context 
 var someTask = Task<int>.Factory.StartNew(() => slowFunc(1, 2)); //create and start the Task 
 someTask.ContinueWith(x =>     
   {                                          
   this.label1.Text = "Result: " + someTask.Result.ToString();   
   this.button1.Enabled = true;   
   }, uiScheduler  
  );        
 }

This one works. I click the button and the UI does not lock up at all; I can minimize the form, move it around the screen, and so on.

However, I have had to do some extra work. The ContinueWith method tells the Task to run some other code after the background thread has completed. By default this code will not run on the UI thread, which means it will raise an exception when it updates the UI, but you can pass in a TaskScheduler object so that it continues on the UI thread.

Now here is a look at the same problem using C# 5.0. The slowFunc is the same, so I will not retype it. Here is the code for the button click:

 private async void button1_Click(object sender, EventArgs e)
 {
 this.button1.Enabled = false; 
 var someTask = Task<int>.Factory.StartNew(() => slowFunc(1, 2)); 
 await someTask;  
 this.label1.Text = "Result: " + someTask.Result.ToString(); 
 this.button1.Enabled = true;
 }

Less code, same result, which is usually a good thing.

What is going on here though? First, the async modifier is added to the click event handler. This does not mean that the method runs asynchronously. It means that it contains code that will run asynchronously using await. As Eric Lippert explains, it tells the compiler to rewrite the method for you.

Second, there is the await keyword. I cannot improve on Lippert’s explanation so here it is:

The “await” operator … does not mean “this method now blocks the current thread until the asynchronous operation returns”. That would be making the asynchronous operation back into a synchronous operation, which is precisely what we are attempting to avoid. Rather, it means the opposite of that; it means “if the task we are awaiting has not yet completed then sign up the rest of this method as the continuation of that task, and then return to your caller immediately; the task will invoke the continuation when it completes.

If you refer back to the Visual Studio 2010 examples, you will see that the code is very close to my first, non-working example. In other words,using await makes the code work in the way that intuitively I hoped that it might, without specifically called the ContinueWith method and messing around with the thread context as in the second example.

This is still concurrent programming though. One thing that C# 5.0 cannot prevent is an impatient user clicking several times on the button when the result does not appear immediately, so in all the examples I have disabled the button while the background thread runs.

Finding apps in Windows 8

I’ve been spending some time in Windows 8, complete with the Metro-style Start menu. The new Start menu is not great in a virtual machine without touch. You have to navigate with the horizontal scroll bar at the bottom of the screen, which I find somewhat jerky. DirectX is not particularly fast on the VM, which I view using Remote Desktop. Another puzzle is that many apps are not represented by tiles on the big menu. How do you find them?

The answer is that the tiles are not exactly equivalent to the items on a Windows 7 Start menu. They are more equivalent to the items that you have pinned to the taskbar in Windows 7; and in fact, if you pin an app in Windows 8, it appears as a tile. To get the full list of Start menu items you are meant to start typing.

image image

When you press a key in the Metro Start menu, the tiles disappear, and you get a list of all the apps that match what you have typed. The match seems to be based on words with initial letters that match your string. So if you type CL you match Disk Cleanup, but typing PAD does not find WordPad.

If you press Windows key – Q it brings up the Search Apps screen with an empty search box, and lists all your apps in a columnar A-Z view.

image

Now, the thing that gives me hope here is that the search is very fast, much faster than I am used to with search in the Windows 7 start menu. It could almost convert me.

Search is baked into Metro, and searching apps is only one of the options. You can also search settings and files (though files seems to mean documents), and any applications that implement the search contract. For example, from the same search pane, you can search the custom BUILD app for c#:

image

One other thing: “All Apps” is not really all apps, of course; just the ones that would have been in the Windows 7 Start menu. If you want, say, Dxdiag, you will have to press Windows Key – R and type it in there. It would be nice if typing DX would find it, but it is not that smart unfortunately (update – but see comments below).

Delphi team focusing on FireMonkey, VCL winding down?

Julian Bucknall at componnent vendor DevExpress writes a thoughtful post arguing that Embarcadero will focus on Delphi’s new cross-platform FireMonkey framework in future, and that the VCL (Visual Component Library) which has been at the heart of Delphi since its first release will receive little future investment.

Bucknall notes that ex-Borland employee Danny Thorpe tweeted about 1/3 of the Delphi VCL and IDE team being laid off in Scotts Valley, USA; while Embarcadero’s Tony De La Lama blogs about new posts in Europe. FireMonkey was originally developed in Russia.

The VCL is a mature framework by any standards (Delphi was first released in 1995), and now that the 64-bit VCL has been released the most pressing demands of developers have been met.

Further, Microsoft itself is slowing development of the Win32 API on which VCL is based, in favour of the mobile and touch-friendly Metro user interface and the new Windows Runtime on which it is built. The VCL will never adapt to Metro, but FireMonkey might do so. The Windows Runtime has an API which is represented by metadata in same format used by .NET’s Ildasm. If Embarcadero can adapt Delphi to read this metadata so that you can easily call the API, then a Delphi for Metro seems plausible, but it would not use the VCL.

Delphi already works well for Windows applications, so from Embarcadero’s point of view, growth will come from cross-platform and mobile development using FireMonkey.

The main snag is that unlike the VCL, FireMonkey is far from mature, and developers are complaining about lack of documentation as well as limitations in the current implementation.

There is also a philosophical difference between VCL and FireMonkey. VCL is a “heavyweight” GUI framework in that it depends on native Windows controls, with the advantage that you get a truly native look and feel in your Delphi application. FireMonkey is a “lightweight” GUI framework which renders the UI entirely through custom drawing, which is great for cross-platform consistency, but poor if you want a native look and feel. Performance-wise, and despite the name, heavyweight frameworks often feel faster because native controls are optimised for the operating system.

The key question then: will FireMonkey be as good for cross-platform, as the VCL has been for Windows? Based on my first experiments I am not sure at the moment, though I expect it to improve. I would be interested in views from others who have worked with it.

Installing Windows 8 developer preview on VirtualBox

I have installed the Windows 8 developer preview on Oracle VirtualBox. It does not work on Virtual PC since 64-bit guests are not supported. It is probably fine on Hyper-V, but I don’t have spare Hyper-V capacity for it at the moment.

image

I had a few hassles and thought it would be worth sharing my notes.

I gave the VM 2GB of RAM, 2 processors, and the maximum amount of video ram, but these settings are up to you.

The main problem I encountered was with the mouse. I found that it worked a bit in the Windows 8 guest, but only a bit. The pointer jumped around and was too frustrating to use.

The solution I found was to remote desktop to the VM from my Windows 7 desktop. I could not get the remote desktop built into VirtualBox to work, on a brief try, so I used pure Windows to Windows.

In order to do this, I first set networking in VirtualBox to Bridged. This means it is on the same subnet as the host computer. Then I enabled remote desktop access in the Windows 8 control panel. I opened a command prompt to check the IP address – Windows key + R opens the Run prompt and is a useful combination when the mouse is not working.

Then I was able to use remote desktop to that IP address. Note that unless you join the Windows 8 machine to a domain, the username is:

machinename\email address

or alternatively

WindowsLiveID\email address

presuming you do the default thing, which is to hook up Windows 8 to a Live ID.

Now, if you do this you will have two GUIs showing, which is untidy. You can fix this by running the VM headless. Shut down the VM, navigate to the VirtualBox directory and run the following command:

vboxheadless –startvm yourvmname

Now you can log on to the Windows 8 VM without having any other instance on the screen.

You might not have the same problem with the mouse, of course.

Incidentally, I am not sure what is the best way to shutdown the VM, but I use a command prompt or WindowsKey – R and type:

shutdown /s

My final observation: Windows 8 with just mouse and keyboard is a lot less fun than on a real tablet. It raises the question of just how much value there is in Windows 8 for non-tablet users. I suspect rather little, which is why Windows 7 is set for a long life on the corporate desktop, and for other users who do not have touch screens.

A few facts about Microsoft’s new Windows Runtime

I’ve just come out of Martyn Lovell’s talk on WinRT internals here at BUILD in Anaheim, California.

Make no mistake: Microsoft has re-invented the Windows API in WinRT. Just to recap, WinRT is the API for Metro-style applications, the touch-centric, app-centric API for tablets and, one presumes, eventually for Windows Phone (though Microsoft has yet to admit it).

WinRT is only useable from Metro applications. You cannot call WinRT from a Win32 application, nor vice versa*. I think it is reasonable to assume that a future version of Windows which runs only WinRT is a possibility; and that Windows 8 on ARM will look a bit like that even though Win32 will still be there, but mainly out of sight; but I am speculating.

Does that mean Win32 is now legacy? In a way, but such a huge legacy that for the moment we should think of Windows 8 as two platforms side by side.

There is no inter-app communication in WinRT other than by the pre-defined contracts built into the system (though Lovell noted that you could always use the file system and polling for a crude inter-process communication).

There is no way to install a shared dynamic library. Apps can only use the system libraries together with what you install with the app. Each app lives in its own context and is isolated. In other words, WinRT is not extensible, other than within your app’s code*.

If you figure out a way to bypass limitations of WinRT by calling other Windows APIs, your app might work but the submission process for the Windows Store will prohibit it.

Versioning is built into WinRT. This means that when Windows 9 comes along, you will be able to code just against the Windows 8 versions of the classes, for compatibility, and your IDE can support this by only exposing the Windows 8 version of the API.

The CLR exists in the Metro environment, for use by .NET applications, complete with JIT (Just in time) compilation. However only a subset of the .NET Framework libraries are included. Microsoft aimed to include only what was necessary for Metro. I am not sure yet what is included and what is not, beyond the obvious (no Windows Forms, for example) but will be investigating what is documented. The native WinRT APIs look similar to a COM callable wrapper from the .NET side. That said, you do not normally need to care about WinRT interfaces, even though these are there in WinRT. Normally you interact with WinRT classes, making it more natural for .NET than working with COM.

WinRT is full of asynchronous calls. Lovell told us that Microsoft had seen in the past that if both synchronous and asynchronous APIs are available for the same function, then developers often use the synchronous version even when they should not, making applications less responsive. The new await keyword in C# makes this easy to code.

WinRT makes use of the ILDasm metadata format which is also used by .NET. This means you get rich metadata for IntelliSense and debugging, but note that the actual runtime is not .NET; they just borrowed the same metadata format.

WinRT objects are reference counted like COM for memory management, with weak references to avoid circularity. You should not have to worry about this; you can code according to the conventions of your language.

There are three ways to write WinRT applications. One is C++, in which case you write directly to the “projection” of WinRT into your language. The second is .NET, in which case your code goes via the CLR. The third is HTML and JavaScript, in which case your code goes via the “Chakra” JavaScript engine also used by Internet Explorer 9 and higher. Lovell assured me that there is little difference in performance in most cases, though there could be advantages for C++ in certain niche scenarios. Of course we heard that story for .NET as well, but from what I have seen it is more plausible in WinRT.

There is no message loop in WinRT. There is no GDI in WinRT. All graphics are via DirectX. XNA, the .NET games framework, is not supported. It seems that you will need to use C++ for fancy DirectX coding, though this is not confirmed. Of course your XAML or Canvas code will be rendered by DirectX under the covers.

It is fascinating to see how Microsoft has borrowed XAML and ILDasm from .NET, but that WinRT is native and not .NET at its core. My take on this is that Microsoft intended to preserve the productivity of .NET, but without any performance compromise.

Despite the inclusion of .NET though, the fact that only a subset of the Framework is available, and that interop to the Windows API will not work*, means that most existing apps will need considerable work to be ported to Metro.

*Updates

A few clarifications.

It has been shown that you can call WinRT from Win32 (the favoured word for Win32 seems to be “desktop applications”) though I’m not sure how useful it is.

Concerning P/Invoke (Platform Invocation) to Win32 APIs, apparently this does work for a certain specified, small subset of the Windows API. It also works for your own native code DLL, with the proviso that if your native code DLL calls a disallowed Win32 API it will raise an error.

WinRT is partially extensible. A Framework Extension is a library which you can reference as a dependency in your app’s manifest. When the app is deployed it will download this dependency from the Windows Store. An example is the C Runtime Library. An extension library installs into its own directory, and can be used by multiple WinRT apps provided each one also references it in their manifests. However, the caveat is that only Microsoft can create these extensions: there is no way to create your own shared extension for general distribution, though an enterprise can deploy a shared extension internally.

Building Windows – when Microsoft shows its hand

I’m in Anaheim, California on the eve of Microsoft’s BUILD conference. I have heard the phrase “wait until BUILD” so many times from Microsoft over the last few months that it has given this conference a special flavour. After Wednesday, the company will have to think of another way to avoid awkward questions like what is happening to Silverlight.

This is the latest chapter in the progression of Windows, server client and mobile. In particular, I will be trying to understand Microsoft’s software development platform. Whatever it looks like, it will be diverse, and include native code, HTML and JavaScript, .NET code including Silverlight, and perhaps some new hybrid. What will be the pros and cons of each approach, how do developers create apps that span desktop, tablet and mobile, and how will the delivery model change in the app store era?

Interesting questions; but the other theme is about how effectively Microsoft will compete versus its competition as the importance of desktop Windows shrinks. Cloud, mobile and tablet are the themes here, and after many mis-steps time is running out.

Not much to add except “watch this space” over the next few days; though I would be interested in any specific comments or questions on Microsoft’s strategy.

Windows Live Messenger error message hell

Recently I tried to sign into Live Messenger on Windows 7, only to be informed of what appears to be a temporary interruption in service.

image

Show details, by the way, shows Error code: 80040154

I retried and got the same message, so I clicked the Get more information link, which took me here:

image

The help document says that the solution is to reinstall Windows Live Essentials. I confirmed this, not by reinstalling (yet), but by trying Live Messenger on another machine, where I could sign into the same account successfully.

A few observations about this:

  • The error message is incorrect, since the error is apparently on the client whereas the message states it is a temporary problem with the service.
  • Microsoft’s engineers know that the error message is incorrect, since the help document references both the message and the solution.
  • The error message has been incorrect for years, since it applies to both Windows Live Messenger 2009 and 2011.
  • The misleading error message is particularly annoying, since if the user wants to use Live Messenger urgently they may well wait as advised by the message, not realising that the problem can be fixed immediately.
  • The solution is a brute-force one that involves many other applications, including Live Mail and Live Writer (on which I am typing this post). Or is it enough just to reinstall Messenger? The message suggests not. However if you use Live Mail for all your email, you probably want to know whether the uninstall will delete all your email and contacts or not. The referenced article on uninstalling Live Essentials does not say.

How could Microsoft improve this? At risk of stating the obvious:

  • Give an accurate error message.
  • Give a solution which targets the exact problem rather than relying on an uninstall/reinstall procedure that changes many things that are working fine.
  • If this is impossible, at least advise the user in one place concerning their obvious questions, such as “what happens to my stuff”.

Update: I found the cause of this problem. A developer tool beta had overwritten my system path with its own, breaking this among other things. I do not blame any application for breaking in these circumstances. I fixed the Live Messenger problem by performing a Repair on Live Essentials – less risky than uninstall/reinstall, and in this case sufficient.

Another idea if you have this kind of problem is System Restore.

Nevertheless, the error message could do with some work!