For things that aren’t a part of the Visual Studio tools (yet) and things that help me move faster in my development, I like to take advantage of the power of Visual Studio’s templates and snippets capabilities.  I’ve created a few and modified a few of others that I use regularly.  I’ve shown them in a few presentations and thought I’d package them up in a single bundle for your convenience if you choose to use them.  I was going to package Robby’s snippets up as well, but didn’t think he’d appreciate that…you should get his Silverlight snippets as well (and he’s packaged them in a VS community installer also).

Here’s the ones that I have in my package right now:

  • FloatableWindow item template – this is from my adaptation of ChildWindow.  You’ll of course need the binary for this to make any sense as well.
  • Silverlight Pixel Shader item template – adapted from the WPF template, with making the minor adjustments needed by default to make it work in one shot.
  • ResourceDictionary item template – using Nick Kramer’s base for adding stand alone ResourceDictionary files to your project (to take advantage of the merged resource feature in Silverlight 3).
  • Cross-domain policy file item template – rapidly add one just like you would web.config.  You still have to set the desired security – I chose not to imply one for you :-)
  • Cross-domain policy code snippet – this actually goes along with the policy file (or replacement) which is a VS code snippet template if you want to just use that instead

I’m sure I’ll add more over time and package it in this update but for now this is what I could pull together.  Sorry the package isn’t signed as a verified publisher…if I could figure out how to do that I would have tried :-).  You can download them here: SilverlightVSHelpers_1.vsi.  Oh and yes, they are for Visual Basic and C#.

Hope this helps!


This work is licensed under a Creative Commons Attribution By license.

We’ve update the .NET RIA Services build for May 2009.  The updated May preview can be downloaded here: .NET RIA Services May 2009.  You may have to uninstall your previous version before installing this one. 

What is .NET RIA Services?
Microsoft .NET RIA Services simplifies the traditional n-tier application pattern by bringing together the ASP.NET and Silverlight platforms. The RIA Services provides a pattern to write application logic that runs on the mid-tier and controls access to data for queries, changes and custom operations. It also provides end-to-end support for common tasks such as data validation, authentication and roles by integrating with Silverlight components on the client and ASP.NET on the mid-tier.

This update incorporates a bunch of fixes that have been reported in the RIA Services forum.  This is a good place to report issues and communicate with the dev team.  Most fixes came from the forum.  In addition, DomainService base classes now infer some data access metadata based on the model (length, required for example).  There are a few other samples that were added to this as well to note:

Also upon installing you’ll see a new project type called the Business Application Template.  Right now it looks and feels exactly like the navigation template with the Silverlight tools, but has a few defaults added, namely authentication.  You’ll see in the ASP.NET project there with a Services folder and three new files: AuthenticationService, UserInformation, UserRegistrationService.  These are all services to expose authentication and membership integration.  Running the template by default will give you a new “login” link in the upper right and clicking on that implements a new ChildWindow for login:

Biz App Login Template

Notice the "Register now” link which then uses another ChildWindow control for registration:

Biz App Register Template

Registering a new user uses the UserRegistrationService to add a new user to the system.  If you look at the UserRegistrationService you’ll see that it uses the ASP.NET Membership APIs:

   1: namespace BusinessApplication2.Web
   2: {
   3:     [EnableClientAccess]
   4:     public class UserRegistrationService : DomainService
   5:     {
   6:         // NOTE: This is a sample code to get your application started. In the production code you would 
   7:         // want to provide a mitigation against a denial of service attack by providing CAPTCHA 
   8:         // control functionality or verifying user's email address.
   9:  
  10:         public void AddUser(UserInformation user)
  11:         {
  12:             MembershipCreateStatus createStatus;
  13:  
  14:             // NOTE: ASP.NET by default uses SQL Server Express to create the user database. 
  15:             // CreateUser will fail if you do not have SQL Server Express installed.
  16:  
  17:             Membership.CreateUser(user.UserName, user.Password, user.Email, user.Question, user.Answer, true, null, out createStatus);
  18:             if (createStatus != MembershipCreateStatus.Success)
  19:             {
  20:                 throw new DomainServiceException(ErrorCodeToString(createStatus));
  21:             }
  22:         }
  23:         
  24:         // other methods exist here
  25:         // ...
  26:     }
  27: }

Because the membership APIs are provider-based, you can leverage whatever you want for your membership model and still use those APIs.  The example uses the default mechanism in ASP.NET.

Download the updated RIA Services bits today and take a look at the new template for integrating with the various ASP.NET providers.  Thanks for the continued feedback and keep it coming!

Back in December, I wrote about my attempt at diversifying my hobbies.  In October 2008 I started taking guitar lessons because I had a Fender ‘laying around’ that was getting unused.  Since then I’ve really enjoyed it and picked up an acoustic (which I actually enjoy playing more).  I’ve also picked up some computer equipment (M-Audio Black Box) so that I can mess around with software like GarageBand and actually record some of my practices.

I’ve moved quite a long way from my happy birthday recording in that blog post :-) but I’ve still got a long way to go.  Traveling certainly puts a dent in practicing for something like a musical instrument – especially when you don’t travel with it.  I’ve pretty much been gone from mid-April until mid-May which means I haven’t practiced much at all.  I’ve thought about getting something like the Martin Backpacker guitar, but just haven’t picked one up yet.

I have found some great online resources that have made learning the guitar a lot more fun for me as a geek.  Turns out there is a bunch of great info out there for self learning.  Of course, I don’t think anything can fully match 1-on-1 instruction from someone in person, but for in-between lessons, here’s some things I’ve found fun and useful.

  • iLife 09 music lessons – I had big hope for these and it is turning out that they just aren’t that exciting once compared to other free (and more frequently updated) offerings are out there.  I still have the basics (the celebrity lessons are lame in my opinion) which do a decent job covering things like the 12-bar blues, etc.  The production quality, as expected from Apple, is of the highest quality…just wish the content was updated and more appealing.
  • JustinGuitar.com – A UK guy who uses YouTube to deliver free lessons on basics as well as some fun/modern guitar riffs.  He’s got a great personality and goes at a pace a beginner like myself can understand.
  • Ultimate-Guitar.com – one of my favorites.  Once you learn how to read guitar TAB notation, this site is fun to check out.  It is user-contributed content, so reader beware, but most of what I’ve found is pretty good.  When I hear a song I might want to check out, I search this site and learn.  I learned how to play a Bob Marley tune completely in a few hours by just what I found here.
  • James from Handsome Alvin – James uses YouTube puts up some great  videos walking through popular songs with strumming patterns and at a pace perfect for me as a beginner.  I’m frequently more of his videos a lot because I like how he puts up the strumming patterns and chord progressions.
  • Marty Schwartz from GuitarJamz.com – A new resource I just found that, like others, uses YouTube to deliver.  Marty has a great personality about him and slows things down for beginners.  And he takes requests via Twitter.

My private instructor is great as well and like I said, nothing can replace that.  Having these things in-between lessons at my own pace moves me beyond lesson exercises to learning things that catch my ear and have fun doing it.  I’m still having a blast, even though it is immensely challenging for me technically – as well as finding the time to practice!

Happy hobbying!

I’ll be joining Dan Wahlin and Rob Bagby on 18 May in Phoenix for a Best of MIX event.  I’ll be presenting Silverlight 3 and building data-driven line-of-business applications.  All demo, all tech, all Visual Studio as my presentation tool :-).

Come out and join us for the event!

Best of MIX Agenda

Monday, May 18, 2009
1:00 PM - 5:00 PM
Wells Fargo Conference Center
100 West Washington Street, MAC S4101-017
Phoenix Arizona 85003

What’s New in Silverlight 3?

Are you interested in building business-focused Rich Internet Applications (RIAs)?  Would you like to take advantage of 3D in the browser, but assume it is too hard?  Have you wanted to take a Silverlight application offline?  Then this session is for you.  We will explore and illustrate the new features of Silverlight 3, including the following:

· Support for perspective 3D

· Offline Support

· .NET RIA Services which simplifies the traditional n-tier application pattern by bringing together the ASP.NET and Silverlight platforms

Building Web Applications with Windows Azure

This session will begin with a brief overview of Azure and discuss some of the announcements made at MIX.  We will then illustrate through demo how to build a Windows Azure application from the ground up.  We will illustrate how to consume Azure Table Storage, how to host services, web pages and Silverlight components, as well as how to deploy your solution to the cloud.

MVC 1.0 vs ASP.Net Webforms

Have you heard about the new ASP.NET MVC  framework from Microsoft and wondered what it was all about? Are you curious whether this replaces ASP.Net Web Forms?  In this session you will learn how to use the model-view-controller (MVC) pattern to take advantage of your favorite .NET Framework language for writing business logic in a way that is de-coupled from the views of the data.  In addition, we will talk about the pros and cons of both MVC and Web Forms, how to determine the best choice for a specific project, various techniques and patterns used to build MVC applications vs. Web Forms applications, and the implications for using each approach.

Register for the Event

We’ve just released an update to our Silverlight Enterprise Deployment guidance/whitepaper.  While a lot of the information from the first version of the guidance (targeted at Silverlight 1.0), we made some minor adjustments outlining the specifics for the updated Silverlight installer and documented some of the command-switches and their behaviors. 

The guidance covers:

  • Using Windows Software Update Services (WSUS)
  • Group policy
  • Microsoft System Center Configuration Manager (SCCM)
  • Manual install options
  • Maintaining and detecting version

It’s a great guidance document to keep in your toolkit if you are in charge of deployment in your organization or want a better way to manage mass deployments of Silverlight across the organization.  You can download the Silverlight Enterprise Deployment whitepaper from the Silverlight community site.