About your host

Photo of your host - Charles Vallance Charles Vallance is a web developer with a slight case of OCD when it comes to nice clean standards compliant html and code.

Badges

twitter / cvallance
My articles have been featured in The Morning Brew - Daily .NET News and Views

Tag Cloud

more tags...
November 2007 Entries

Just updated Wordpress and the final step in the upgrade process is posting a new post about upgrading it. Hmmm... maybe another time, there are better things afoot!

MS MVC Code

Scott Hanselman is teasing me. He's posted the source code, DevConnections and PNPSummit MVC Demos Source Code, from the MVC demos that he and others have performed. It obviously doesn't work or compile *sigh*. I'm quite curious how the validation is going to work... so far I haven't seen any examples of it.

He says there will be a CTP very soon... still can't wait! :-)

LOLCode on the DLR

Scott has also recently blogged about some smart cookie who implemented LOLCode on the DLR. Totally pointless but highly amusing. View the blog here - The Weekly Source Code 11 - LOLCode DLR Edition.

Which brings me on to the subject of LOLCats.

I feel the my place of work has gone slightly LOLCats mad recently... and rightly so I guess, they are rather funny. This is one of the current favourites - teenage mutent nenja kitteh.

Speaking of funny stuff on the web... everyone probably knows this already, but you really can't go past XKCD for a good old chuckle. These two, Exploits of a Mom and A-Minus-Minus, would have to be amongst my favourites.

In other news...

My parents Manchester Terrier has given birth to 3 healthy little bitches. They are looking for good homes, so gimme a bell if you're interested.

I got to see them in the weekend but they were only 2 days old and still had their eyes closed and will do for another 6 days or so apparently. Sure, they were cute... but at that age and stage they aren't really up to much. I can't wait to see them again in a couple of weeks time... they'll be little pockets of fun!

Technorati Tags: ,

Ahhh... now I remember, I've got a blog! I knew I would find it hard to post to this thing, so hard to find the time! Maybe now the ski season is over (bring on next year!) I can find a bit more time.

Castle

As I have posted before, I have been experimenting with the castle stack for a little while now and I really enjoy it. Although, at the same time I just feel something is a miss...

Maybe it was my decision to go with brail and the debugging nightmare that came with it. In hindsight, I probably should have gone with the AspView engine - It just seems to make more sense to me.

Maybe it's the fact that documentation is hard to find. Sure, it's out there... but it seems to be scattered all over the place (at least that's been my experience). You can't blame them thou, it is an open source framework and I know I'd be a darn shot happier coding than I would be writing documentation!

I must say there is a great mailing list thou... questions tend to get answered there fairly quickly.

ASP.NET MVC Framework

I'm extremely excited about the ASP.NET MVC Framework that Microsoft is developing, I'm hoping it'll bring the best of the Castle and ASP.NET worlds together.

Scott Guthrie announced it the ASP.NET MVC Framework here (read up on it if you haven't already). At one stage of the post he says

I'll be doing some in-depth tutorial posts about the new ASP.NET MVC framework in a few weeks once the bits are available for download (in the meantime the best way to learn more is to watch the video of my Alt.net presentation).

The part I wanted focus on was - 'in a few weeks'. In my book, 'a few weeks' means 3 weeks give or take 1 week (2 max!) and it's been 24 days since Scott posted it... so hopefully, just hopefully, I'll have something to play with in a day or two. It'll also give me something to blog about! ;-)

In the mean time, I've watched both ScottGu's and ScottHan's videos from the ALT.NET conference. You can find them here on ScottHan's blog. I actually had problems watching them so I downloaded them instead. You can get them here (ScottHaOnDLRandMVCatALTNET.wmv - 130mb) and here (ScottGuOnMVCatALTNET.wmv - 440mb).

Thats about all from me tonight. A few exciting things may be happening soon... but I can't tell you about that just yet. Watch this space! ;-)

Technorati Tags: ,,

I've been wanting to make a site using the Castle Project for a while now and I finally took some time out yesterday to give it a whirl. First impressions, awesome... I can't wait to get fully stuck into it! Which should be about 1 minute after writing this! :-)

I've just finished using CakePHP for a big project, so MonoRail's MVC way of thinking isn't foreign to me. I've also been wanting to have a look at NHibernate and ActiveRecord is built on top of NHibernate so I can get a bit of a low down on how NHibernate works too. I'll have to get to grips with this NVelocity view engine thou... it seems easy enough when I follow the tutorials but they're obviously not that complicated! ;-)

So anyway, I got MonoRail and ActiveRecord working fine on my local machine by downloading the RC2 MSI installer from their site and creating a new project inside VS. But when I then tried to upload this site to my shared host (KiwiHosting), it spat out this exception:

[SecurityException: That assembly does not allow partially trusted callers.]

After some searching on the net I found this forum message that related to the exception. In there it said that I needed to compile it again from the source files, but this time allowing support for shared environments (partially trusted).

So I then downloaded the source code to do this build and then found that I had to use NAnt to build it, so I went and got that too. To build castle with support for shared environments you must run this:

nant -D:assembly.allow-partially-trusted-callers=true

But when I ran that line I would get a build error like this:

CastleKey.snk missing

Cannot find 'CastleKey.snk' huh? Hmmm... I remembered that inside the 'How to buil.txt' file that came with the source you could add '-D:sign=false' to compile a version that wasn't strongly signed. So I tried that... it seemed to get a bit further but again didn't make it.

After some more searching I found a site (can't find it again today) that said you can't actually build it without the 'CastleKey.snk' file and that it was inside the Castle Subversion Repositry. So I checkout the repository to my local machine and finally the build worked! Then replaced all my references within VS, did another build of my own site, uploaded it and voila! Castle was working on my shared hosting environment!

So, just to recap on the process required to get castle up and running on a shared hosting enviroment1:

  1. Check out the Castle Subversion repositry to a local directory. Note: Make sure there are no spaces in any of the directory names, eg. C:\Program Files\Castle\repo won't work.
  2. Download NAnt (was at version 0.85 at time of writing) and extract the files to your hard drive.
  3. Add the bin directory for NAnt to your 'Path' system variable2.
  4. From the command prompt inside your Castle Subversion repository directory type:
    nant -D:assembly.allow-partially-trusted-callers=true
    All the compiled assemblies can now be found in a build directory under your castle subversion repository.
  5. Create a new blank project inside VS and add references to the following freshly compiled assemblies.

    For MonoRail:

    1. Castle.MonoRail.Framework.dl
    2. Castle.MonoRail.Framework.Views.NVelocity.dll
    3. Castle.Components.Binder.dll
    4. Castle.Components.Common.EmailSender.dll
    5. Castle.Core.dll
    6. NVelocity.dll

    For ActiveRecord:

    1. Castle.ActiveRecord.dll
    2. Castle.DynamicProxy.dll
    3. Iesi.Collections.dll
    4. log4net.dll
    5. NHibernate.dll
  6. Unless you can convince your hoster to map .rails extensions to the ASP.Net ISAPI you should also edit/add this to your web.config file with this:
<httpHandlers>
    <add verb="*" path="*.ashx"
        type="Castle.MonoRail.Framework.MonoRailHttpHandlerFactory, Castle.MonoRail.Framework" />
</httpHandlers>
  1. Now you have to make sure all your files link to the ashx extension.

I think thats about all there is to it... Bring on RC3!

1 This excludes a lot of the general setup for a castle project, including a lot of the web.config settings. Visit the castle home page and go to 'getting started' to find out more.

2 If you don't know how to do this I explained this in my last post in regards to adding the svn bin directory to the 'Path' system variable.

Technorati Tags: ,