Category Archives: visual studio

Microsoft playing HTML 5 standards game alongside Silverlight game

I’m at Mix10 in Las Vegas where Microsoft has been showing off the latest preview of IE9 – you can try it here, provided you have Vista SP2, Windows 2008 or Windows 7.

The two themes are performance, with GPU-accelerated HTML and graphics and a new Javascript engine that compiles code in the background, and standards support. This latter was not a surprise to me, as I’d heard the well-informed Molly Holzschlag praise Microsoft’s commitment to HTML5 at a workshop here on Sunday – see this earlier post.

During the keynote, we saw IE9 playing a video using the HTML 5 video tag – no Flash or Silverlight needed. Microsoft also showed that in this instance IE9 performed better than Chrome thanks to better hardware acceleration. Although one should always mistrust one vendor’s demonstration of another vendor’s product, it should not be surprising that Microsoft is able to deliver a browser that is better optimised for Windows.

Video, hardware accelerated graphics, audio element support, fast JavaScript: there is considerable overlap with the features of the Microsoft Silverlight (and Adobe Flash) plug-ins.

The plug-in approach has advantages. It offers consistency across browsers, and enables rapid evolution without the hassles of standards committees. The multimedia features in Silverlight and Flash are well ahead of those in HTML 5 – Holzschlag nailed this when she described today’s HTML 5 demos as reminiscent of Flash demos a decade ago.

Still, if you can do without the plug-in you end up with cleaner code, removing the awkward transition between what is in HTML and JavaScript, and what is in the plug-in. There is also a better chance that your code will run on Apple’s iPhone and iPad, for example.

The question though: can Microsoft do an equally good job of supporting HTML 5 throughout its platform, as it will do with Silverlight? This is where I’m doubtful. The Visual Studio and Expression tools will continue to drive developers towards Silverlight rather than HTML 5.

It’s notable that shortly after Microsoft’s IE9 demos at Mix, we saw demos of fun technology like code-name Houston, develop databases in the cloud using just your browser and … Silverlight.

Microsoft .NET gotchas revealed by Visual Studio team

The Visual Studio Blog makes great reading for .NET developers, and not only because of the product it describes. Visual Studio 2010 is one of the few Microsoft products that has made a transition from native C++ code to .NET managed code – the transition is partial, in that parts of Visual Studio remain in native code, but this is true of the shell and the editor, two of the core components. Visual Studio is also a complex application, and one that is extensible by third parties. Overall the development team stressed the .NET platform, which is good for the rest of us because the developers are in a strong position both to understand problems, and to get them fixed even if it means changes to the .NET Framework.

Two recent posts interested me. One is Marshal.ReleaseComObject Considered Dangerous. I have some familiarity with this obscure-sounding topic, thanks to work on embedding Internet Explorer components. It relates to a fundamental feature of .NET: the ability to interact with the older COM component model, which is still widely used. In fact, Microsoft still uses COM for new Windows 7 APIs; but I digress. A strong feature of .NET from its first release is that it can easily consume COM objects, and also expose .NET objects to COM.

The .NET platform manages memory using garbage collection, where the runtime detects objects that are no longer referenced by active code and deletes them. COM on the other hand uses reference counting, maintaining a count of the number of references to an object and deleting the object when it reaches zero.

Visual Studio 2008 and earlier has lots of COM APIs. Some of these were called from .NET code, and for the same of efficiency called the method mentioned above, Marshal.ReleaseComObject, to reduce the reference count immediately so that the COM object would be deleted.

Now here comes Visual Studio 2010, and some of those COM APIs are re-implemented as .NET code. For compatibility with existing code, the new .NET code is also exposed as a COM API. Some of that existing code is actually .NET code which wraps the COM API as .NET code. Yes, we have .NET to COM to .NET, a double wrapper. Everything still works though, until you call Marshal.ReleaseComObject on the doubly-wrapped object. At this point the .NET runtime throws up its hands and says it cannot decrement the reference count, because it isn’t really a COM object. Oops.

The post goes on to observe that Marshal.ReleaseComObject is dangerous in any cause, because it leaves you with an invalid .NET wrapper. This means you should only call it when the .NET instance is definitely not going to be used again. Obvious, really.

Once you’ve digested that, try this illuminating post on WPF in Visual Studio 2010 – Part 2 : Performance tuning. WPF, or Windows Presentation Foundation, is the .NET API for rich graphical user interfaces on desktop Windows applications. Here is an example of why you should read the post, if you work with WPF. Many of us frequently use Remote Desktop to run applications on remote PCs or PCs that do not have a screen and keyboard attached. This is really a bad scenario for WPF, which is designed to take advantage of local accelerated graphics. Here’s the key statement:

Over a remote desktop connection, all WPF content is rendered as a bitmap. This is in contrast to GDI rendering, where primitives such as rectangles and text are sent over the wire for reconstruction on the client.

It’s a bad scenario, but mitigated if you use graphics that are amenable to compression, like solid colours. There are also some tweaks introduced in WPF 4.0, like the ability to scroll an area on the remote client, which saves having to re-send the entire bitmap if it has moved.

Mono Tools for Visual Studio: code on Windows, run on Linux

I have just com across Mono Tools, a Novell add-in for Visual Studio that lets you test Mono compatibility. It adds a Mono menu which has options to run locally or remotely in Mono, analyze for compatibility issues, and create deployment packages. No sign of Mac support, which is a missed opportunity, but understandable given that Novell owns SUSE Linux.

For those few still unfamiliar with Mono, it is an open source implementation of Microsoft’s .NET Framework, enabling your .NET applications to run on other platforms. One compelling use is to have your ASP.NET web applications run on the free Apache web server, rather than Microsoft’s IIS.

image

Mono Tools works with both Windows Forms and web projects.

image

This is just the sort of thing Mono needs to move it further into the mainstream, though another less welcome sign of business acceptance is that this is a commercial product, currently costing $99.00 for an individual or $249.00 per seat in an organization. There is also an Ultimate edition at $2,499, which comes with a commercial non-LGPL license to redistribute Mono.

The Mono Tools team is now looking for testers for its 1.1 edition, which supports Visual Studio 2010.

Visual Studio 2010 testers unhappy with help

Visual Studio 2010 comes with a brand new help system, based on a local help server rather than a database plus viewer as in the past. There is also an option to use Internet-based help for the most up to date content.

Sounds good, but developers are not happy. The problem: the new help appears to have no index of contents. You are meant to navigate by search, then perhaps navigate forward and back using the table of contents tree that appears on the left.

image

In the old one, you could use the index to find keywords quickly:

image

It turns out that many users prefer the old approach:

This is terrible. Productivity will go to zero without an index. Online help is junk, even on a fast connection — it can never be as fast as my local PC and when I am programming, I need instant answers.

says one commenter.

Microsoft says:

We realize the importance of delivering a keyword index, but we were unable to deliver it in our first release. In this V1.0 release of help system, we first implemented an improved search capability in order to deliver a more familiar, consistent online and offline experience. We then implemented a keyword index feature based on our search catalog. Unfortunately, the results did not meet our quality bar and we determined that this feature would require more work than the Beta 2 timeline allowed. We are looking at implementing it for at future release.

The odd thing is, there is a third-party viewer called H3Viewer which was apparently put together in a short time using Delphi and the new APIs. It turns out that Visual Studio’s Help is actually an early example of a new Windows Help System called Help 3, and is designed with a comprehensive API for developers. If you set the default help viewer in Visual Studio 2010 to H3Viewer, it works more like the old one, complete with index:

image

I can’t actually recommend H3Viewer in the current  beta. It takes ages to read 440,000 index entries every time you start it up and view the index pane – a message notes that “a late fix in the RC release has slowed down the reading of index items dramatically”. In addition, it does not cope well if you set your help preference to online. Still, H3Viewer will likely improve.

Speaking personally, I don’t mind the idea of search-based help, provided that the search works really well. In practice, it is often easier to Google for what you want to know, bypassing the official help completely, though that may mean getting to the same place by another route. Nevertheless, a reliable online reference is important and it seems that a lot of developers do in fact use the local index.

Visual Studio 2010 RC arrives with go-live license

Microsoft has made the Release Candidate of Visual Studio 2010 available for download to MSDN subscribers. From tomorrow (10th February) the same release will be available to everyone. There is a go-live license so you can use this in production if you wish, though if the full release comes in April as planned, it hardly seems worth it in most scenarios.

What’s new since the beta? Jason Zander says mainly performance. Note that the Chief Architect of Visual Studio is Rico Mariani, formerly Microsoft’s .NET performance guru, which is encouraging in this respect.

The blow-by-blow account of issues with the RC is here.

Whatever your views on the direction and future of Microsoft’s platform, there’s no doubting the huge scope of this release, though in my view the company has not communicated this particularly well, saying too much about things like SharePoint development, top of its list of walkthroughs but still an ugly business, and not enough about features such as IntelliTrace debugging, or the new ability to float windows out of the IDE and onto a second display, which will have a more immediate impact on developers. Note that the Visual Studio IDE has been re-built using WPF (Windows Presentation Foundation), and that it comes with a the first completely new version of the .NET Framework since 2005.

Silverlight 4.0 is another area of interest, though I understand that it will not be complete in time for this release. Visual Studio 2010 will have Silverlight 3.0 out of the box, with the ability to install the 4.0 preview release and eventually the final release as an add-on. I’ve also heard that Silverlight 4.0 is not yet supported at all in the RC, so be cautious if this is your area of work – you may need to stick with the last beta for the moment.

New is not always better, of course. I’m interested in hearing from developers working with Visual Studio 2010 – whether performance and stability issues have been overcome, and what you think of it overall.

What’s new in Visual Studio 2010 – more than you may realise

I’m beginning to think Microsoft has under-sold Visual Studio 2010. Of course it is a huge product, as I observed back in October, especially since it includes a major new release of the .NET Framework as well as updated tools, but I thought I had discovered most of the significant new features. Still, when I sat down recently to write up an extended review, I found a lot that I had missed.

One of my reflections on this is that Microsoft has done of poor job of communicating what is new. I attended the Professional Developer’s Conference in 2008 and 2009. The developer-focused keynote on the second day last November should have hyped the best of what is new; but instead we got Steven Sinofsky on Windows 7 quality control – hardly the most exciting of topics – a sneak preview of IE 9, an unconvincing tour of Sharepoint and Office 2010, and Scott Guthrie on Silverlight 4. Guthrie was fantastic, leading us blow by blow through Silverlight’s new capabilities, but much else was neglected.

It doesn’t help that Microsoft’s home page for Visual Studio 2010 has meaningless headlines. “Set your ideas free”, “Simplicity through integration”, “Quality tools help ensure quality results.” Pure fluff, which saps your will to read further.

Here are a few things that I found interesting – nothing like comprehensive, just features that perhaps have not had the attention they deserve.

Microsoft F# – a new language from Microsoft Research, integrated into Visual Studio with remarkable speed. The people I’ve spoken to who have taken the time to discover what it does are truly enthusiastic. Some of its strengths are parallelism, asynchronous programming, graphics manipulations, and maths. You probably won’t write a complete application in F#, but it will be great for assembling libraries.

Windows Workflow Foundation 4.0 – potentially a new and effective approach to visual programming and long-running state management. Flow charts are often used to teach programming, since they express common concepts like if conditions visually. WF lets you draw a process as a flow chart – or there are other types of chart – using the nice new WPF design tools, and then execute it in the runtime, which is part of the “Dublin” extensions to IIS, now known as Windows Server AppFabric (I have no clue why this confusing name was chosen). To get the idea, I suggest reading David Chappell’s Workflow Way. For applications that fit this kind of model, it is a compelling approach, and integrates well with Windows Communication Foundation for messaging.

Dotfuscator – I know this is a third-party thing, but this is no longer just a tool for obscuring your .NET assemblies in the hope of preventing decompilation. The new Dotfuscator does runtime analytics, and can report back to a portal when your application runs, what features you use, what operating system it is on, whether it crashed, and so on. It also supports application expiry, known as “shelf life”, and can detect if assemblies have been tampered with. Some of this sails close to the spyware wind, but this is a matter of getting informed user consent. These are interesting features for Windows desktop developers, if there are any left, and even the free edition is quite capable.

Test and Lab management – a challenge to set up and configure, but when it works, amazing. Lab Management uses Visual Studio, Hyper-V and System Center Virtual Machine Manager to automate deploying an application over one or more VMs, so you can run tests against it. This hooks into Team System so you can file a bug report with a link that actually shows the bug happening at runtime, with a snapshot of the virtual environment.

Step backwards through code – IntelliTrace is a new feature of the Visual Studio debugger. Configure it to collect IntelliTrace events and call information, and you can then step backwards as well as forwards from a breakpoint, examining variable values as they change.

Team Foundation Server Basic – what this means is that even a solo Visual Studio developer can have TFS running locally or on a networked machine for source code management, issue tracking and so on. It’s worth considering because of the way it integrates with the IDE. I admit, I still like Subversion which I have on a remotely hosted server, since it acts as an effective off-site backup, but I’d much rather use TFS Basic than nothing.

UML – Microsoft has finally done what it should have done years ago, and implemented a wide range of up-to-date UML diagram tools. Nothing revolutionary, just useful.

Not everything is wonderful in the new Visual Studio. Deploying to Azure remains clunky in Beta 2 – when is this going to get better? SharePoint is another one; I appreciate the value of F5 debugging, but you still need SharePoint installed locally, with great potential for mucking up IIS, and the whole thing feels unwieldy.

A year of blogging: another crazy year in tech

At this time of year I allow myself a little introspection. Why do I write this blog? In part because I enjoy it; in part because it lets me write what I want to write, rather than what someone will commission; in part because I need to be visible on the Internet as an individual, not just as an author writing for various publications; in part because I highly value the feedback I get here.

Running a blog has its frustrations. Adding content here has to take a back seat to paying work at times. I also realise that the site is desperately in need of redesign; I’ve played around with some tweaks in an offline version but I’m cautious about making changes because the current format just about works and I don’t want to make it worse. I am a writer and developer, but not a designer.

One company actually offered to redesign the blog for me, but I held back for fear that a sense of obligation would prevent me from writing objectively. That said, I have considered doing something like Adobe’s Serge Jespers and offering a prize for a redesign; if you would like to supply such a prize, in return for a little publicity, let me know. One of my goals is to make use of WordPress widgets to add more interactivity and a degree of future-proofing. I hope 2010 will be the year of a new-look ITWriitng.com.

So what are you reading? Looking at the stats for the year proves something I was already aware of: that the most-read posts are not news stories but how-to articles that solve common problems. The readers are not subscribers, but individuals searching for a solution to their problem. For the record, the top five in order:

Annoying Word 2007 problem- can’t select text – when Office breaks

Cannot open the Outlook window – what sort of error message is that? – when Office breaks again

Visual Studio 6 on Vista – VB 6 just won’t die

Why Outlook 2007 is slow- Microsoft’s official answer – when Office frustrates

Outlook 2007 is slow, RSS broken – when Office still frustrates

The most popular news posts on ITWriting.com:

London Stock Exchange migrating from .NET to Oracle/UNIX platform -  case study becomes PR disaster

Parallel Programming: five reasons for caution. Reflections from Intel’s Parallel Studio briefing – a contrarian view

Apple Snow Leopard and Exchange- the real story – hyped new feature disappoints

Software development trends in emerging markets – are they what you expect?

QCon London 2009 – the best developer conference in the UK

and a few others that I’d like to highlight:

The end of Sun’s bold open source experiment – Sun is taken over by Oracle, though the deal has been subject to long delays thanks to EU scrutiny

Is Silverlight the problem with ITV Player- Microsoft, you have a problem – prophetic insofar as ITV later switched to Adobe Flash; it’s not as good as BBC iPlayer but it is better than before

Google Chrome OS – astonishing – a real first reaction written during the press briefing; my views have not changed much though many commentators don’t get its significance for some reason

Farewell to Personal Computer World- 30 years of personal computing – worth reading the comments if you have any affection for this gone-but-not-forgotten publication

Is high-resolution audio (like SACD) audibly better than than CD – still a question that fascinates me

When the unthinkable happens: Microsoft/Danger loses customer data – as a company Microsoft is not entirely dysfunctional but for some parts there is no better word

Adobe’s chameleon Flash shows its enterprise colours – some interesting comments on this Flash for the Enterprise story

Silverlight 4 ticks all the boxes, questions remain – in 2010 we should get some idea of Silverlight’s significance, now that Microsoft has fixed the most pressing technical issues

and finally HAPPY NEW YEAR

PDC day one: Windows in the cloud

Today was cloud day at PDC. Microsoft announced that Windows Azure will become a production platform on January 1st, with billing starting from February 1st. It also announced the beta of Windows Server AppFabric role, for on-premise apps that can either stay on-premise or be deployed to Azure later; and some new developments like the Windows Server Virtual Machine role on Azure, a pre-configured Windows Server VM into which you will be able to deploy an application.

Azure was first announced at the 2008 PDC, and had a stuttering start, with a CTP (Community Tech Preview) that was difficult to use, major changes to SQL Server Data Services – a simplified cloud database that was scrapped and replaced with full SQL Server – and generally poor marketing from Microsoft. I was not sure whether the company was serious about Azure, or merely trying to tick the cloud box.

I do now think it is serious, and delivering some interesting technology for easily scalable cloud-hosted applications. Microsoft does not sees its cloud services as replacing your in-house servers (no surprise there), but more as a way of deploying certain kinds of web applications. A great feature is that thanks to Active Directory Federation Services in combination with the new .NET library called Windows Identity Foundation you can relatively easily have use your Azure applications authenticated against your internal Active Directory.

The surprise of the day was when Matt Mullenweg of WordPress fame turned up to demo WordPress running on Azure, which now supports PHP and MySQL as well as Java applications. Another unexpected guest was Loic Le Meur of Seesmic, who introduced Seesmic for Windows and also talked about a coming Silverlight version.

That said, the keynote did not exactly crackle with excitement. Microsoft seemed almost to downplay what is now possible with Azure, perhaps sensing that it could be disruptive to its own business model. A telling moment came during a press briefing when Doug Hauger, Azure General Manager, denied that Windows or Office were in any sort of decline. Despite his position he seems to be under the illusion that we will happily continue with our fragile on-premise, single platform, micro-managed IT systems.

I enjoyed the day though. The beauty of PDC is that Microsoft rolls out its best speakers; it was great to hear Mark Russinovich explain the kernel changes in Windows 7 and Server 2008 R2 – same kernel of course – and I will be writing more about the session shortly.

I’m expecting more focus on Office, Silverlight and Visual Studio tomorrow, when Steven Sinofsky, Scott Guthrie and Kurt DelBene will be giving the keynote, and hoping for some compelling announcements.

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.