Using RavenDB with ASP.NET MVC 4

Some people might have wondered why I used ASP.NET MVC 3 in my previous blog post. The reason is that the RavenDB.Client package uses Newtonsoft.Json and ASP.NET MVC 4 also has a dependency on Newtonsoft.Json. In itself this isn’t a problem except that RavenDB requires Newtonsoft.Json version 4.0.8 and ASP.NET MVC 4 ships with a much newer version of Newtonsoft.Json, to be exact version 4.5.6. The result is that trying to Install-Package RavenDB.Client produces the following error: Install-Package : Updating ‘Newtonsoft.Json 4.5.6′ to ‘Newtonsoft.Json 4.0.8′ failed. Unable to find a version of ‘Microsoft.AspNet. WebApi.Client’ that is compatible with ‘Newtonsoft.Json 4.0.8′. … Continue reading Using RavenDB with ASP.NET MVC 4

Visual Studio 2012 and NuGet packages

  Last year I wrote about installing missing NuGet packages and Visual Studio projects. That works well but it does require using a command line version of NuGet.   It turns out that this has become a lot easier in VS2012 and is supported natively from within Visual Studio.   Enabling support The first step is to enable the feature as it is disabled by default. This setting lives under Options -> Package Manager -> General.   Restoring missing packages from a VS2012 solution Assuming you have to restore missing packages for a solution the first thing is to enable … Continue reading Visual Studio 2012 and NuGet packages

DotNed podcast: Patriek van Dorp over NuGet packages voor Windows Azure

In deze podcast spreekt Maurice de Beijer met Patriek van Dorp over zijn TechDays presentatie over NuGet packages voor Windows Azure. Links: Blog: http://patriekvandorp.net TechDays presentaties: http://www.techdays.nl/AgendaDetail.aspx?cid=2271 Wazug: http://www.wazug.nl/ NuGet: http://nuget.org/ Presentatie met links naar de NuGet packages: http://static.techdays.nl/Speakers/Presentations/2012/Patriek van Dorp – NuGet For Windows Azure.pdf Met dank aan onze sponsor RedGate.

Client side support with the ASP.NET Web API

With REST there is not a lot required on the client as far as sending requests goes. As long as you can send HTTP GET requests you are good to go and there are very few programming stacks that don’t allow for some form of doing that. Of course just doing an HTTP GET is going to give you some data back and you still have to understand that data but that is an application specific issue. In order to make life even easier the ASP.NET Web API adds some client support in the form of the HttpClient class. But … Continue reading Client side support with the ASP.NET Web API

HTML5 feature detection aka Modernizr

Yesterday I blogged about using the new Server-Sent Events or the EventSource object to send messages from the server to the client. But what happens if I try to do this in a browser that doesn’t support Server-Sent Events? If I run the code from yesterday in Internet Explorer 9 I sill see the following error dialog: The reason is that IE 9 doesn’t support Server-Sent Events, see CanIUse.com, so it results in an Microsoft JScript runtime error: ‘EventSource’ is undefined exception HTML5 Feature detection In the old days if web development we used to check the browser the client … Continue reading HTML5 feature detection aka Modernizr

Using the WCF Web API in an ASP.NET MVC application

Warning: This post is based on a prerelease version of the WCF Web API   In my previous blog post I showed how to add to and use the new WCF Web API a console application using NuGet. Now that works but it is far more likely that you will want to be using IIS and host the REST service as part of a web application. So in this blog post I am going to show how to do the normal thing   I Created an ASP.NET MVC 3 app to host the REST service. Not that there is anything … Continue reading Using the WCF Web API in an ASP.NET MVC application

Adding the WCF Web API to a project

Warning: This post is based on a prerelease version of the WCF Web API   In my previous blog post I showed how to get started with the new WCF Web API but one thing I skipped is how to install and add it to your project first. So in post I am going to add that information.   The easiest way to get started is to use NuGet and add the WCF Web API package to your project. There are several different packages for the WCF Web API but  the one named WebApi.All is the easiest to get started … Continue reading Adding the WCF Web API to a project

Entity Framework 4.1 power tools

The EF team at Microsoft just release a first CTP of the EF 4.1 Power Tools making it even easier to do Code First development with an existing database. Guess it isn’t really code first in that case but database first   I did a quick test with an existing database, Northwind to be exact, and it worked pretty well. The only gotcha is you have to make sure the EF4.1 assemblies are available in your project otherwise you will receive the exception below. Adding Ef4.1 is easy though, just download the installer and install them or even better, just … Continue reading Entity Framework 4.1 power tools

Inversion of control and WCF

Lots of people like to use in inversion of control container, usually shortened to IOC, to inject dependencies into classes. The are lots of reasons for doing so but in the end they mostly boil down to separation of concern which makes thing more modular and thereby easier to reuse and unit test. When you start doing so manually injecting dependencies into a types constructor is easy enough but after a while this tends to become tedious and getting an IOC container to do this for you is a lot easier. The problem is that you don’t always control the … Continue reading Inversion of control and WCF

NuGet and projects under source control

NuGet is one of those awesome additions to Visual Studio that I wonder how I could have gone for that long without it. And as I am not the only one who likes it we had a bit of a discussion on Twitter last week about how to go about using NuGet with projects under source control that are shared by multiple users. The problem is nothing new and has been around forever. Basically the problem consists of you installing some assembly, adding a reference to that assembly in your project and using the types in there. So far so … Continue reading NuGet and projects under source control