Category Archives: .net

Microsoft’s Visual Studio and Team Foundation Server get Git integration

Microsoft has announced Git integration in both the Visual Studio IDE and the Team Foundation Service hosted source code management system. According to Technical Fellow Brian Harry:

1. Team Foundation Server will host Git repositories – and more concretely, Team Foundation Service has support for hosting Git repositories starting today.

2. Visual Studio will have Git support – and concretely, we released a CTP of a VSIX plugin for the Visual Studio 2012 Update 2 CTP today.

Git is an open source version control system originally designed by Linus Torvalds to support the development of the Linux operating system. It is a distributed version control system, which means every working directory is itself a full repository, enabling easy forking and offline work.

Team Foundation Service is a version of Team Foundation Server hosted by Microsoft.

Git integration was also recently added to Perforce, another version control system, in the form of the Perforce Git Fusion add-in, emphasising the fact that Git is now a mainstream, enterprise revision control system.

Java software quality: frameworks good, Struts or C++ bad says report

CAST has released an intriguing report on Java applications and software quality.

The company analysed 497 applications, comprising 152 million lines of code across 88 organisations and six global industries. It then looked at how software quality correlated with frameworks used.

◾Hibernate has the highest quality scores.
◾Applications built with Struts have the lowest quality scores.
◾Applications that did not use any framework had a huge variance in quality, which indicates that frameworks do in fact help develop applications of predictable quality.

A further investigation looked at what happens to software quality in mixed language applications:

◾Applications built in pure JEE, with no frameworks or multi-lingual mingling, had the highest quality scores.
◾Mixing Java with C or C++ lowers quality scores.
◾Mixing Java with COBOL, Java-DB, and Microsoft .NET delivered higher quality scores.

Frameworks are good but pure J2EE is better? Mixing with C/C++ lowers software quality, but mixing with .NET or COBOL raises software quality? These are odd results, and I wonder if this research is correlating the right factors. Here is a clue:

One common challenge for developers with framework usage is configuring them correctly. CAST data shows that a large majority of applications analyzed had some level of misconfiguration, indicating the need for better training or to simplify the use of frameworks.

I have a hunch that what this research really tells us is that the most competent developers deliver the highest quality code. Maybe the smartest developers do not use Struts.

Microsoft updates .NET Framework 4.5 for Windows 8, Server 2012 to fix performance, bugs

Microsoft has released an update for .NET Framework 4.5 which you may have noticed flying past if you keep an eye on Windows Update in Windows 8. The update is described here, and it is a big one. For example, in the Network Class Library:

Assume that you run a .NET Framework 4.5-based application that uses asynchronous APIs to read chunked responses. In this situation, the chunked responses may be read synchronously.

The HttpWebRequest class lets callers read an HTTP response either synchronously or asynchronously. However, if the response is a chunked HTTP response, then parts of the response are read by using synchronous I/O (Winsock calls) even when the caller uses the asynchronous code path. In this situation, the calling thread is blocked until data is received on the network.

Given this and other issues, the update is highly recommended. Maybe we will see fewer pauses in Windows App Store apps, some of which have not delivered on the “fast and fluid” promise.

Google the new Microsoft, goes to war on Windows Phone users (updated)

Google has fired a one – two – three salvo at Microsoft and Windows Phone users. Consider the following.

First, we learn that Google, under the guise of Winter cleaning, is removing Google Sync from its Mail, Calendar and Contacts online products, for consumers only. This is the Exchange ActiveSync protocol used by Windows Phone and other mobile devices:

Starting January 30, 2013, consumers won’t be able to set up new devices using Google Sync; however, existing Google Sync connections will continue to function

Next, Microsoft reveals that Google is blocking the creation of a YouTube app for Windows Phone:

Microsoft is ready to release a high quality YouTube app for Windows Phone. We just need permission to access YouTube in the way that other phones already do, permission Google has refused to provide.

Now Google is blocking Windows Phone users from accessing Google Maps in the mobile browser. Google says:

The mobile web version of Google Maps is optimized for WebKit browsers such as Chrome and Safari. However, since Internet Explorer is not a WebKit browser, Windows Phone devices are not able to access Google Maps for the mobile web.

but Microsoft observes that Google Maps works fine in IE on Windows and:

Internet Explorer in Windows Phone 8 and Windows 8 use the same rendering engine.

This last is of most concern. It is one thing to “optimize” for WebKit, another specifically to block non-WebKit browsers. If WebKit is in Google’s eyes the de facto standard for mobile devices – which are more significant than desktop browsers – then what is the function of the W3C, and what is to prevent a repetition of the IE6 effect where one company (Microsoft) in controlled what was implemented for most users?

We can conclude that Google has decided its interests are better served by inconveniencing Windows Phone users in the hope of stifling the platform, rather than trying to persuade Windows Phone users to use its services as it does on Apple’s iOS platform (with considerable success).

Sympathy for Microsoft will be limited because of its history. The company has never been a friend of cross-platform support, preferring to keep its customers on Windows. That said, it is difficult to find exact analogies for what is happening now. Nor is it clear what is and is not reasonable. Google Mail, YouTube and Maps are all Google properties. Is it reasonable to expect Google to make the extra effort required to support additional platforms? It is a matter for debate with no easy and clear cut answer.

This does not mean you have to like it. If it is Windows Phone today, what platform might it be tomorrow? Google’s willingness to lock out users of other platforms is a warning, and one that should give pause for thought to any individual, business or government entity who depends or is considering depending on the Google platform. If history tells us anything, it is that monopoly and lock-in always works out badly for users. Check the price of inkjet cartridges for a simple example, or the price of Microsoft Office for business users for another.

What will be the effect on Windows Phone of Google’s campaign? That again is hard to judge. Microsoft is better off than RIM, for example, because it does have something like a complete stack of what it takes to be a mobile platform, especially in conjunction with Nokia: search, maps, email, web-based documents, cloud storage, music streaming and so on. That said, “doesn’t work properly with YouTube, Gmail, Google Maps” is hardly a selling point.

Update: Google now says:

We periodically test Google Maps compatibility with mobile browsers to make sure we deliver the best experience for those users.

In our last test, IE mobile still did not offer a good maps experience with no ability to pan or zoom and perform basic map functionality. As a result, we chose to continue to redirect IE mobile users to Google.com where they could at least make local searches. The Firefox mobile browser did offer a somewhat better user experience and that’s why there is no redirect for those users.

Recent improvements to IE mobile and Google Maps now deliver a better experience and we are currently working to remove the redirect. We will continue to test Google Maps compatibility with other mobile browsers to ensure the best possible experience for users.

Is Google being straight with us? Why has the statement changed overnight?

One user discovered that certain URLs work for Google maps on Windows Phone and posted a video to prove it.

The video shows Google Maps working on a Lumia 800 (not the latest version of Windows Phone). I tried this URL:

ms-gl=au&ie=UTF8&t=m&source=embed&oe=UTF8&msa=0&msid=202255975001106586432.0004bb17c01b36a71a644

on my own Lumia 800 and it does indeed work. You can search for places, they show up on the map, and you can zoom with the + and – controls. However, it is not perfect. The search box is slightly corrupted and I am unable to pinch to zoom or swipe to pan. Better than nothing? Certainly.

Still, the experience is sufficiently degraded to lend some credence to Google’s statements; and there is undoubtedly extra work in supporting additional browsers as any web developer will confirm. 

Is Google at war with Windows Phone, or just not going out of its way to support a rival platform? Watch this space.

Visual Studio LightSwitch HTML: mainly for mobile

Microsoft’s Visual Studio LightSwitch is an innovative development tool that lets you build multi-tier database applications without ever designing the user interface directly. Instead, you work with defining the database and the the features you want on your screens. LightSwitch generates the user interface for you. You can also add code snippets, and advanced developers can create custom controls and extensions.

The thinking behind LightSwitch was to make it easy for non-developers to create database applications, though it is not the most intuitive of tools and in reality it is developers looking for rapid application development who are most likely to use it. There is a lot to like in the way it is designed, like the data-first approach and the easy to use database designer, but this is spoilt by some odd decisions. One is that the LightSwitch team are seemingly averse to reference documentation, preferring to deliver various how-to walkthroughs, which is frustrating if you want to find out in detail how it is meant to work.

The initial release of LightSwitch, as well as the new edition in Visual Studio 2012, generates only a Silverlight client, making it useless for mobile devices and somewhat annoying on desktop PCs since you have to install the Silverlight runtime. Microsoft has addressed this by creating an HTML client update, which lets you generate an HTML user interface. This is now at Preview two, and I downloaded it to have a look.

Since LightSwitch generates the user interface from metadata, you might hope that the HTML version would let you take a project created for Silverlight, and simply generate a functionally equivalent HTML application instead. Even if some touching up was needed, such as rewriting C# snippets in JavaScript, this would be a nice option. However that is not the approach Microsoft has taken. It has added an option to create an HTML client for a LightSwitch project, but you have to redo all the screens. In addition, the HTML client is intended mainly for mobile, and is designed for touch control, as explained by Microsoft’s Joe Binder here:

We are not expanding the HTML client’s scenario target to include desktop in our first formal release.  The first release will be based exclusively on JQueryMobile and be optimized for building touch-oriented apps.  We’ll stay tuned to your feedback to sort out where/when we go after that, but we still have some issues to sort out for our mobile story and we’ll remained focused until we feel confident that we have a viable mobile offering.

Of course it is still HTML, and will run on modern desktop browsers, though the generated user interface uses JQuery Mobile extensively. Another of the issues here is that HTML 5 may be better supported on smartphones running WebKit-based browsers than on desktops such as Windows XP running Internet Explorer 8, creating problems for LightSwitch. It is also hard to create a user interface that is equally well suited to touch control as to keyboard/mouse interaction; this issue is a common complaint about Windows Store apps on Windows 8.

The HTML client is still interesting, more so than the original LightSwitch with its Silverlight web or desktop clients. Rapid database app development for mobile devices is an key area, as businesses work to enable their mobile users to access company data.

After installing the preview, I built a quick HTML client app, based on a contact database.

image

It did not take long to build a working application, though there are some puzzles. My first effort at creating a contact list only displayed the firstname of each record. Apparently that is the “summary” layout, and I cannot see any quick way to change the summary definition to something more useful. Instead, I changed it to a Rows Layout which shows all the fields, but lets you delete those which are not required. Then I added an Edit contact button, though it appears as plain text without even an underline to show that it is a hyperlink, and I cannot see quickly how to change this:

image

The button’s “Appearance” properties are not helpful:

image

I also found an annoyance that may be a bug. I created several new contacts via a Contact details form (the first illustration above). I saved each contact with the tick button, whereupon they appear in the contact list. However they are not yet really saved. To save the contact to the database, you have to execute the save action, which is a built-in button on the BrowseContacts form. When I tried to save, the phone number fields (defined as Phone Number fields) failed validation, even though they would be valid phone numbers in the UK, and the records were not saved. Fair enough I suppose, but why did they pass validation in the Contact Detail form?

I am sure there are easy fixes for all these niggles, but I mention them to illustrate the point about this not being the most intuitive of tools.

The general approach also takes some mental adjustment. Here is a tool that makes web apps, but you cannot use a web design tool to customise the user interface.

As a tool for building mobile web apps, LightSwitch does show promise and I look forward to the final release. That said, it would be good if Microsoft could adapt the HTML output so you can make it suitable for desktop browsers as well.

Xamarin brings C# to development of apps for the Mac App Store

Xamarin has released Xamarin Mac which adds Mac support to the existing iOS and Android compilers from the company:

  • MonoTouch: apps for iPhone and iPad using the MonoDevelop IDE on the Mac
  • Mono for Android: apps for Android using either Visual Studio or MonoDevelop
  • Xamarin.Mac: apps for Mac OS X using MonoDevelop on the Mac

The major platforms missing from the above are Windows and Linux (unless you count Android), even though Mono began as a Linux implementation of Microsoft’s .NET platform.

Xamarin says that a Windows version is not necessary since you can use Microsoft’s tools to code in C# for Windows desktop and Windows phone.

You can also get Mono for Windows, Mac and Linux from the old Mono project site.

Why would you bother with paid-for Xamarin.Mac when you can get Mono for Mac as a free download? There is even a Mac packager which lets you create a standalone package for your Mono app. A good question, but I guess the answer is the benefit of Xamarin-specific libraries and support from the company. Xamarin has also done the work to ensure that you can distribute your app via the Mac App Store.

Xamarin.Mac costs $399 for personal use, or $999 for an enterprise license which allows internal as well as app store distribution. A one year, one seat license with priority support costs $2,499.

Xamarin knows how to charge then, and in the end that may be a key reason why the project is working, whereas Mono struggled as an open source project that never had the resources it deserved.

The Mono Project site now says that it is “sponsored by Xamarin” so open source developers are getting some benefit from the commercial offshoot.

Xamarin is important for the C# language, since it represents a viable implementation which is independent of Microsoft.

Trial apps and in-app purchases easy to hack on Windows 8 says Nokia engineer

A principal engineer at Nokia, Justin Angel, has written a piece showing how to hack apps on Windows 8, undermining their potential revenue for the app vendors. “This is an educational article written in the hope both developers and Microsoft can benefit from an open exchange of knowledge,” he says, adding that the article was written in his own time and has nothing to do with his employer.

The hacks he describes cover:

  • Compromising in-app purchases by modifying data held locally, such as app currency.
  • Converting trial apps to full versions without paying
  • Removing ads from games
  • Reducing the cost of items offered for in-app purchase
  • Injecting Javascript  into the Internet Explorer 10 process in order to bypass trial restrictions

image

There is an inherent security weakness in any app that has to work offline, since the decryption keys also have to be stored locally; this inherent weakness is not unique to Windows 8. However, Angel argues that Microsoft could do more to address this, such as checking for tampered app files and preventing Javascript injection. Code obfuscation could also mitigate the vulnerabilities.

Although Angel is writing in his own time, the issues are relevant to Nokia, which makes Windows Phone devices and may make Windows 8 tablets in future.

Should Angel have revealed the cracks so openly and in such detail? This is an old debate; but it is sure to increase pressure on Microsoft to improve the security of the platform.

Microsoft Silverlight: shattered into a million broken urls

There has been some Twitter chatter about the closure of silverlight.net, Microsoft’s official site for its lightweight .NET client platform. multimedia player and browser plug-in.

image

I am not sure when it happened, but it is true. Silverlight.net now redirects to a page on MSDN. Some but not all of the content has been migrated to MSDN, but Microsoft has not bothered to redirect the URLs, so most of the links out there to resources and discussions on Silverlight will dump you to the aforementioned generic page.

One of the things this demonstrates is how short-sighted it is to create these mini-sites with their own top-level domain. It illustrates how fractured Microsoft is, with individual teams doing their own thing regardless. Microsoft has dozens of these sites, such as windowsazure.com, windowsphone.com, asp.net, and so on; there is little consistency of style, and when someone decides to fold one of these back to the main site, all the links die.

What about Silverlight though? It was always going to be a struggle against Flash, but Silverlight was a great technical achievement and I see it as client-side .NET done right, lightweight, secure, and powerful. It is easy to find flaws. Microsoft should have retained the cross-platform vision it started with; it should have worked wholeheartedly with the Mono team for Linux-based platforms; it should have retained parity between Windows and Mac; it should never have compromised Silverlight with the COM support that arrived in Silverlight 4.

The reasons for the absence of Silverlight in the Windows Runtime on Windows 8, and in both Metro and desktop environments in Windows RT, are likely political. The ability to run Silverlight apps on Surface RT would enhance the platform, and if COM support were removed, without compromising security.

XAML and .NET in the Windows Runtime is akin to Silverlight, but with enough differences to make porting difficult. There is an argument that supporting Silverlight there would confuse matters, though since Silverlight is still the development platform for Windows Phone 8 it is already confusing. Silverlight is a mature platform and if Microsoft had supported it in the Windows Runtime, we would have had a better set of apps at launch as well as more developer engagement.

I posted that Microsoft’s Silverlight dream is over in October 2010, during Microsoft’s final Professional Developers Conference, which is when the end of Silverlight became obvious. It lives on in Windows Phone, but I would guess that Windows Phone 8.5 or 9.0 will deprecate Silverlight in favour of the Windows Runtime. A shame, though of course it will be supported on the x86 Windows desktop and in x86 Internet Explorer for years to come.

Infragistics building cross-platform development strategy on XAML says CEO

I spoke to Dean Guida, CEO at Infragistics, maker of components for Windows, web and mobile development platforms. Windows developers with long memories will remember Sheridan software, who created products including Data Widgets and VBAssist. Infragistics was formed in 2000 when Sheridan merged with another company, ProtoView.

In other words, this is a company with roots in the Microsoft developer platform, though for a few years now it has been madly diversifying in order to survive in the new world of mobile. Guida particularly wanted to talk about IgniteUI, a set of JQuery controls which developers use either for web applications or for mobile web applications wrapped as native with PhoneGap/Cordova.

“The majority of the market is looking at doing hybrid apps because it is so expensive to do native,” Guida told me.

Infragistics has also moved into the business iOS market, with SharePlus for SharePoint access on an iPad, and ReportPlus for reporting from SQL Server or SharePoint to iPad clients. Infragistics is building on what appears to be a growing trend: businesses which run Microsoft on the server, but are buying in iPads as mobile clients.

image

Other products include Nuclios, a set of native iOS components for developers, and IguanaUI for Android.

I asked Guida how the new mobile markets compared to the traditional Windows platform, for Infragistics as a component vendor.

“The whole market’s in transition,” he says. “People are looking at mobility strategy and how to support BYOD [Bring Your Own Device], all these different platforms, and a lot of our conversations are around IgniteUI. We need to reach the iPad, and more than the iPad as well.”

“There’s still a huge market doing ASP.NET, Windows Forms, WPF. It’s still a bigger market, but the next phase is around mobility.”

What about Windows 8, does he think Microsoft has got it right? Guida’s first reaction to my question is to state that the traditional Windows platform is by no means dead. “[Microsoft] may have shifted the focus away from Silverlight and WPF, but the enterprise hasn’t, in terms of WPF. The enterprise has not shifted aware from WPF. We’ve brought some of our enterprise customers to Microsoft to show them that, some of the largest banks in the world, the insurance industry, the retail industry. These companies are making a multi-year investment decision on WPF, where the life of the application if 5 years plus.

“Silverlight, nobody was really happy about that, but Microsoft made that decision. We’re going to continue to support Silverlight, because it makes sense for us. We have a codebase of XAML that covers both WPF and Silverlight.”

Guida adds that Windows 8 and Windows Phone 8 are “great innovation”, mentioning features like Live Tiles and people hub social media aggregation, which has application in business as well. “They’re against a lot of headwind of momentum and popularity, but because Microsoft is such an enterprise company, they are going to be successful.”

How well does the XAML in Infragistics components, built for WPF and Silverlight, translate to XAML on the Windows Runtime, for Windows 8 store apps?

“It translates well now, it did not translate well in the beginning,” Guida says, referring to the early previews. “We’re moving hundreds of our HTML and XAML components to WinJS and WinRT XAML. We’re able to reuse our code. We have to do more work with touch, and we want to maintain performance. We’re in beta now with a handful of components, but we’ll get up to 100s of components available.”

It turns out that XAML is critical to the Infragistics development strategy for iOS as well as Windows. “We wrote a translator that translates XAML code to iOS and XAML code to HTML and JavaScript. We can code in XAML, add new features, fix bugs, and then it moves over to these other platforms. It’s helped us move as quickly as we’ve moved.”

What about Windows on ARM, as in Surface RT? “We fully support it,” says Guida, though “with a straight port, you lose performance. That’s what we’re working on.”

Visual Studio 2012 gets Windows XP targeting, Team Foundation Server fixes

Microsoft has released Update 1 for Visual Studio 2012. New in this update is the ability to target Windows XP with C++ applications. Brian Harry has a list of what has changed here, based on the preview from a month ago.

image

There are many updates and fixes for Team Foundation Server (TFS), including support for the Kanban development methodology in TFS Web Access. You can now do load testing, unit testing and coded UI tests for SharePoint apps. Another notable fix is that you can do mixed managed/native debugging in Windows Store (that is, Metro) apps.

The TFS update is not seamless, as Harry explains:

It’s actually a full new install (though it will silently uninstall the older version and install the update so it feels like a “patch”).  However, we still have some work to do to make this as seamless as possible.  If you’ve done any customization of your TFS install (enabling https, changing ports, etc) you will need to reapply those customizations after installing the update.

Harry also says there will not be an SP1, except that there might be:

As we are currently thinking about it, there will be no SP1.  We have changed the model from a single Service Pack between major releases to a sequence of “Updates”.  So you can, kind of, think of Update 1 as SP1.  I suppose it’s possible that, at some point, we will decide to name one of the Updates as an “SP” but that won’t really change anything.

Confused? Surely not.

You can get the update here or an offline (complete) installer is here.

Finally, I was interested to see some of the issues which developers find annoying highlighted in the comments to Soma Somasegar’s blog:

  • XAML 2009 is not supported in the editor
  • Expression Blend is still in preview
  • The need for a developer license to build Windows Store apps is a constant irritation. The complaint is not about needing a license to deploy to the Store, but about Visual Studio refusing to build Windows Store apps unless you obtain a free online license, which installs some sort of key on your machine, and which expires after a few months.

No complaints about monochrome icons though, so I guess the new look has been accepted if not actually loved by developers.