Problem: Trying to run msbuild.exe against a .sln file results in a failed build with an error message containing the error
error CS1668 : Warning as error : Invalid search path 'C:\Program Files\Microsoft SDKs\Windows\v6.0A\lib'
specified in 'LIB environment variable' -- 'The system cannot find the path specified. '
Examining the path C:\Program Files\Microsoft SDKs\Windows\v6.0A shows no \lib folder present.
Solution: Simply add an empty \lib folder. MSBuild doesn’t actually need anything in the SDKs folder for most builds; however, the vsvars32.bat file sets that directory as the LIB environment variable anyway.
This hacky fix has worked for me on a number of different systems and I’ve yet to run across any real issues. I’m blogging it here so I’ll remember next time without having to spend too much time searching…