Cytanium is a site that provides the ability of best testing Microsoft Web Matrix. At least during the beta period its a free sign up, and free hosting that includes 10G of monthly bandwidth. You can host PHP as well as .NET (and MVC!) sites. You can download and work with the web matrix software which i haven’t got around to looking into yet, a quick look it seems to give you some templates for starting sites as well as deployment types. I am going to throw together a quick MVC site and go through the steps of pushing it to my Cytanium beta account from Visual Studio 2010 – just one of the many ways to publish your site. This tutorial assumes you are relatively new or a complete beginner to MVC – so those of you with more experience might find yourself skipping over a few bits. Part 1 of this tutorial will be simply creating our
First of all you want to register for your site with cytanium. The beta account comes with a single domain that you can work with, and since we are working with ASP.NET MVC2 – we are going to want to configure the site to be a .NET 4.0 site. In your control panel select web sites, select the actual site and then the extension tab and update Asp.net to 4.0 integrated.

Now onto visual studio. Fire up visual studio and create a new blank ASP.NET MVC application. This will start us with a mostly blank solution to work from.

To get us up and running we are going to take this blank solution add a quick controller and publish our site. In a future posting we can take this example and expand upon it by adding database functionality and other enhancements.
With our current blank solution if you were to debug the solution you would get a .NET error page, since the solution is empty with no controllers to work with. So lets fix that right now, and add a simple controller. Using the stereotypical “HelloWorld” approach we will make our “HelloController”.

Your controller starts out as the following:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace SampleApp.Controllers
{
public class HelloController : Controller
{
//
// GET: /Hello/
public ActionResult Index()
{
return View();
}
}
}
We’ll update the Index action to simply pass in our message to the view.
public ActionResult Index()
{
ViewData["Message"] = "Hello World!";
return View();
}
If you were to hit debug at this point we would still get our .NET error page, EVEN if you try and route the request to the proper controller (/Hello/) because we have not set up the view yet – so let’s get that out of the way. Right click on the “View()” in our Index action and select “Add View” just leave the default name “Index” and since we didn’t create a master page uncheck the “Select Master Page” checkbox. Your new view will be created and on your screen to edit
Our final step in creating our simple site is we want to display the data provided from the controller in our view. So in the empty div in the the controller we simply want to add in the proper code to display the “Message” we provided in the controller above.
<%=ViewData["Message"] %>
If you debug your solution you will still get an error page – however if you route your request to our controller by adding /Hello to the url in our browser you will have a working page with the message we included in the controller. At this point we have a working (extremely bare bones) site that we could push up to our cytanium hosting. We might want to make one final tweak so that the route page actually loads this controller – because our visitors are not going to know to load /Hello in order to view the real site. You can do this by simply updating our routes by editing Global.asax.
Visual Studio all ready did the work for us if we had named our controller “Home”, but since we didn’t and do not have a “Home” controller we can simply tweak it to fit our needs. We need to modify the route shown here
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
We simply need to update “Home” to be “Hello”
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Hello", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
Hit debug and you will see that now when loading the root url our message is all ready displayed. Now we are ready to take the next step and actually publish this site to cytanium! Cytanium was nice enough to email you an email with a vast number of ways to push your site to your hosting plan when you activated your account. I have been using the visual studio publish feature so far, and what I will be explaining in this (and possible future posts). One huge benefit to this is the ability to do web.config transforms. So when you have a local, staging, test, and production environment you can easily update all the settings in your web.config for each of those servers without having to hand edit them for each server…etc. It’s and awesome feature to leverage in my opinion.
Now to prepare our solution for publishing we want to select “Release” from our build menu (its not required, but generally you want to push any live site in a release mode obviously). There are some configuration settings in the project properties that we can review at a later time, however using the defaults (and a project without a database to transfer) we are able to simply take the next step and configure our publish settings using the details provided in that setup email from cytanium .
Then in solution explorer right click on the “Sample App” project node and select properties, this will give us the configuration settings for the project – and where we need to configure our publishing settings. Once this tabbed view is loaded, you want to select the “Package/Publish Web” tab.

The following was provided to us in our activation email
Visual Studio 2010
Publish method: Web Deploy
Service URL: https://webmatrix01.cytanium.com:8172/MsDeploy.axd
Site/application: davidlarrabee.webmatrix01.cytanium.com
Allow untrusted certificate (check)
User name: ***************
Password: ***************
Fill out your service url, site/application, username and password. Make sure you also check the “Allow untrusted certificate” checkbox. Hit the publish button, and if all goes well you should receive a successful message AND your new site will be live at the cytanium url provided in the “Site/application” item above.