You should pass the following argument to MSBuild:
/p:VisualStudioVersion=11.0 /t:Rebuild;Publish
This tells msbuild to use VS2012 targets.
Passing VisualStudioVersion
is required hence VS2010 and Vs2012 can share the same project file: i.e. project file does not store target VS version inside itself