网站从VS2005(2.0 Framework)升级到VS2008(2.0 Framework)
我们有一个在VS2005中创建的网站,
最近我们将网站升级到VS2008,框架为2.0。
编译网站时发生编译错误,即 Licenses.licx 文件未编译,如果编译,则会重现 AppLicenses.dll。
在licensing.licx 文件中包含一个类和一个命名空间(即OSADirectLicensing.OSADirectLicensedClass、OSADirectLicensing)。
编译错误如下:
Error 1 C:\Program Files\Sharp\Sharp Developer Tools\OSA SDK\Samples\DirectOSA\ExternalAuthority\licenses.licx: Could not transform licenses file into a binary resource. (1) : error LC0004 : Exception occurred creating type 'OSADirectLicensing.OSADirectLicensedClass, OSADirectLicensing, Version=1.0.4006.31768, Culture=neutral, PublicKeyToken=null System.ComponentModel.LicenseException: Invalid License
at System.ComponentModel.LicenseManager.CreateWithContext(Type type, LicenseContext creationContext, Object[] args)
at System.ComponentModel.LicenseManager.CreateWithContext(Type type, LicenseContext creationContext)
at System.Tools.LicenseCompiler.GenerateLicenses(String fileContents, String targetPE, ITypeResolutionService resolver, DesigntimeLicenseContext ctx)' .
VS2008是否支持licenses.licx?
我们不应从网站上删除此文件。
我们该如何解决这个问题呢?
We have a website that is created in VS2005
Recently we upgraded the website to VS2008 with 2.0 framework.
While compiling the website Compilation errors are occuring i.e Licenses.licx file is not compiling, if it compile than it will reproduces an AppLicenses.dll.
In the licensing.licx file containing one class and a namespace(i.e. OSADirectLicensing.OSADirectLicensedClass, OSADirectLicensing).
The compilation error is as follows:
Error 1 C:\Program Files\Sharp\Sharp Developer Tools\OSA SDK\Samples\DirectOSA\ExternalAuthority\licenses.licx: Could not transform licenses file into a binary resource. (1) : error LC0004 : Exception occurred creating type 'OSADirectLicensing.OSADirectLicensedClass, OSADirectLicensing, Version=1.0.4006.31768, Culture=neutral, PublicKeyToken=null System.ComponentModel.LicenseException: Invalid License
at System.ComponentModel.LicenseManager.CreateWithContext(Type type, LicenseContext creationContext, Object[] args)
at System.ComponentModel.LicenseManager.CreateWithContext(Type type, LicenseContext creationContext)
at System.Tools.LicenseCompiler.GenerateLicenses(String fileContents, String targetPE, ITypeResolutionService resolver, DesigntimeLicenseContext ctx)' .
Does VS2008 support licenses.licx or not?
We should not remove this file from website.
How can we solve this issue?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
删除licenses.licx文件并重新编译项目。
这应该可以解决问题。
祝你好运!
Delete the licenses.licx file and recompile the project.
This should solve the problem.
Good Luck!
安装 EmptyLicensesLicx nuget 包,它将生成一个空的
Licenses.licx< /code> 在你的项目中,在它被编译之前(这是它工作所需的全部)。
Install the EmptyLicensesLicx nuget package, and it will generate an empty
Licenses.licx
in your project, before it gets compiled (which is all you need for it to work).