How to fix build error in Visual Studio: '“LC.exe” exited with code -1'

后端 未结 7 810
悲哀的现实
悲哀的现实 2021-01-04 01:14

I get the following error when building my Windows Forms solution:

\"LC.exe\" exited with code -1

I use two commercial Windows

7条回答
  •  暖寄归人
    2021-01-04 01:46

    Had the same problem. Could not build with licenses.licx (even if blank) and had 3rd party licensing problems without licenses.licx. This problem appeared after I upgraded Visual Studio from 2015 to 2019 and changed my .NET Target Framework Version from v4.5.2 to v4.7.2. To do further testing I ran the command (from the error message) in cmd at the location of lc.exe. I got no useful errors but noticed a version mismatch. I didn't have lc.exe for 4.7.2 installed. ("C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\lc.exe"). With some guidance from this answer, I installed the .NET 4.7.2 Developer Pack and could build with licenses.licx again.

提交回复
热议问题