... in the final version of .net framework 4, this problem still isn't solved. instead, FrameworkDir is set to TargetFramework20DirectoryItem if $(FrameworkDir) is empty. I cannot see where $(FrameworkDir) is set initially, except for build scripts.
But even if it was nonempty, it should be set to TargetFramework40DirectoryItem, because .net framework 4 brings new binaries like regasm.
please correct this in the next version or correct me, if my assumption is wrong.
... Just installed the Release Candidate. the problem was not corrected.
the Property FrameworkDir in the "C:\windows\Microsoft.NET\Framework\v4.0.21006\Microsoft.Common.targets" file ist set to @(_TargetFramework20DirectoryItem).
this makes no sense if you want to develop for the 4.0 .net platform and use e.g. regasm as a prebuild-command, as i did.
Just don't forget to correct it in the final, and maybe notify it somewhere.