imagesIf you've done any kind of customization work on Dynamics you've probably run into a situation at some point where the needs arises to create a custom application to suit the need. The debate that I always here is should it be done in ASP.NET or Silverlight. When I first started getting involved in CRM projects I didn't really have a strong opinion either way. I wasn't really up to speed on Silverlight either so I had a knowledge gap influencing my “shoulder shrug” treatment of the issue. Now that I know a thing or two more my opinion has shifted.


The thing that bugs me the most about custom ASP.NET application is the fact that it really needs to run in a separate website. You can play around with running your ASP.NET directly inside the CRM website (perhaps using the ISV folder or a virtual directory), but this usage has been deprecated by Microsoft. To make matters worse if you want to try and use third party controls in your ASP.NET application like Infragistics or Telerik inside the CRM application pool you can pretty much kiss that idea goodbye. The CRM application pool runs in Classic managed pipeline mode so unless you know something I don't (which is certainly possible) the third party controls had problems when I attempted this myself. Granted maybe there was a way to get them working but it wasn't a battle I needed to fight at the time.

So when you do these external apps Microsoft wants you to create a whole new website and run it in a different application pool. This process in itself just doesn't feel clean to me. I understand the premise but the fact that I have to go out of my way is irritating. The other thing that is problematic is that by running your app on a separate port you introduce cross site scripting issues.


Admittedly I avoided Silverlight in the beginning because I felt like it was more fluff and it wasn't something I wanted to bother having to learn. I kept hearing about XAML and I thought that was just one more thing to have to learn as well. But then I came across a situation where I had no choice but to dive in with both feet and get it under my belt. My learning curve was surprisingly low. I had done some Windows Forms development in the past and found Silverlight was very similar. Also the project I was working on used Infragistics and I was already familiar with the object model of their controls for Windows Forms so picking up the Silverlight version wasn't too bad. This is all fine, but that's not what got me on Silverlight.

I have written ASP.NET for Dynamics and now that I have written Silverlight for Dynamics I don't think that in most situations that I would go with ASP.NET. So what are the benefits of using Silverlight over ASP.NET? Here are a few of the pros I can think of off the top of my head.

  • Silverlight application it can be added to the solution as a web resource which is huge.
  • Your Silverlight application runs when the user is running offline from the CRM system.
  • Silverlight applications run within the CRM web service so you get access to the form context.
  • The complexity of an automated build process is reduced by not having to worry about setting up external web sites.
  • Silverlight running in the context of the web service makes your cross site scripting issues go away.
  • You don't have to install any third party tools on your servers.
  • Silverlight can run in browser or out of browser and with some policy adjustments gain access to client side resources.

The Argument against Silverlight

So even though Silverlight is great and cool there are still people who hesitate to deploy it in their solution for different reasons. One reason I've heard is "We don't have anyone on staff that knows Silverlight.". Okay that's fine. But it's not so hard to learn to make it impossible to use it. The more interesting reason I've heard comes from the question of Silverlight's future. What is going to happen? Is Microsoft going to abandon the Silverlight baby and we'll all be stuck with a dead technology?!!!! No I don't see that happening. Besides Microsoft just came out and said they are supporting Silverlight for the next 10 years.

No I don't think Silverlight is going to die. Yes I know about HTML5. While it certainly will be a nice enhancement to us all it still isn't a real technology yet. I still don't see how HTML5 is going to replace our RIA technologies completely especially for line of business type applications. It is very nice to be able to write managed code with a powerful editor such as Visual Studio. Believe me I've toyed around with the idea of writing custom web apps with just HTML, CSS and JavaScript, but I like my run time error checking.

Summing it up

Silverlight is awesome. ASP.NET is fine, but in the case of custom application I will have to lean towards Silverlight unless there is some institutional or compelling reason not to. I think there are too many benefits that outweigh the cons. In my humble opinion you should go for Silverlight apps in your solutions and go for ASP.NET apps only if it becomes necessary.