How is the value of $(""MSBuildBinPath"") determined for IDE scenarios?
For ""Pre Beta 1""
The value of ""MSBuildBinPath"" is determined based on the directory where ""MSBuildEngine.dll"" is loaded from. The way Visual Studio (and related ""SKUs"" such C# Express, etc.) loads ""MSBuildEngine.dll"" is by using the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\CLSID\{C769EE8D-B17C-4A81-88F6-C8E4FBD54377}
[CodeBase]
Whatever path is specified in the ""CodeBase"" value is the path where VS will expect to find all of the ""MSBuild"" assemblies as well as the .TARGETS files.
For Beta 1 and beyond
Visual Studio is responsible for "telling" ""MSBuild"" the value of ""MSBuildBinPath"" to use. The way VS figures it out is by looking in the following registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0\MSBuild
[MSBuildBinPath]
Other Visual Studio ""SKUs"" (e.g., C# Express) also have the same registry lookup mechanism, but under their own registry hive. Just replace the word ""VisualStudio"" in the above registry key with the appropriate root key for the SKU you're using.
Followup: Why this mechanism? Why can't ""MSBuild"" figure out the value for ""MSBuildBinPath"" on its own?
Answer: Good question. ""MSBuild"" used to call ""Assembly.CodeBase"" to figure out where the binaries were running from. But starting with the Beta 1 release, ""MSBuild"" assemblies are installed into the GAC. Therefore, ""Assembly.CodeBase"" would return us the GAC'd path, and this is not useful for the ""MSBuildBinPath"" property, because ""MSBuildBinPath"" is used to located our .TARGETS files, which are of course not in the GAC.