Run Asp.Net MVC4 on Mono / MonoDevelop on Mac – The C# Template Project

I’ve been trying for a while to get this working. It all seemed so-near-and-yet-so-far. But here is the Visual Studio 2010 C# Asp.Net MVC4 Template Project which works on my Mac:
Visual Studio 2010 Asp.Net Mvc4 CS# Web Application Template modified for Mono

There’s a list of issues which frustrated earlier attempts but the above link is to a project that does build and run on my Mac. Things to make it work included:

  • Using VS2010 instead of VS2012 to generate the template. (So no version 4.5
  • Got the latest Xamarin Studio, previously known as MonoDevelop
  • My mono version says: Mono JIT compiler version 2.10.12 (mono-2-10/c9b270d Thu Mar 7 21:38:12 EST 2013)
  • There’s a list of potential issues to address described in this stackoverflow post, I think what I did was just:
    • Delete Microsoft.Web.Infrastructure.dll from the bin directory
  • I also removed Entity Framework References as that’s not yet done on the Mono.
  • At first I commented out the line AreaRegistration.RegisterAllAreas(); in global.asax.cs Application_Start because it caused an error which appeared to refer to Entity Framework but that might just have been because I had removed System.Web.DynamicData too, so I put DynamicData back in.
  • The bundling of styles didn’t appear to work but this turned out to be a ‘typo’ in the project template – or rather, the fact that Windows is mostly case-insensitive. App_Start/BundleConfig.cs referred to Site.css as site.css.
  • Having taking the ‘intranet’ template which uses Windows authentication, I changed the web.config line to . You may feel I should have used the ‘internet’ template instead of the internet one.
  • I included all the nugetted package dlls in the zipfile, except that I deleted the EntityFramework stuff.

Kudos to all who worked so hard to make MVC4 on Mono possible. And of course to those who made MVC4 possible at all.

Posted in Code | Leave a comment

Windsor DI with Asp.Net WebApi

There are contrary signals on the web regarding Window DI and the new-ish MVC-ish WebApi DependencyResolver. These posts seem to be the state-of-the-art as at 2013:

Posted in Code | Tagged , , | Leave a comment

Asp.Net MVC Project Guids

The famously unhelpful Visual Studio error message ‘The project type is not supported by this installation‘ usually means that there is something you don’t have installed. But it doesn’t tell you what.

You can work out what you’re missing if you know the Guids to look for in the project file. Look for a line near the top of the file something like this:

<ProjectTypeGuids>{E53F8FEA-EAE0-44A6-8774-FFD645390401};{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>

After which you can decode the Guid using either the table here:

Guid Tools Needed to Open Project Build references
{E53F8FEA-EAE0-44A6-8774-FFD645390401} Asp.Net MVC 3 System.Web.Mvc 3.0.0.0
{E3E379DF-F4C6-4180-9B81-6769533ABE47} Asp.Net MVC 4 System.Web.Mvc 4.0.0.0
{349c5851-65df-11da-9384-00065b846f21} Web Designer

Or the more extensive list at http://www.mztools.com/articles/2008/mz2008017.aspx. If you’re stuck try http://google.com/search?q=visual+studio+project+type+guid+list

Posted in Code | Tagged , | Leave a comment

Adaptable Design Up Front

ADUF
Adaptable Design Up Front
Adaptable Design Up Front
A term to describe the idea of (1) avoiding Big Design Up Front (2) doing Enough Design Up Front and (3) recognising that for agile development that up-front design must very specifically be a design that caters for future change. First coined as far as I know in a blog post by Hayim Makabee.
Posted in Code | Leave a comment

Doing Architecture with Agile Teams

Alan Gawthorpe & I a talk last month on doing architecture with agile teams:

We did the session agile-style: We had cards for our topics, and the ‘customers’ in the audience prioritised. I think it worked okay, it would probably go smoother doing it a second time. Some of the significant books & articles that went into the slides were:

Agile Methodologies for the Enterprise

* Scott Ambler & Mark Lines – Disciplined Agile Delivery
* Scott’s whitepaper on Agile@Scale

What does a technical architecture for agile look like?

* Coplien & Bjørnvig, Lean Architecture for Agile Software Development
* Poppendieck & Poppendieck, Lean Software Development: An Agile Toolkit
* http://alistair.cockburn.us/Walking+skeleton

The further reading list

* George Fairbanks, Just Enough Software Architecture
* The UK government’s national audit office report on Agile Governance
* http://www.disciplinedagiledelivery.com/
* http://en.wikipedia.org/wiki/OpenUP

Posted in Code, working life | Tagged , | Leave a comment

Visual Studio 2012 Command Prompt Here

Something I always want with VS projects: The ‘Command Line here’ menu option within Visual Studio; and the ‘Visual Studio Tools Command Line here’ option in Windows explorer. So here they are for VS2012.

NB: that the Explorer right-click works when you right click on a folder icon but not, sadly, when you right click on empty space. If anyone has a solution for that I’ll be glad to know.

Windows Explorer “VS2012 Command Prompt Here” Right-Click Menu Item

To add a Visual Studio 2012 Command Prompt Here to your Explorer Right-Click menu, save this as a .reg file to your desktop, and then run it:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Command Line VS2012]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Command Line VS2012\command]
@="cmd.exe /k echo on & pushd \"%1\" & \"C:\\Program Files\\Microsoft Visual Studio 11.0\\VC\\vcvarsall.bat\" x86"

If you have 64-bit Windows, you might want:

Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Command Line VS2012]
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Command Line VS2012\command]
@="cmd.exe /k echo on & pushd \"%1\" & \"C:\\Program Files\\Microsoft Visual Studio 11.0\\VC\\vcvarsall.bat\" x64"

Visual Studio 2012 External Tools Command Prompt Here Menu Item

In visual studio choose TOOLS – External Tools. Press Add to add a new command with fields as follows:

Title: Command Line Here
Command: %COMSPEC%
Arguments: /K "%VS110COMNTOOLS%\VsDevCmd"
Initial Directory: $(ItemDir)

i.e.:

Visual Studio External Tools Command Line Here VS2012 Dialog Box

Sorted. You can add shortcut key to via TOOLS – Customize – Keyboard and setting a shortcut key for Tools.ExternalCommand{X} … but you have to work out by counting what number your {X} is.
Visual Studio Customize Keyboard Tools.ExternalCommandX Dialog Box

Posted in Code, Computers | Tagged , , | Leave a comment

WCF on .Net 4.x ReST Service with IIS 7 or 8 = HTTP Error 404.17

So my newly created WCF ReST service (or webHttp service, as MS more accurately like to call it) runs fine in Visual Studio 2012, using IIS Express. But when I switch to IIS proper (in my case, IIS8 on Windows 8) I get:

HTTP Error 404.17 – Not Found
The requested content appears to be script and will not be served by the static file handler.

Most so-far extant posts on how to fix this, refer to how to fix it for .Net 3 on Windows before Win8: Use "%WINDIR%\Microsoft.Net\Framework\v3.5\Windows Communication Foundation\ServiceModelReg.exe" to register or to repair registration of WCF components. (The other gotcha being, having the right AppPool settings for .Net version & for 32 vs. 64 bit).
This doesn’t work for Windows 8 / .Net 4.X. Instead you must open the control panel “Turn Windows Features On or Off” and tick the box for Http activation:

Windows Features - Windows 8 - Net45 - WCF - Http Activation Tickbox

Windows Features – Windows 8 – Net45 – WCF – Http Activation

Which should fix the issue after a couple of minutes.

Posted in Code, Computers | Tagged , , , , | Leave a comment

Basic SEO and the stuff we do for friends (looking at you, Rachel Kevern!)

A friend of name, a teenage actor, asked me about SEO stuff earlier today. She has a website and was concerned it wasn’t rising up the rankings very well.
Using a third party website site doesn’t give you a huge amount of control but the basics are the same under any circumstances: You need a page with information on the topic at hand; and you want other websites to link to it. It also helps if you have a name like Rachel Kevern – shared by only a handful of other people in the world ;-)

Rachel Kevern

This year I’ve seen Rachel acting & singing in Les Miserables and also saw her singing last night as part of The Voice. Which was excellent! She just got the role of Vi, the Reverend’s wife, in Footloose, which will be showing at the Z-arts centre in Hulme later this year. Find her at http://rachelkevernactor.wix.com/rachelkevern.

Posted in Other, working life | Leave a comment

Agile Adoption

If a team or organisation wants to adopt agile, should they do it all in one, or gradually? How do you overcome problems in agile adoption?

Agile Principles when Adopting Agile

Agile is not about process and methodology; it’s about people, relationships and learning and so turns out to be very much democratic and consensus based. Effective adoption presupposes that you’ve got the team(s) on board; if you have to impose agile, you’re probably doing it wrong. You can’t adopt faster than your teams and individuals are motivated to adopt.

If you apply the agile manifesto to the project of ‘adopt agile’ then you’d adopt agile incrementally, of course. I suggest an obvious principle: You can’t adopt faster than you can learn.

Agile’s take on organisation & adjustment is that teams self-organise with regular reflection, which enables you to see what’s not going well and consider ways to correct. There is no learning without feedback. Adopt incrementally with regular reflection and adjustment.

Agile teams puts work items in priority order, in to deliver the greatest business value first. Look at your current pain points – what’s not working well – and find out which practices are found to address them. Prioritise changes which add most value.

Risk management is arguably a missing subject in agile, so let’s add that here: soberly consider what, at this stage, you are capable of adopting successfully. First adopting practises you’re capable of to maximise your chance of early success. The choice to deliver value or to attack risk first is a judgement call. When you’re doing something new the risk of failure is high, so that judgement is largely about knowing how new to your team(s) the changes you’re making really are.

Finally, agile starts with the vision of a wider community learning. Any fool can learn from their mistakes but the wise learn from others’ mistakes too. In the past 10 years, others have already tried out all the mistakes for you. Call in someone in who’s done it before.

Posted in Code, working life | Tagged | Leave a comment

Software Architecture for Agile Developers – xp-manchester April 2013

A fine time was had by all …

Posted in Code, Computers | Tagged , , | Leave a comment