27 Jun 2011

Mercurial + Lightswitch : .hgignore file bliss

Clipboard02Lightswitch is a fantastic tool but has a MAJOR downside to it – it eats disk space like no-ones business. A simple test project with 1 table, 1 screen & some code on the client side and server side is over 90Mb of space!

If you are a developer you will have some sort of version control system in place and you should be following some best practices in version control. For this post, the one I want to look at is to only check into the repo what actually needs to be in the repo. A polluted and huge repo is not only hard to work with, it puts people off and lowers adoption Sad smile

I have been using Mercurial a lot recently and part of a new LS project I took the time to look at how much of the LS project needs to go into the repo – and you know what… it is VERY VERY LITTLE, in fact it is about 0.4%!

Mercurial, for those new to it, has a .hgignore file which uses a regular expression like language to tell it what files to ignore, i.e. don’t commit those files to the repo. Below is what my .hgignore file looks like. That first 4 line group is the LS specific lines while the rest is for general Visual Studio projects:

syntax: glob

*.lsproj.user
ServiceConfiguration.cscfg
*/_Pvt_Extensions/*
*/GeneratedArtifacts/*

*.csproj.user
*.vbproj.user
*/[Oo]bj/*
*/[Bb]in/*
*.suo
*DXCore.Solution
[Tt]humbs.db 
*.user
*.bak.* 
*.bak 
*.[Cc]ache
*/[Pp]ublish/*
*.vssscc
*.vs10x
*/[Dd]otfuscated/*
[Dd]otfuscated/*
*.vsp
[Nn][Dd]epend[Oo]ut/*
*.licx
*.docstates
*.cscfg
*.csdef

It is important to note that when you pull from the repo (or checkout for TFS/VSS/SVN folk) you’ll get the disk saving, until you open it up that is. Once opened LS will regenerate everything and the size on your machine will be back to the massive 90Mb+, however the repo will remain small, commits will remain small, network traffic will remain small and performance improved – just what we wanted from following those version control best practises.

21 Jun 2011

Mercurial Cheat Sheet

I am a fan of ALM (application lifecycle management) and an awesome source control tool is Mercurial. It has plugins for VS, Windows (Tortoise HG) and a command line. I use the command line a lot but can’t remember all the commands so below you can find an easy cheat sheet for all the Mercurial commands:

Mercurial Cheat Sheet

HIGH resolution XPS & PDF below.

AttachmentSize
File Mercurial Cheat Sheet.xps1.14 MB
PDF icon Mercurial Cheat Sheet.pdf828.01 KB
06 Jun 2011

Pepper: Issue causing crashes

Update 6 June 2011 15h30 (GMT +0200): All is working now, post left for archival purposes.

Pepper, everyone's favourite Visual Studio add-in for synchronisation of Visual Studio settings, is currently DOWN Sad smile and trying to use Pepper will cause it to crash Visual Studio Sad smile

Something has gone seriously wrong in the SQL Azure database that powers it and I’ve logged a call with Microsoft to have it investigated and repaired.

As soon as I have any updates, I will update this page. Thanks for your patience.

Updates:

Update 6 June 2011 13h45 (GMT +0200): Testing is showing the database issue is resolved however I am awaiting confirmation from Microsoft Support before I sound the all clear.
Update 6 June 2011 15h30 (GMT +0200): All clear. The cause was the database disappeared! Seriously, just gone. Couldn't see it in SQL management studio or in the Azure management portal and the web services Pepper uses couldn't talk to it either. During the Microsoft investigation the database reappeared and unfortunately support has been unable to identify what happened (or they not telling me... but I'm paranoid).
26 May 2011

DevDays South Africa 2011: My Talks

WOW! Microsoft DevDays 2011 in Cape Town & Johannesburg was fantastic, my fellow speakers rocked, the venues were brilliant and most importantly YOU, the audience was amazing!

Thank you to everyone who attended my talks, especially since they were at the end of a very tiring day. I hope I delivered value to you and if you have any questions or comments on them, please feel free to get in touch with me.

I promise the slides & demos would be made available so here they are:

Let’s get ready for the cloud: Building your applications so they are cloud ready

Lightswitch basics: Building your first Lightswitch Application

All the files again (my blog does this)

19 May 2011

A follow up to my NDepend pro tip...

I posted in March that despite using NDepend for over a year I had missed an awesome feature of the product. Not even a day later I received an email from Patrick (creator of NDepend) about it and we discussed over a few emails about that post, why I had never found it and what could be done to improve it.

Recently Patrick released NDepend 3.8 and took specific notice of that discussion, and many other discussions with “enthusiast users” (as he calls us) into the design so it is significantly better Smile

image

Check out the new landing page in the app! Note the option I “found” is front and centre and even has a helpful arrow to point it out!

In addition to that there is many new features which I cannot wait to try out:

    • New menu in Start Page 'Select VS Solution(s) to Analyze'
    • Ergonomy of 'New NDepend Project' dialog enhanced.
    • In Build Comparison Setting form, there is a new button 'Browse VS solutions' to fill easily the assemblies list.
    • On multi-monitor machines, all NDepend dialogs and forms shown, now appear on the screen that currently contains the mouse cursor
    • The Dependency Matrix and Graph now support the mouse extra-buttons back/forward.
    • Support for Reflector v7.X
    • The default rule 'Fields should be marked as ReadOnly when possible' now discards fields generated for events (i.e fields where 'IsEventDelegateObject').
    • The flag Concurrent is now implemented by the MSBuild and NAnt tasks.
    • In CQL Explorer panel, it is now possible to export a group of queries to XML.

I just wanted to post this to share this excellent news and also point out how awesome Patrick is at incorporating feedback from everyone and really this is why NDepend is such an awesome product.

19 May 2011

Perf wars - Share your performance experience with VS2010

Microsoft has released another great extension to the gallery, called PerfWatson. This extension monitors Visual Studio for performance problems with the UI thread and submits them to Microsoft for analysis. So if you are having a problem with your Visual Studio, then please take the time to install this and submit to Microsoft Smile

04 May 2011

It's official: Pepper uses Azure

Bruce Kyle, a Microsoft evangelist, wrote an article recently about the “Powered By Microsoft Windows Azure” logo and how you can earn the right to display that.

That may sound odd to some people – why can’t you say you use Azure if you do? Of course you can, but if you jump a few hoops with Microsoft you can use the official logo Smile 

PoweredByWA_border

But that is not all! Doing this also helps towards an ISV competence with Microsoft which gets you great assistance and free software from Microsoft, the opportunity to get $250 for marketing and also some other pieces of useful tidbits. One of those tidbits is a press release template, which is so odd for me too see as I am not in marketing, press or anyone else who does those – so lower down you can find mine Winking smile

So about those hoops, you maybe wondering how hard or easy this is? I took Pepper through the testing for both SQL Azure & Windows Azure and it took about 30min, reading Bruce’s article & watching a video. It is RIDICULOUSLY easy to do once you have your application built – SO GO. DO IT. BE POWERED BY WINDOWS AZURE!

Enjoy reading my first press release Smile with tongue out

For Release 22:00 SAST

4 May 2011

Robert MacLean Becomes a “Front Runner” With the Release of Its Latest Application, Pepper

Johannesburg, South Africa — 4 May 2011 — Robert MacLean today announced it will launch a new application using the Windows Azure Platform. Pepper in combination with the Windows Azure platform helps enable customers to backup, share and synchronize your Visual Studio 2010 settings between multiple machines from directly inside Visual Studio 2010 without any costs or requirements for you. The Windows Azure platform, Microsoft’s cloud services platform, provides Pepper with the ability to build, manage, and deploy cloud based applications.

“Thru the technical and marketing support provided by the Front Runner program, we are excited to see the innovative solutions built on the Windows Azure platform by the ISV community,” said Doug Hauger, general manager for Windows Azure Microsoft Corp. “The companies who choose to be a part of the Front Runner program show initiative and technological advancement in their respective industries.”

“Windows Azure platform provides greater choice and flexibility in how we develop and deploy applications to all developers, both on-premises or in the cloud” said Robert MacLean, Developer of Pepper

Pepper automates critical processes such as synchronization and backup of settings to the cloud, eliminating the need for local storage and lowering the chances of losing them.

#########

Product or service names mentioned herein are the trademarks of their respective owners.

For more information, press only:

Robert MacLean, robert@sadev.co.za

03 May 2011

Rapid Business Development: Lightswitch vs. Dynamics CRM vs. SharePoint 2010 vs. ASP.NET MVC 3

In this post I am going to look at comparing four technologies that can be used to build business applications easily. This post was inspired by how similar a number of products have become over the last few years and more importantly how the new kid on the block Visual Studio Lightswitch, which is a specialised rapid business tool development platform built on top of Visual Studio, is going to affect this eco-system. It is important to also remember that this is being written in the Lightswitch Beta 2 timeframe, so some details may change by launch.

Lightswitch feels very similar to me, to another product I have worked with in the past: Dynamics CRM, which is a Customer Relationship Management tool from Microsoft. CRM does very well in the xRM (x = extensible) scenario, where I think it will come up against Lightswitch a lot. I haven’t had an opportunity to use the latest CRM release yet, so I have had to rely on the help of experts to fill in my gaps!

SharePoint 2010 is another product I have worked with, can of course be used for building business applications quickly cause it is the “operating system of the enterprise” and has good features for these types of applications.

Finally, while watching Scott Hanselman do the ASP.NET MVC 3 demo in the MIX 11 Keynote, I was struck with how that is very close to a rapid business user development tool with all the new scaffolding features. ASP.NET MVC is a real outsider in this group because it is first a development toolset for web development and, maybe a rapid tool second where the rest are rapid development platforms or tools first.

I think the differences between these four are very interesting and while each has it’s strong & weak points, this should definitely not be looked at as a pick one only post. There are many scenarios where you want to combine them for even better experiences.

I have broken down the issues into twenty one(!) aspects (key points we can compare them against each other) which are grouped into six scenarios to make it easier to digest. Each scenario starts with a list of the aspects and a brief description followed by a comparison table of those aspects.

Starting

  • Ready to go out of the box: Once installed, can it do anything? Seems silly, but quick turn around at the start, even if actual development is longer is important as it helps with prototyping, shows some rapid development and hints at how hard it is to learn (for me at least, if it does something I find I can experiment and learn quickly). Important to note, we are not looking at making it align with your company needs here, we just want it to do something. Eating CPU cycles & RAM is not something either.
  • Northwind Style Sample development costs: This aspect looks further than the above aspect and looks at how much more would it take to get it tailored for a company, like the fictional Northwind, to have a XRM type system as it can be done across all four. Fewer $ signs means less time and/or resources for the functionality.
  Lightswitch (LS) Dynamics CRM SharePoint 2010 (SP) ASP.NET MVC My Thoughts
Ready to go out of the box Fast Fastest Fast Slowest LS & MVC need development, while SP needs at least 5min of tailoring. CRM, is ready to go once installed.
Northwind Style Sample development costs $ $$ $$ $$$ ASP.NET MVC has the highest development costs as so little is out of the box. Lightswitch excels in this scenario.

Finishing

  • Cost for on-premise deployments: This looks at the money cost for licensing to get the solution up and running on premise (i.e. in your company). Licensing is, of course, flexible and this will vary based on who you are – so this is not indicative for all. It does not include such things as server hardware or common costs, for example operating system licensing.
  • Deployment Complexity: Getting a solution up and running shouldn’t be difficult for an organisation and a lot of time can be lost (and costs incurred) changing, upgrading and troubleshooting systems that do not want to be deployed.
  • Deployment Documentation: When it happens that you need to deploy, having a wealth of documentation (be that video’s, best practice guides, troubleshooting material) is vital and plays a large part in getting a solution up that works every time.
  Lightswitch (LS) Dynamics CRM SharePoint 2010 (SP) ASP.NET MVC My Thoughts
Cost for on premise deployments $$$

Unknown.
Likely cost per developer seat.
No per user costs.
$ to $$$

Cost per user & cost per server. Visual Studio only if you are doing integrations or custom workflows.
$$$$ to $$$$+

Cost per user & cost per server. Visual Studio licenses for any serious work.
$$

Visual Studio licenses.No per user costs.
CRM on the small scale with low development is very cheap but since you pay per user can get expensive. LS & MVC only have development software costs, which is more expensive up front but do not increase as you add users to the system.
Deployment Complexity Medium Hard Hardest Easy LS, CRM & SP all have requirements that they need to work, in increasing deployment complexity, but CRM & SP are significantly harder than LS though due to their more complete product nature. MVC is easy because there is no constraints from it (other than a web server).
Deployment Documentation Yes Yes Yes No Only MVC has no official documentation, which makes sense as it is a development tool. All four have GREAT communities to help as well!

User Experience

  • Front End Technology: A good looking, feature rich UI can seriously ease adoption, and what we are looking at here is the richness level of technology used for the out of the box front end user interface.
  • How good the standard UI looks: Completely subjective and really this is based on what I think looks best.
  • Flexibility of out of box front end: In this aspect we are concerned about how easy it is to adjust and tweak the out of the box front end.
  • Themability : Corporate branding is massive business and making sure the application out of the box looks like it is part of your business is important. It is important to note that both CRM & SharePoint can have custom front ends built which enable this scenario, but that requires extra development, and we are focusing on the out of the box options here and assuming you have the theme built already.
  Lightswitch (LS) Dynamics CRM SharePoint 2010 (SP) ASP.NET MVC My Thoughts
Front End Technology Silverlight.

Supports out of browser (desktop) & in browser
Web

Just ASP.NET
Web

ASP.NET under the covers with sprinklings of Silverlight
ASP.NET LS clearly best here, since it will give the richest UI out of the box. ASP.NET MVC out of the box scaffolding isn’t pretty but can easily be improved.
How good the standard UI looks (very subjective) Low Medium Very. Low Depends on your web designer This is the most subjective aspect: LS & SP both have a fairly plain out of the box UI but SP has a bad UX to go with it. CRM is much better out of the box and if you are going down the MVC route you will likely be taking advantage of the best UI thanks to the complete flexibility – but that depends on how good your designers are.
Flexibility of UI development in the tool High Medium Medium High MVC & LS can almost do anything on the front end, especially if you combined MVC with Silverlight. SharePoint & CRM too have lots of options and work with Silverlight.
Themability Medium Low Medium High The flexibility of MVC is highest as it is a pure programming, with LS following up thanks to it’s strong theme support. SharePoint can be themed but not the same level as LS. CRM will always look like CRM!

Extensibility

  • API for integration: In the short term having an API means it is easy to get data into your new solution, in the medium term it means more ways to sync data and mash up your systems and in the long term it gives you a way to get your data out. It is vital to have an API.
  • Marketplace: Apple kicked the idea of having an AppStore into reality for many of us and now having a marketplace to get extensions, customisations or themes is an important aspect. I am ignoring public sites, like Codeplex for example, and only focusing on an official marketplaces. Galleries are just marketplaces with no vetting, which means they are bigger but the quality bar is not guaranteed.
  • Additional Authentication Options: Only your employees or customers (which may be everyone if you are lucky enough) should access your solutions. What do we get out of the box to limit access to the system? All four systems support Windows & Forms based authentication so I am only listing other options which are available.
  • Permission Structure (Authorisation): Being able to control what parts of a solution you can access, once you have logged in is also vital and having a lot of flexibility in this space is also important as very seldom will one structure work for everyone.
  Lightswitch (LS) Dynamics CRM SharePoint 2010 (SP) ASP.NET MVC My Thoughts
API for integration Yes Yes Yes - at least 5 of them. N/A In MVC you could build one, oData for instance, but it doesn’t have one out of the box. LS creates a WCF RIA Service for us. CRM & SP both have API’s, but SP is more complex as it supports so many different API’s with different subsets of features supported.
Marketplace Once it is released a gallery will exist. Yes Nope Gallery available CRM leads here in a big way with a REAL marketplace. ASP.NET MVC has it’s own gallery plus a strong 3rd party marketplace ecosystem.
Additional Authentication Options Anonymous and more available through custom development (e.g. Windows Live). Claims based authentication(custom development required). Claims based authentication via STS Anonymous and more available through custom development (e.g. Windows Live). Claims based authentication(custom development required). Anonymous and more available through custom development (e.g. Windows Live). Claims based authentication(custom development required).  
Permission Structure (Authorisation) Very basic and really just a half a step ahead of editing XML that MVC needs. Fantastic out of the box option, plus plenty of extensibility if needed. Good structure with many levels of customisation.
Out of the box is very simple.
Basic support for it but can be extended through development. A lot of XML work though may be needed. LS & MVC are the lightest here, both supports authorisation options but enforcing it is up to the developer to implement. LS is better slightly better at guiding the developer and needs no XML editing. SP authorisation is as varied & powerful as what CRM offers. However SP can easily get messy, users can break permission inheritance, while CRM enforces authorisation all the time and makes for a better structured environment.

Information Worker Features

  • Offline support: Being able to work when you are not in the office is a vital need for many people. So how do these platforms enable that scenario. In theory it is always possible to build this, so we are just looking at the out of box offering.
  • Easily Import Data: How do we get information into the solution, besides the API? Does the product make this easy with out of the box tooling?
  • Printing: Despite the promise of a paperless office, it still is not the case and being able to print is important, even if it is just to XPS or PDF for invoicing.
  • Office Integration: Integration into Microsoft Office products (i.e. Word, Excel, Outlook, PowerPoint, Access, Publisher, InfoPath & OneNote) means that your IW’s will be able to work in the tools that they are comfortable with, easing adoption and productivity.
  Lightswitch (LS) Dynamics CRM SharePoint 2010 (SP) ASP.NET MVC My Thoughts
Offline support No Yes Yes No Being able to work offline is important if you are a roaming user. LS & MVC offer nothing in this space while CRM & SP both offer offline via Outlook.
Easily Import Data (out of the box) Nope Yes, from CVS. Yes. Multiple options. Nope In all cases there are tools and other ways to import data but CRM & SP have an out of the box options.
Printing (out of the box) Nope Yes Yes – Poor Browser Level LS & MVC can have custom development solutions for printing,  other than that they both offer nothing out of the box. As browser printing has improved MVC has a slight advantage being HTML based normally. SP has printing, but it is very poor. CRM leads the way here with a great print scenario.
Office Integration Low

One way export to Excel.

Others can be custom developed
Medium

One way to Excel. Mail merge with Word & Outlook.
Deep integration with Outlook is available too.
High

Only Publisher doesn’t have some integration with SharePoint.
Every other Office product does, some like Excel are one way while others like Access are two way.

SP internally has features that understand Office files too, for example PowerPoint Libraries show thumbnails.
None

Can be custom developed.
 

Other

  • Databases Supported: Where the data can come from for your application is a critical piece of the puzzle because it means the difference between building ETL solutions to handle moving it around if the source is supported or having it just work.
  • Minimum Skills For Tailoring: Tailoring is what I refer to when I think of customisation of a system, without the need for a programming language. At some point you will need a developer but how far away that is and what can be done by a analyst or super user early on is important from a time to solution and cost perspective. Lower is better here.
  • Can run in the cloud?: If you not thinking about how you can leverage the cloud, then you are not thinking. Making sure the solutions can cater for the cloud is an important consideration. All four solutions can run in the cloud but how do they run is also important
  • ALM Experience: How does this tool work with a full ALM experience? Can I unit test it easily? Will it go into source control easily and what happens when multiple developers are updating the same files? How about build server and development tool integration? All important questions in understanding a complete picture of that these tools cost or what you sacrfice with some of them.
  • Requires Silverlight: Despite decent market penetration and ease of deployment in corporate scenarios, the requirement for Silverlight can be a deterrent to business, especially those where the CEO uses an iPad2 Smile with tongue out. This is not answered in the table as only Lightswitch requires Silverlight. CRM has no dependencies, SharePoint has a fall back mode and if you used Silverlight with MVC it would be possible to have a fallback mode, provided you developed it.
  • Data performance: This is also not in the table since it only applies to Lightswitch. For CRM, MVC & SharePoint I assume your front end (web) is always close enough, for example the same LAN, to the database but in Lightswitch you can really separate them. Here it is important to note Lightswitch is NOT great with data performance between backend & frontend. It sends massive amounts of data around. In my view it really does not feel optimised for WAN scenarios.
  Lightswitch (LS) Dynamics CRM SharePoint 2010 (SP) ASP.NET MVC My Thoughts
Databases Supported SQL Server, SQL Azure, SharePoint or anything supported by WCF RIA services. SQL Server SQL Server normally.

With advanced skills can use external data sources.
For scaffolding anything supported by LinqToSQL or Entity Framework. LS & MVC feel very close here, however LS has it’s own OM which MVC uses established ones meaning more options in the MVC camp.
Minimum Skills For Tailoring Intermediate
Lowest
Low Highest Being able to tailor with less skill is a big plus for CRM & SP. MVC doesn’t have tailoring as it is all development. LS really stuck in the middle ground here – for setting it up I suspect nothing more than power user but that ends much sooner and moves to needed a developer than with CRM and SharePoint.
Can run in the cloud? Platform as a service using SQL Azure for database & compute instances for front end. Software as a service: Can get it from Microsoft & Partners at a cost per user per month. Software as a service: Can get it from Microsoft & Partners at a cost per user per month. Recently launched in beta with Microsoft. Platform as a service using SQL Azure for database & compute instances for front end.  
ALM Experience Medium Low High Highest ASP.NET MVC is a pure development experience and so works well with ALM. SP2010 plus VS2010 is a great ALM experience (although mocking is difficult). LS & CRM are oddly very similar with customisations in XML though so expect some source control pain. Plugin’s for CRM and LS Extensions are a great ALM scenario. CRM falls short in the unit testing scenario though.

Special Thanks

A post this in depth could not have been done without input from my “brain trust”, and I thank each one of you for your help:

Pages