visual-studio 如何修复 Visual Studio 中的构建错误:'"LC.exe" exited with code -1'
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34284/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to fix build error in Visual Studio: '"LC.exe" exited with code -1'
提问by Stefan Haubold
I get the following error when building my Windows Forms solution:
构建 Windows 窗体解决方案时出现以下错误:
"LC.exe" exited with code -1
“LC.exe”以代码 -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.
我使用两个商业 Windows 窗体库:Infragistics 和来自 plexityhide.com 的 Gantt-Control,这就是为什么我的 WinForms 项目中有 licenses.licx 文件的原因。我们还使用 Visual Sourcesafe 作为我们的源代码控制。
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.
当 licenses.licx 文件在项目中时,我无法在没有上述错误的情况下进行构建。但是,当我将它们从我的项目中排除时,构建工作正常。但是当我想在设计器中使用商业控件时,我需要 licenses.licx 文件。
This is a brand new developer machine with Windows XP SP3 (German) and Visual Studio 2005 Team Edition for Software Developers (German) with SP1.
这是一款全新的开发者机器,带有 Windows XP SP3(德语)和 Visual Studio 2005 Team Edition for Software Developers(德语)SP1。
It's Windows XP 32-Bit by the way.
顺便说一下,它是 Windows XP 32 位。
Any suggestions?
有什么建议?
采纳答案by Stefan Haubold
I reinstalled Infragistics and that seems to have fixed it.
我重新安装了 Infragistics,这似乎已经修复了它。
回答by rahul chavan
Problem mainly arises due to license file. Exclude the file licenses.licxfrom your project
问题主要是由于许可证文件引起的。licenses.licx从项目中排除文件
回答by jfs
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.
我们在上一个项目中经常遇到这个错误。解决方案是重新安装库,因为我们使用的是试用版。当库到期时会发生这种情况。
回答by Timbo
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.
以前我遇到LC.exe的问题,很多时候是因为授权组件升级了(版本号增加了),但是licx文件还是老版本。
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.
在这种情况下,您可以尝试手动更新 licx 文件中的版本,或者将其更改x.y.z.*为仅用于进一步更新。您还可以尝试通过删除它并将获得许可的 Windows 窗体控件重新插入到您的窗体中来重新生成 licx 文件。
回答by alessandro
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.
似乎问题是由于更新控件造成的。licenses.licx 包括 .net 控件的第 2 版。它可以删除版本 2 的行(版本控制后)。其他时候以这种方式工作:添加一个空表单,然后插入导致问题的控件。
回答by vezenkov
There should be a license.licxfile in the properties folder when you use commercial components. It is often corrupted. If you clean its contents, the "LC.EXE" exited with code -1disappears.
license.licx使用商业组件时,properties 文件夹中应该有一个文件。它经常被损坏。如果你清理它的内容,它就会"LC.EXE" exited with code -1消失。
回答by cjspuy
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 Packand could build with licenses.licxagain.
有同样的问题。无法构建licenses.licx(即使是空白的)并且没有licenses.licx. 在我将 Visual Studio 从 2015 年升级到 2019 年并将我的 .NET 目标框架版本从 v4.5.2 更改为 v4.7.2 后,出现了这个问题。为了做进一步的测试,我在 cmd 中的 lc.exe 位置运行了命令(来自错误消息)。我没有遇到任何有用的错误,但注意到版本不匹配。我没有安装 4.7.2 的 lc.exe。(“C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.7.2 Tools\lc.exe”)。根据这个答案的一些指导,我安装了.NET 4.7.2 Developer Pack并且可以licenses.licx再次构建。

