Aug 5 2012

I’m on the clouds

Category: C# | Virtual Machines | ASP.NET | Cloud | Azure — Duke @ 17:47

Great! the blog is online again! finally it is persistent! I mean.. it will stay online 24/7,because it is on azure!

I’ve tried several solution but at the end I’ve found the most suitable for me.

A virtual machine instance with IIS installed on it. then an endpoint opened on the port 80, and finally  my lovely DynDNS that routes my domain name with an A record on the VIP address of the Virtual Machine.

I’m happy

it works

and the database is hosted on a separate instance of SqlServer!

some may ask why to not use the web instances (shared or reserved) available in azure, they should be ideal to host a simple blog

yes they are but….

shared instances doesn’t allow custom DNS (still wondering why)

reserved instances have a price that is too higher

and last but not least. a virtual machine allows you to do what you want on it… that is not exactly what one need in case of production website (because it force you to do all the maintenance, antivirusing, patching etc…) but it is ideal for a small experimental site.

Azure is amazing, especially the new HTML portal, I’ve done everything in 3 hours without no training at all, and I’ve tried several solution (also the shared sites, yes….)

great job MS, now lover the price of the reserved site instances or allow custom dns on the shared ones.


Dec 30 2011

Simple ASP.NET MVC script manager

Category: ASP.NET | C# | MVC3 — Duke @ 15:57

I remember that some months ago I’ve found a beauty video of a beauty component that allows to manage .js and .css files from an MVC application.

Unfortunately I’ve lost the link and I don’t remember the name of the component.

I’ve searched the seven seas of the internet but… nothing. Things went worst today when I realized I need a script manager.

I’ve searched, browsed and digged the internet again but the best I’ve found is the “Simple script manager” on codeplex, that is well far from being “beauty”

So, I’ve started my own simple script manager. for now it is very basic. it does almost nothing but at least it is in full “MVC” style, by using and respecting the existing design of MVC3, differently from the other things I’ve found.


so: here is the code More...

Tags: , ,

Oct 30 2011 MVC3: entity framework 4.1 UniqueValue attribute validator

Category: ASP.NET | C# | Linq | MVC3 — Duke @ 15:28

I’m playing with MVC3 and EF4.1 (magic unicorn version) for a nice project I’m working on, and I’ve found myself in the situation to validate some fields against value duplication

(think about username, or other things that must be unique).

Unfortunately we don't have [Unique] constraint attribute in EF4.1 yet, so I’ve thought to leverage on the validation infrastructure of MVC3 to ensure uniqueness of the values.

I like the simplicity and expressiveness of the attributes then I’ve implemented my UniqueValueAttribute class.

this is remarkable because now I have a simple way to decorate every model attribute I want to be unique

(lot of fun code follows) More...