April 18, 2010 20:44
Building a project from command line gives you more control over the build process and provides quite a few other interesting options - comparing to building from Visual Studio.
And recently your humble correspondent was thinking about a "perfect build script" for an ASP.NET MVC project.
What should it have? Here's my take:
- Option to pre-compile views. Errors in views are not detected until run time but MvcBuildViews property is your compile time friend (pre-compiling the views is not
fast, so it's switched off by default).
- Option to run a clean build. Cached dlls are lurking around every bend so there must be a way to clean up everything.
- Non-removable unit tests runner. Even if running all your unit tests takes ages, there must be a set of "smoke" unit tests that verify your basics.
More...
March 14, 2010 21:45
Recently I was playing with ASP.NET MVC2 trying to find a neat solution for sending emails. This post is a sum-up of that little endeavour.
From it you will learn - How to send HTML emails with MVCContrib and its EmailTemplateService
- How to test email sender without SMTP server
- How to use Ninject with MVC controllers
All those impatient readers out there, go ahead and download the source code of a small app that will be crafted in the rest of this post (zip comes along with MVCContrib source code, for some rich debugging experience).
More...
February 7, 2010 19:43
There are tons of good papers[1] and a bunch of questions on StackOverflow[2] about designing and developing for security, but all of them seem to concentrate on what you should do.
However, recently I was after something different: a "visit a page, try this and that" kind of things, you know. A list of simple actions one should to go through once development is done, to make sure the solution is secure.
Here's something I've come up with so far:
More...
October 18, 2009 17:25
A few days ago my workmate Ian made a point that there should be a nice way to implement type safe route registration in ASP.NET MVC.
Type safe! Can anyone read these words without experiencing a tug of excitement, without being swayed by the view of departed bugs and newly arrived refactorings on controllers and actions - refactorings that don't break your app?
Indeed, type safe is possible. Here's how we register our routes now:
routes.MapRoute(
"viewProduct",
"{locale}/{product}/view/{mode}/",
new { controller = "Product", action = "Display", mode = "full" }
);
and here's a type safe way:
routes.MapRoute(
"{locale}/{product}/view/{mode}/")
.On<ProductController>(x => x.Display("full"));
More...