如何使用licenses.licx文件 [英] How licenses.licx file is used
问题描述
我有一个licenses.licx文件,该文件包含在我的项目属性之一中.我不确定它的dll如何使用它. msbuild使用它吗?您是否知道在构建解决方案时如何使用它?
I've got licenses.licx file that is included to one of my projects properties. I am not sure how that is used by its dlls. Is it used by msbuild? Do you have any idea how it is used when the solution is building?
推荐答案
将此文件提交到WTF的ASP.NET下.
File this under ASP.NET, Department of WTF. 沮丧当您使用我们的网站开发Web应用程序时
控件,将出现一个名为licenses.licx的神秘文件.不,这不对
使用怪异的棒棒糖的命令,但它是一个过渡文件
由参与许可证的Visual Studio生成(并修改)
检查.在设计模式下,Visual Studio使用此文件进行注释
您在设计中使用的每个许可控件.当你然后建立
您的应用程序,Visual Studio阅读此licenses.licx文件,并为
此处提到的每个控件都将加载相关程序集并运行
该程序集中的许可证代码,以查看该程序集是否正确
已获得许可(即该产品所属的产品已被许可)
正确安装在该计算机上).如果一切顺利,Visual
Studio将许可证密钥嵌入到可执行文件中.如果没有,
您将收到有关未获得控件许可的怪异错误消息
(我最喜欢的是无法转换许可证文件'licenses.licx'
转换成二进制资源."通常我会调用该资源
我祖先的语言. Frustration When you are developing a web application with our
controls, a mysterious file called licenses.licx appears. No, it's not
an order to use a weirdly-named lollipop, but is a transitional file
generated (and modified) by Visual Studio that participates in license
checking. In design mode, Visual Studio uses this file to make a note
of every licensed control you use in your design. When you then build
your application, Visual Studio read this licenses.licx file and for
every control mentioned there, will load the relevant assembly and run
the license code in that assembly to see if the assembly is properly
licensed (that is, that the product to which it belongs has been
properly installed on that machine). If everything checks out, Visual
Studio embeds the license key into the executable. If it doesn't,
you'll get weird error messages about the control not being licensed
(my favorite is "Could not transform licenses file 'licenses.licx'
into a binary resource." to which I usually invoke the colorful
language of my ancestors). Licenses.licx实际上是解决方案中的文件(如果看不到
在此处,单击显示所有文件). Visual Studio使用一个名为
lc.exe将许可证编译为您的嵌入式资源
应用程序,并且许可证编译出现问题时,我已经
还看到了引用此可执行文件的错误消息. Licenses.licx is actually a file in your solution (if you cannot see
it there, click Show All Files). Visual Studio uses a program called
lc.exe to compile the licenses into embedded resources in your
application, and when things go wrong with the license compiling I've
seen error messages that reference this executable as well. 这是licenses.licx文件中一行的示例. Here's an example of a line in a licenses.licx file. DevExpress.XtraCharts.Web.WebChartControl,
DevExpress.XtraCharts.v8.2.Web,版本= 8.2.4.0,文化=中性,
PublicKeyToken = 9b171c9fd64da1d1 DevExpress.XtraCharts.Web.WebChartControl,
DevExpress.XtraCharts.v8.2.Web, Version=8.2.4.0, Culture=neutral,
PublicKeyToken=9b171c9fd64da1d1 此逗号分隔列表中的第一个值是类,第二个值是
是找到它的程序集,其他值是
大会的强名.我相信您已经看到了问题,
特别是当您将解决方案升级到最新版本的
您使用的第三方控件.如果需要,您可以编辑该文件,然后
毫无疑问地删除强名称部分. The first value in this comma delimited list is the class, the second
is the assembly where it's found, and the other values are the rest of
the assembly's strong name. I'm sure you can see problems already,
especially when you upgrade a solution to the latest versions of the
third-party controls you use. If you want, you can edit this file and
remove the strong name parts with no problem. 但这不是licenses.licx的最大问题.事情是
如果您打开Visual Studio,则倾向于触摸此文件.
解决方案(就像将文件日期更改为
当前日期/时间).这会严重影响许可,尤其是如果您
碰巧在非授权机器上打开解决方案,而您正在使用
源代码管理.突然,您的构建机器将摆脱这些
无法转换"消息,您就想知道出了什么问题.
另一个普遍存在的问题是,当您有一组开发人员在工作时
解决方案:他们都在不知不觉中修改"此文件. But that's not the biggest issue with licenses.licx. The thing is
Visual Studio has a propensity of touching this file if you open the
solution (that's "touching" as in changing the file date to the
current date/time). This plays havoc with licensing, especially if you
happen open the solution on a non-licensed machine and you are using
source control. Suddenly your build machine will throw off these
"cannot transform" messages and you're left wondering what went wrong.
Another prevalent issue is when you have a team of developers working
on a solution: they're all unconsciously "modifying" this file. 因此,答案似乎是不要将licenses.licx文件放在
源代码管理. (知识库文章) So, the answer seems to be not to put the licenses.licx file under
source control. (KB article) 但是,此问题的解决方案引发了另一个危险信号:如果其中一个
团队中的开发人员添加了一个新控件,该控件需要许可
表单中,一行被添加到他的本地licenses.licx文件中,并且可能
没有反映在源代码管理中. Bam,您的构建机器无法通过
build和添加控件的Joe必须为购买甜甜圈
团队,直到其他人破坏了构建. But this solution to the problem throws another red flag: if one of
the developers in a team adds a new control that needs licensing to
the form, a line gets added to his local licenses.licx file and it may
not get reflected in source control. Bam, your build machine fails the
build and Joe, who added the control, has to buy doughnuts for the
team until someone else breaks the build. 恐怕我对后一个问题没有好的解决方案,因为
不幸的是,未将licenses.licx放在源代码控制中"
成为每个人解决许可问题的方式.其他
解决方案是完全删除licenses.licx文件,然后获取
Visual Studio通过打开解决方案来重新生成它(尽管这是
在构建机器上有点困难). I'm afraid I have no good solution to this latter issue, because
unfortunately the "not putting licenses.licx in source control" seems
to be the way everyone is solving the licensing problem. Another
solution is to delete the licenses.licx file altogether and then get
Visual Studio to regenerate it by opening the solution (although this
is a bit difficult on a build machine). 无论如何,希望所有人都能以某种方式提供帮助.然后用
手机并不能真正帮助您. Anyway, hope that all helps in some way. And hitting your laptop with
a phone isn't really going to help. 这篇关于如何使用licenses.licx文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!