I have a VS 2012 web project /sln that I am trying to build in TeamCity. it uses .NET 4.5 which is installed on TeamCity.
The TeamCity server has VS 2010 in
Alternatively, you can copy the build targets you need from the c:\Program Files (x86)\MSBuild to a subdirectory of your project (for example .\Build) making sure to preserve structure and add the following to your csproj:
..\Build\
For example, if my project root is C:\Dev\MyProjSln\MyProj
Personally, I prefer this method of tracking build target dependencies, as it prevents build server from being dependent on having undocumented folder structure requirements, and gets your dependencies into source control