Windows Clippings 2.0

Wed, May 30, 2007, 10:30 AM under Links
Kenny Kerr has released Window Clippings v2.0. Read his announcement here. There is still a free version with all the important features and an advanced version for a truly modest price. Not only I downloaded it, but I paid for the extras as well. If nothing else, I encourage you check it out especially if you regularly do screen captures on Vista!

NET CF Beta 1 – what is new

Sun, May 27, 2007, 08:43 AM under MobileAndEmbedded
With Orcas Beta 1 you also get NETCF Beta 1 with a build number of 7066. The last public NETCF drop was in the January CTP (and remained unchanged in the March CTP) with a build number of 6282. I documented what was new in that build of v3.5 compared to v2.0 and added a couple more later. Those new APIs are all still in build 7066 and in addition we also get the ones below:

* System.Delegate gets a new CreateDelegate static method and the two associated properties: Method and Target.

* There are new types in the System.Security.Cryptography (in mscorlib): AsymmetricKeyExchangeDeformatter (and the Formatter) and RSAPKCS1KeyExchangeFormatter (and the Deformatter).

* X509 in System.dll: X509Store, X509CertificateCollection, ClientCertificates property on System.Net.HttpWebRequest and 4 enums in System.Security.Cryptography.X509Certificates (OpenFlags, StoreLocation, StoreName, X509FindType).

* DataGridCell was moved from system.windows.forms.datagrid.dll to system.windows.forms.dll

In addition to the list above (inc. the ones from my links above), I previously mentioned the headline NET CF features. Well, finally in this Beta 1 drop you can play with those! The LINQ implementation in System.Core.dll is now compatible with the desktop naming and we also get the LINQ to XML implementation in System.Xml.Linq. The Compact WCF implementation resides in the new assemblies System.ServiceModel.dll (dependencies of which include the new System.Runtime.Serialization.dll) and Microsoft.ServiceModel.Channels.Mail.dll. For a "Hello World" example, check out Mark's two blog posts.

If at this point you are ready to play with this stuff, then first visit this download page for two reasons:
1. It includes some additional new features that are not visible at the public API level that I describe in my posts.
2. If you proceed with the download you will actually be able to compile projects referencing the Compact WCF assemblies. Simply remove your existing "Microsoft .Net Compact Framework 3.5 Pre-Release" and install the download (same build number as above, but with correctly signed assemblies).

PDC postponed?

Thu, May 24, 2007, 06:19 PM under Links
Remember when the news broke about PDC07? Go back to my blog post and follow the link again (and weep).

Client Application Services in "Orcas"

Thu, May 24, 2007, 12:39 PM under dotNET | Orcas
I've had on my TOPLAY list to discover what the "Services" tab is for in the project properties for Orcas client projects. If you don't have Orcas installed and are wondering what's behind the "Advanced" button on that screenshot, it looks like this:


It turns out it is for a new feature, which you can read all about on MSDN, which we are calling "Client Application Services". This will be useful to you if in your smart client applications you want to authenticate users (inc. maintaining different roles and profiles) against a central web store (e.g. with webservices etc) including the ability to work offline once the user settings have been retrieved. It is particularly useful if you are using that central web store already for existing web applications because, as you may have guessed, it leverages the same ASP.NET 2.0 services for authentication, authorisation and personalisation.

The claim is that this Orcas feature makes it "trivial" to create the services on the server-side and to then consume them from the client-side. To see if this claim holds true for you, why not check out the walkthrough by Brad over here, inspired apparently from this one over here (both links include project downloads).

There is also an old webcast on the topic here (you can download the wmv), and I would suggest you skip the first 21 minutes of slides and go straight to the 30' demo.

go URLs at Microsoft

Tue, May 22, 2007, 06:24 AM under Random
Have you noticed on various Microsoft web sites and newsletters the use of go.microsoft.com URLs that redirect to the real URL where the content lives? They have always bugged me. Let's look at an example by examining the following two snippets:
"If you are a developer interested in Vista, Orcas and mobile development you'll find that this blog rocks!"
" If you are a developer interested in Vista, Orcas and mobile development you'll find that this blog rocks!"
The two extracts above look identical, and following the links takes you to the same place. However, the 1st shows the real URL, while the 2nd takes you somewhere else and then redirects you. Most people I know (inc. me) hover over a URL before clicking on it. That is because when you mouseover a link, the destination usually appears in the statusbar or a tooltip so you can preview the URL you are about to visit. So, in the case above, maybe I would not click on it because I have already been to that destination and I don't want to waste my time (or maybe I already subscribe etc). Using a go.microsoft.com/?linkid=abcdefg hides that from me. Also if I am offline, I can still get the real URL and potentially add it to a list of places to visit, but I am unlikely to do that with a go URL. While that is my view, recently I heard someone also complain about the go URLs. They were taking it a bit far by saying they were finding these URLs "suspicious". Without commenting here on the comment per se, the net effect is they also don't like them.

So I asked around about the usage of these URLs and the reply confirmed my presumption on why we use these: statistics. That is how we measure what links people follow. There are backend tools that measure the total traffic to a URL, but how can you know where those clicks are coming from, especially when they will originate from someone's email client (in the case of newsletters such as the flash)? I am not a web guy so I cannot see an immediate alternative. Unless/until someone comes up with a better solution, we'll just have to live with this necessary evil I guess...

Import namespace in VB9

Sun, May 20, 2007, 02:10 PM under Orcas | VisualStudio
A cute Whidbey feature in the C# 2.0 editor is that when you type in a Type that is not in scope, the IDE will let you choose to automatically either fully qualify the type or to add the appropriate using statement at the top. The editor for the VB8 experience is not that great, as shown by the following side-by-side screenshot:

BTW, for my C# readers, that is not a mistake, VB does allow partial naming of namespaces so since System is in scope, you can simply type Threading.Thread and it is acceptable. A bad habit IMO, I suggest as a guideline that you fully qualify the types starting at the root namespace.

Recently I was typing some VB9 code in "Orcas" and observed that the VB editor has caught up with the C# behaviour (plus it follows my guideline of the previous paragraph), as shown by the following screenshot:

Nice! And just like any other IDE language feature, it is not just for the latest version, but for the previous version as well (thanks to multitargeting).

System.Data.Linq.dll

Sat, May 19, 2007, 06:19 AM under dotNET | Orcas | LINQ
One of the green bit assemblies in .NET Framework 3.5 is System.Data.Linq.dll. As you may have guessed, this assembly contains the framework implementation for LINQ to SQL. Regular readers will know about my other multiple LINQ posts, but I have never posted about LINQ to SQL (formerly known as DLinq).

So, if you are interested in DLINQ, stay tuned on a series of posts that ScottGu has started here. For a detailed LINQ to SQL tutorial series of videos, check out the output from our local nugget machine (aka MikeT). I have captured here the direct links to the WMVs for the 18 screencasts: Intro, DataContext, Mapping, Tools, Inserting Data, Deleting Data, Updates, Concurrency, Joins, NULLs, Deferred Query Execution, Deferred Loading, Stored Procedures (querying), Stored Procedures (updates), Standard Functions, Custom Functions, Inheritance, Transactions.

More SideShow devices

Sat, May 19, 2007, 03:40 AM under SideShow | Links
It looks like Dan's pit of cool toys is truly bottomless! If you thought the video from CES had a cool collection of SideShow devices, then check out this video from WinHEC.

DevDays 2007 in Netherlands

Thu, May 17, 2007, 04:48 PM under Events
In June 13-14 a popular international developer event in Amsterdam takes place: DevDays.

I have no idea what the conference site says because it is in Dutch, even though the sessions will be in English. Well, they better expect them to be in English because I am doing 3 sessions there and apart from English the only other language I can speak well is Greek :)

The English abstracts for my sessions are:

Two part session (1 & 2) – Windows Vista for Managed Developers: Besides .NET Framework 3.0/3.5
Windows Vista brings with it a fantastic platform for managed development, namely .NET Framework v3 (i.e. WPF, WCF, WF and CardSpace). However, there are many new native APIs (obviously not part of the .NET Framework) in Windows Vista. In this 2-part talk you will discover how you (a C# or Visual Basic developer using Visual Studio 2005 or Visual Studio codename "Orcas") can take advantage of this new functionality. This demo-driven session, will teach you how to make your application feel like a real extension to the Windows Vista platform (and not like a ported application that just runs on it). Vista-only features covered include extending glass into your own applications, the new TaskDialog and CommonOpenDialog, Windows Error Reporting enhancements, Restart API, Recovery APIs, Restart Manager, building power-aware apps, writing preview handlers, conforming to User Account Control (UAC), using search from your application, Sidebar gadgets, SideShow plus more.

Session 3 – Realizing the Potential of the Windows Mobile Managed APIs
Successful mobile applications are designed for mobile users. We will take a comprehensive look at the managed APIs of the Windows Mobile platform for richly interacting with core device features such as Outlook Mobile and learn how to create smart applications with the State and Notification broker. Come see how developer tasks previously requiring lengthy C++ are now achieved with two lines of managed code! Through Visual Studio 2005 (or Visual Studio codename "Orcas"), we will demonstrate using the camera to capture pictures and video, the interception and processing of SMS messages, placing phone calls, dealing with system level events, programmatically sending e-mail and SMS messages, and provisioning devices with XML to name but a few! These APIs are not part of the .NET Compact Framework. They apply equally to Windows Mobile 5.0 and Windows Mobile 6. I will highlight what is new in WM6 in this area as appropriate.

Register here.

Winforms 1 - WPF 0

Wed, May 16, 2007, 09:11 PM under dotNET | Windows | Vista | Orcas
Oh, how happy I was when Orcas started using the Vista CommonFileDialog. Oh, how pissed off I get when applications on Vista still use the old legacy dialog. One of the applications I use a lot is Reflector and for a while I've been nagging Lutz on IM and email to make Reflector use the new OpenFileDialog, but nothing came of my harassment. Until recently when I noticed that Reflector indeed started showing me the new dialog so I thanked Lutz for finally listening. His reply was that he wasn't aware of it and he had changed nothing other than it now forces it to run against 2.0.50727 using a config file. That put me on a hunt!

The result of the hunt was that with the "Orcas" update of v2.0.50727 (remember how I explained this a few hours ago) the System.Windows.Forms.OpenFileDialog has had an internal implementation change that makes it detect if it is on Vista and puts the correct dialog up, rather than the legacy one (on a legacy OS like XP, it will show the old dialog of course). Using reflector, the place to look is FileDialog.RunDialogVista called by FileDialog.RunDialog which is called by CommonDialog.ShowDialog. Great news!

So I then wanted to see if the WPF version has also been updated, in which case half of VistaBridge would be obsolete (the TaskDialog half would still be useful of course). Unfortunately, the WPF version of OpenFileDialog (residing in Microsoft.Win32 namespace in the PresentationFramework.dll) has not been updated. I am confident that it will happen by RTM, but in the meantime from your WPF projects you can reference the System.Windows.Forms.dll and use its Open/SaveFileDialog instead.