Getting started with Umbraco, again

I used Umbraco back in 2011 to market the commercial software I solely developed. the main reason I chose it was due to the flexibility of being able to customise and integrate just about anything. Back in 2011 though MVC3 and Razor was only just new and Umbraco had just started implementing the Razor engine into the product. It was a bit clunky and messy and to do something required Webforms approach but otherthings needed MVC.

It is good to see how far Umbraco has come in 5 years. MVC is now the first class citizen and it is alot more fluid to modify and create content.

One thing I did find which I also experienced the first time was the steep learning curve to get started. Here is a couple of tips for those looking to start using Umbraco.

Get the install right

Documentation is still a bit piecemeal for Umbraco which is quite unfortunate. I am sure the Umbraco TV has some good content in it but for a sole developer the starting costs are just too high to justify. The method I chose to install Umbraco onto my SmarterASP hosting was to start up a fresh VS project and use Nuget to get the latest Umbraco package. Then use WebDeploy to publish the application.

This sounded good and simple to start with, however, as I found there is a couple of things that can come unstuck.

When publishing the site, you will find that Visual Studio will give you an error of

The 'Connection String' argument cannot be null or empty.

So, simple enough, we need to have a connection string in the web.config. So lets add that

	<connectionStrings>
		<remove name="umbracoDbDSN" />
    <add name="umbracoDbDSN" connectionString="server=<server>;database=<database>;user id=<dbuser>;password='<dbpass>'" providerName="System.Data.SqlClient" />
	</connectionStrings>

Done, now publish and we find that it will take a while but eventually get there, keep in mind that you may get an error

Retrying the sync because a socket error (10054) occurred Retrying operation 'Serialization' on object sitemanifest (sourcePath). Attempt 1 of 10.

​If this comes up it is most likely that your internet upload is a bit slow and it is timing out or dropping the connection. There is nothing you can do other than hope your connection improves.

Now, we have published out site, in my case I immediately got a 330 error ERR_CONTENT_DECODING_FAILED

This was due to the fact that SmarterASP was trying to compress it however the page data wasn't compressed. You can either turn off Compression on the web host or turn on Compression in the web.config, for me I just turned compression off on the server.

Next issue, now the installer screen is blank with the logo top left and a scrolling progress bar at the bottom.

Looking at the scripts it appears Umbraco is failing, turning on detailed errors I see this

/install/api/GetSetup

{"Message":"An error has occurred.","ExceptionMessage":"Invalid object name 'umbracoUser'.","ExceptionType":"System.Data.SqlClient.SqlException","StackTrace":"   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)\r\n  ... }

Interesting... so it seems that to WebDeploy the Application you have to have a connection string, however, if Umbraco sees a connection string it assumes an upgrade and tries to get data from the existing Db, however this is a fresh install which leads to a failure.

So, the answer, clear the connectionString and providerName from your deployed web.config, this will make the installer go back to a fresh install.

Use a starter kit or better still buy a template

Yes, we are developers, designers, IT gurus, but sometimes, it is just simpler to have an example to get familiar with how to approach using a framework.

In my case, I looked around and came across the Source template from uSkinned. Although the price seemed a bit high, I decided that even if it only saved me 4 hours of work it would be worth it. I don't regret my purchase, the template was well featured and the package was clean and well organised making it easy to use as boiler plate for my own customisations. I easily saved 4 hours, probably more like 40 hours so it paid for itself many times over. I also sent through some questions about how best to customise it and got a prompt and detailed response. So thumbs up to Paul and the team at uSkinned.

Work with the framework

One thing I find developers do is they work against a framework. Lets face it, we all want the framework to do exactly how you think it should, however it is a framework, it has to handle lots of different use cases. So, pick a framework that will work as close to the way you wish to and then mold your practice to the design pattern the framework uses.

Umbraco is a very flexible framework which allows for a variety of different use cases, however it can come across a bit illogical if you approach it like Wordpress, as it doesn't have any real concept of a Page or Post. Overall, that is the thing I like the most about Umbraco is that it gives you some structure but leaves the data fields and layout up to you.

About the author

Michael Proctor is the owner of ALFWare and provides consulting/contracting services to the technology and mining industries.

comments powered by Disqus

Providing a powerful set a components across a diverse range of technologies you will find what you need for your next project whether it be WinForms, WPF, Silverlight, WinRT, Windows
Universal, ASP.NET WebForns, MVC Extensions or HTML5 Controls.

eXpress Application Framework (XAF) is a RAD style development platform based on their components.

CodeRush is a powerful IDE productivity tool which speeds up your development and makes you more efficient.