Why can't I add code to my project?

Every time i try to add code to my project in UE4 i get this error message : Failed to add class X. Failed to generate project files. I have look at my Windows environmental variable VSCOMNTOOLS and it seems to be pointing in the right place.
I try to add code this way:

  1. Create New Project with blank template.
  2. File → Add code to project → Chose any parent class and they all fail.

The file gets created but i receive the error message and then it tells me that I already have a class with this name.

I have VS 2012 Ultimate.

Hi SwampGerman,

Visual Studio 2013 is required for development. Please view these documentation pages for additional information:

Cheers