运行项目的 MSBuild 脚本时,我收到以下错误:
Properties\licenses.licx(1): error LC0004: Exception occurred creating type 'Infragistics.Win.UltraWinEditors.UltraNumericEditor, Infragistics.Win.UltraWinEditors.v5.2, Version=5.2.20052.1028, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb' System.ComponentModel.LicenseException: Unable to locate license assembly.
Properties\licenses.licx(2): error LC0004: Exception occurred creating type 'Infragistics.Win.Misc.UltraGridBagLayoutManager, Infragistics.Win.Misc.v5.2, Version=5.2.20052.1028, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb' System.ComponentModel.LicenseException: Unable to locate license assembly.
Properties\licenses.licx(3): error LC0004: Exception occurred creating type 'Infragistics.Win.UltraWinEditors.UltraCheckEditor, Infragistics.Win.UltraWinEditors.v5.2, Version=5.2.20052.1028, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb' System.ComponentModel.LicenseException: Unable to locate license assembly.
我的机器的 Infragistics 许可证似乎有问题。
我的解决方案中有有效的许可证文件,那么是什么导致了此问题?
有一个更简单的解决方案:将 license.licx 上的构建操作设置为 None。
只需将构建编译更改为任何 CPU 即可轻松得多,然后就完成了! 它会毫无问题地运行。
确保许可证编译器 (lc.exe) 可以找到 Infragistics 程序集的位置。另外,如果您最近更新了组件,请确保不存在具有不同版本号的多个副本。最后确保您尝试使用的版本与licenses.licx文件中的版本相同。
刷新 licenses.licx 的一个简单方法是打开表单设计器,添加 Infragistics 组件并将其删除。
如果由于某种原因,licenses.licx 文件没有刷新,您可以尝试先删除有问题的条目,然后刷新它。
每次在存储库中找到文件时,我都可以通过清除文件内容来解决该问题。
例如,在DevOps管道中的批处理文件中,在获取最新的源代码后,该脚本清空文件的内容。
:: CD current_project_dir
:: reset licenses.licx files
:: reference: https://github.com/augustoproiete/EmptyLicensesLicx
for /f %%a in ('dir licenses.licx /s /B') do (
type nul > %%a
)
如参考站点中所述,构建步骤期间不需要
licenses.licx
,仅在开发/IDE 阶段需要。