How To: Fix error MSB3091 During MSBuild
Building Build Script for a customer I got the following error:
C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(1756,9): error MSB3091: Task failed because "LC.exe" was not found, or the correct Microsoft Windows SDK is not installed…….
It seems like “LC.EXE” was not found and I need to install “Microsoft Windows SDK for Server 2008 and .NET Framework 3.5” (Running build on server 2003 machine).
“LC.EXE” is the License Compiler comes with .NET Framework Tools so why the Build cannot find this file?
We can solve this small issue in couple ways:
1. You can try to reinstall Windows SDK or Install it – Link
2. Add the direction path to the registry:
Open “regedit” and goto HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v6.0A
Than add this key –> InstallationFolder=C:\Program Files\Microsoft SDKs\Windows\v6.0A\
Now Team Build have the right directions to Windows SDK files.
Hope this helps.