As part of an ongoing project that I am working on, which involves a ASP .NET MVC 3 web site and a  standard .NET client, I needed a way in which I could expose a single API that would accept/return JSON objects.

I had a think about various different approaches to this, where I could use

I have used both of these before, but they do have their issues, such as needing an extra communications port to be open.

I thought to myself Now I have a web site, a nice ASP .NET MVC 3 one, so surely there is a way that I can use that for my JSON API which would serve both jQuery based web calls, and also the desktop client, which would make use of one of the many standard .NET web classes.

In the end I did just that, and have written about one approach that allowed me to create a JSON based API that is shared by both jQuery based calls and is also able to be called directly from a .NET exe.

I talk about my thoughts/end results in the following codeproject article: