December 14, 2011   2 notes

What to do if Visual Studio 2010 doesn’t show “Organize Usings” intellisense option

One of the context menu options for a class file in VS2010 is “Organize Usings”. If you don’t know, all this basically does is remove any using statements that are no longer needed. It’s a pretty handy intellisense option.

Something I found out today was that this won’t show up unless you set the build option of the file to be compile. I was trying to use Conery’s massive micro-ORM, and the default was set to “content”.

Hope that helps someone else.

January 15, 2011   13 notes

Troubleshooting Conery’s MVC Starter Kit

Recently, I started a project with Rob Conery’s excellent MVC Starter Kit (currently v0.5). I really enjoyed how simple he made certain things.

The one issue I did have though, and I’m surprised I didn’t find anyone else who had this problem, was a bunch of the date properties on the user class weren’t being set.

When the properties were attempted to be inserted into any of the dbs, it would try to set it to ‘01-01-0001’, which isn’t a valid datetime. To fix this, all I did was change the SynchUser method in SessionController to add three additional user properties (CreatedOn, LastLogin and ModifiedOn).

Here is the code I used (line 100):

user = new User() { UserName = userName, Friendly = friendly, OpenID = userName, CreatedOn = DateTime.Now, LastLogin = DateTime.Now, ModifiedOn = DateTime.Now };

For more info on the starter kit, definitely check out Conery’s post.