Open Visual Studio 2012.
Go to File-Open-Project/Solution, locate the file you want to upgrade. (let it do the normal upgrade)
Close the project and save changes.
Open the *.csproj file in Notepad or some other type of text editor.
Change the TargetFrameWorkVersion element from v3.5 to v4.5
Add the TargetOfficeVersion element below the TargetFrameworkVersion element
Save the file and open the project again in Visual Studio 2012
If you need a more detailed explanation, see this guys post.