Stefan Haubold
Stefan Haubold

Reputation: 666

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

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

"LC.exe" exited with code -1

I use two commercial Windows Forms Libraries: Infragistics and the Gantt-Control from plexityhide.com, that's why I have licenses.licx files in my WinForms Projects. We also use Visual Sourcesafe as our Source Control.

When the licenses.licx files are in the Projects I cannot build without the above error. However, when I exclude them from my projects the build works fine. But I need the licenses.licx files when I want to work with the commercial controls in the designer.

This is a brand new developer machine with Windows XP SP3 (German) and Visual Studio 2005 Team Edition for Software Developers (German) with SP1.

It's Windows XP 32-Bit by the way.

Any suggestions?

Upvotes: 23

Views: 44280

Answers (9)

Paraglider
Paraglider

Reputation: 9

In the yourproject.vbproj file there is a line to delete :

<EmbeddedResource Include="My Project\licenses.licx" />

Upvotes: 0

DYMATEJlb
DYMATEJlb

Reputation: 97

If deleting the licenses.licx file from the project does not help, then you can create a licenses.licx file with empty contents in the root folder of the project.

Upvotes: 0

cjspuy
cjspuy

Reputation: 49

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.

Upvotes: 1

Stefan Haubold
Stefan Haubold

Reputation: 666

I reinstalled Infragistics and that seems to have fixed it.

Upvotes: 5

alessandro
alessandro

Reputation: 21

seems the problem is due to updating the controls. licenses.licx includes version 2 of .net controls. it works deleting lines with version 2 (after versioning). Other times worked in this way: add an empty form, then insert the control that caused the problem.

Upvotes: 2

rahul chavan
rahul chavan

Reputation: 281

Problem mainly arises due to license file. Exclude the file licenses.licx from your project

Upvotes: 27

vezenkov
vezenkov

Reputation: 4145

There should be a license.licx file in the properties folder when you use commercial components. It is often corrupted. If you clean its contents, the "LC.EXE" exited with code -1 disappears.

Upvotes: 1

Timbo
Timbo

Reputation: 28050

Is there any more information in the error message?

When I had problems with LC.exe in the past, most times it was because the licensed component was upgraded (the version number increased), but the licx file still contained the old version.

In this case, you can try to update the version in the licx file manually, or change it to x.y.z.* to just work for further updates. You can also try to re-generate the licx file by deleting it and re-inserting the licensed windows forms controls into your form.

Upvotes: 3

jfs
jfs

Reputation: 16748

We frequently encounter this error from our last project. The solution is to reinstall the libraries since we're using the trial version. This occurs when the libraries expire.

Upvotes: 5

Related Questions