Skip to main content

Posts

Showing posts from July, 2009

Hosting .NET MVC on RackspaceCloud Cloud Sites

Last week I deployed a pet project (pun intended) of mine Borrow a Pet to the RackspaceCloudCloud Sites environment. So far I’m very pleased with the performance of the site, however I thought I would highlight a few areas you need to be aware of when developing/deploying .NET MVC apps to the Cloud Sites environment as their documentation right now is fairly light.

It should be said that the 24/7 Support team are fantastic, however I found myself having to use them a bit too often for my liking. The technologies/tools/components I used goes like this. .NET MVC for the Presentation Layer LINQ to Entities for the data layer SQL Server 2008 DatabaseThird Party Google Maps Wrapper for GeoCoding Unity for the IoC Container
Medium Trust
Believe it or not but in my eight or so years of .NET development I’ve never had to develop with Medium Trust in mind. Boy had I been spoilt. For more details on Medium Trust information go to the knowledge base.IIS7 Integration Mode
By def…

Windows Azure pricing announced, Cloud Computing pricing and feature comparison

Well the wait is over Microsoft have finally announced the Pricing for Windows Azure, thanks Darko for letting me know. Full post here.All in all there are no surprises and the pricing is pretty much on a par with other Cloud Computing providers. Let’s do a quick pricing comparison. Windows AzureAmazon EC2GoGridRackspaceCloudCloud Sites
From $100 / monthCompute Cycles$0.12$0.125$0.19inc 10,000 / month
$0.01 Inbound Bandwidth$0.10$0.10FREEinc 500 GB / month
$0.25 / GB Outbound
Bandwidth$0.10$0.17$0.50inc 500 GB / month
$0.25 / GB Storage / GB$0.15$0.10$0.15inc 50 GB / month
$0.50 / GBCDNN/A$0.17 / GBN/A$0.22 / GBFeature ComparisonWindows AzureAmazon EC2GoGridRackspaceCloud
Cloud Sites
IIS7YesNoYesYesSQL ServerNoYesYesYes24/7 SupportNoNoYesYesCDN SupportNoYesNoYesFull TrustYesYesYesNoAPINoYesYesYesAuto-ScaleYesYesNoYesServer ImagesNoYesNoNoLoad BalancingYesYesYesYesRDP AccessNoYesYesNo

Log Shipping in SQL Server Express 2008

When you entrust your Applications and Data to the Cloud Based Service Providers such as GoGrid and Amazon EC2 it becomes absolutely critical to employ a strict Disaster Recovery strategy. As part of of our strategy it was imperative that we have a failover for our SQL Server. The only problem was that SQL Server Express 2008 doesn’t support Log Shipping.
Well technically it does but SQL Server Express does not have SQL Server Agent. Now I’m a big fan of SQL Server, but when it comes to doing something a bit more complicated the Express editions limitations become a bit of a problem, that’s why it’s time to find creative solutions. To set up Log Shipping the first step is to Backup your database and then Restore it on another instance making sure set the Recovery state as “RESTORE WITH STANDBY”. See belowTo get this going you’ll need three stored procedures, one in the Master database and two in the slave database. Now when you are trying to do this across Networks and Hosting Pro…

Path resolved to Referenced activity Property does not match the Target Type, Workflow Foundation Designer Bug

Just this morning I got this really helpful error when trying to bind to a Custom Activities Dependency Property. Path resolved to Referenced activity Property 'MyProperty' whose PropertyType 'MyNamespace.MyCustomType ' does not match with the Target Type 'MyNamespace. MyCustomType'.Basically the error says you can’t bind a property of type Type1 to a property of type Type1. Makes sense really. Fortunately I was able to find some help on the InfoSupport blog.The suggested solutions were: 1. Clean Solution
2. Close Visual Studio and Reopen the Solution again
3. Go run %temp% and delete all files. In reality the only definitive fix for this is to Close Visual Studio and reopen the Solution again. Hopefully this will be fixed in Visual Studio 2010.

Official Borrow a Pet blog launched

I have recently launched the official blog for a pet (no pun intended) project of mine called Borrow a Pet. Borrow a Pet aims to solve a number of problems such as: Finding a pet sitter as an alternative to kennels Allowing would be pet owners the chance to experience the responsibility of owning a pet before they commit, thus reducing the number of abandoned pets.And many more. You can read all about it in the first post.

ReSharper for Visual Studio 2010 Preview Build now available

The second build ReSharper for Visual Studio 2010 is now available. You can get it from: http://www.jetbrains.net/confluence/display/ReSharper/ReSharper+for+Visual+Studio+2010+(Preview)Have just installed it and at first it wasn’t displaying but if you do the followingTools > Options > Extension Manager > Select "Load extensions from my local application data folder"
Then close and reopen Visual Studio it should work. Going to take it for a test drive. Thanks heaps to the ReSharper team for making this available, Visual Studio seems so primitive without it. UPDATE: When I put my current 4.5 license it says the license is “not acceptable”. Does anyone know what license to use? UPDATE: See below comment, a temporary license is available from the Nightly Build Page see the Known Issues section at the bottom.

The role of Mocking in TDD, Test First with Rhino Mocks, KandaAlpha

Recently I got into a healthy discussion with Keith Patton about Constructor Injection and other such topics to do with Test Driven and Domain Driven Design. One way or another this lead to the birth of Kanda Alpha with the goal of demonstrating best practice domain driven design utilising Visual Studio 2010 Beta, ASP.NET MVC 1.0 and Db4o as the data store. I’ve decided to give an explanation as to the benefits of Mocking and the Test First approach. Mocking quite simply allows you to test components in isolation from their dependencies. By mocking out the results and behaviour of the dependent components you can focus on verifying the behaviour of a single class. Where I’ve found it most useful is in designing the service layer and this is usually the first thing I design after hashing out the Domain Entities.

There has also been some comments on Keith’s blog about the purpose of the Service layer if all it is doing is acting as a Facade to the Repository. This is a valid point an…

Forcing a download prompt on files in Amazon S3

I have been battling with an ongoing problem with Amazon S3 for sometime now. It has to do with serving video or any other media content directly from S3 to the client. Currently we have two very simple, very standard requirements:1. Stream the video directly from S3 to Client 2. Download the video direct from S3 to Client (forcing a download prompt)Now if you upload a video directly to S3 then simply have a link on your page to the video. By default the video will stream down. This is normal behaviour but when you want to force a download prompt it gets a tad tricky. After some investigating and experimentation I found that you could set the Content-Disposition header at upload time. So I set was able to set this header using Bucket Explorer and it worked as expected. Problem solved? Not quite. Because the header information exists as meta data of the asset you can’t have a single asset served up two different ways. This is a documented limitation of S3 right now as outline…

Visual Studio 2010 Beta 1 – Bug when running unit test, There is no disk in the drive. \Device\Harddisk3\DR3

I just received this very cryptic error when running a Unit Test in Visual Studio 2010 Betadevenv.exe – No DiskThere is no disk in the drive. Please insert a disk into drive \Device\Harddisk3\DR3The only resolution was to restart Visual Studio. Has anyone else seen this?

Entity Framework, Sql Server 2008 why you should use DateTime2

If you’re using Sql Server 2008 with Entity Framework and have a DateTime field you have no doubt come across this error when Inserting or Updating an Entity System.Data.SqlClient.SqlException: The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value.The problem here lies in the fact that the .NET DateTime.MinValue equals 0001-1-1 but the Sql Server DateTime only covers 1753-1-1 through 9999-12-31 The very simple solution is to use DateTime2 in Sql Server 2008 which covers 0001-1-1 through 9999-12-31. DateTime2 has also has some other benefits.