Skip to main content

Glenn Wiley's Blog

Go Search
Home
About Me
  

Glenn Wiley's Blog > Categories
Getting your ASP.NET MVC application running on a 3rd party host

I have a personal website hosted by Webstrike Solutions.  Their responsiveness to any technical questions I've had is amazing.  I would be happy to get a reply within a business day...these guys respond within an hour quite often.  So, my website is hosted on Windows Server 2003 running IIS 6.  If you need to know how to configure your ASP.NET MVC application to run under IIS 6, check out Phil Haack's excellent post here.  First thing I did was email a request to Webstrike to set up an application extension mapping for .mvc to the aspnet_isapi.dll.  After that was done, I set up a very basic ASP.NET MVC site (which, by the way, if you want a clean, no-frills setup, check out this post from Guy Burstein).  All I needed to do next was upload the files to my web server and see if it worked.  One thing I initially forgot is that the web host likely doesn't have ASP.NET MVC installed on the server, so be sure to upload the System.Web.Abstractions.dll, System.Web.Mvc.dll and System.Web.Routing.dll files to your bin directory.  Once I did that, I was greeted with my Hello, World message from my shell application.  Now to add some meaningful content...

On taking the 70-536 Exam

I just took the 70-536 exam (Microsoft .Net Framework - Application Development Foundation) and I have to say it was disappointing.  I've read about this exam being rather nefarious.  I signed up for the free second shot, so my strategy was to take the exam cold without studying, and if I pass great, if not, I'll know what to study before I re-take it.  By my calculations I was within a question of passing - close, but no cigar.  The exam questions I got really didn't seem appropriate for what I'd expect from an overall .Net development foundational exam.  The questions I got were focused very heavily on globalization and security - important, but there are other foundational concepts I expected to be given equal treatment.  I think what I liked least about this exam is the number of questions focused on something that I personally have had little to no experience in, and will likely not utilize.  I did very well on the globalization and security questions, but my weak areas were "embedding configuration, diagnostic, management, and installation features into a .Net application" and "Implementing serialization and input/output functionality in a .Net framework application."  This was very much a surprise to me.  I would've expected those two areas to be stronger for me because I've had more experience there.  After all, what application doesn't deal with configuration management, diagnostic management and installation features?  Oh well.  I'd say a lot of the questions were bordering on being trivia questions, or just doing something in a completely different or unusual manner.  As with most MS exams, it's a bit of a game anyway.  There are usually one or two answers that are totally ridiculous, and then out of the other two, they may both look feasible, but even if one appears more correct, it just doesn't quite sit right because it's not the most straightforward or sensible answer.  It'd be nice if these exams were fill-in-the-blank.  No multiple guess - either you know it or you don't. 

Getting up to speed on NHibernate

I've been wanting to get up to speed on NHibernate for awhile, even more so now that most blogs I read have at some point mentioned the expected demise of LINQ to SQL.  I've been working on an ASP.NET MVC website in which I began using LINQ to SQL for a data provider, but have decided to utilize NHibernate instead.  I've been watching a series of screencasts put together by Steve Bohlen which can be found at http://www.summerofnhibernate.com/.  These are some of the best screencasts I've had the pleasure of viewing.  I've played around with NHibernate a little before, but have always found it a bit overwhelming to sift through the vast amount of material out there.  I was delighted to find these screencasts, which provide a great overview of NHibernate's features.  I greatly appreciate folks who dedicate their time to put out material like this and I've made a donation to show that appreciation.  I always make it a point to give some sort of donation towards the open-source applications, free training materials, etc. that I utilize and would encourage others to do the same.

Mocking TempData in ASP.NET MVC

So I've been following along with Rob Conery's awesome series on creating an e-commerce application in ASP.NET MVC (http://www.asp.net/learn/3.5-SP1/#MVCStorefrontStarterKit) and found myself having trouble mocking TempData.  After searching online, a couple of posts that really helped me out with this were on Eilon Lipton's Blog (http://weblogs.asp.net/leftslipper/archive/2008/04/13/mvc-unit-testing-controller-actions-that-use-tempdata.aspx) and I have also made use of the code provided by Stephen Walther in his recent blog post on making fake http context objects for use in unit testing (http://weblogs.asp.net/stephenwalther/archive/2008/06/30/asp-net-mvc-tip-12-faking-the-controller-context.aspx).  From the information gathered in those two blog posts, I was able to do the following to get my unit test to pass and my code working.

image

And the code in the controller:

image

Once I added a session item using the __ControllerTempData key, I was able to set the TempData on the fake controller.  Before that, I was getting a null reference exception because TempData didn't exist in my fake controller context.  Now I can happily go to bed :)  I just feel dirty calling it day when one of my unit tests isn't passing.