如何创建强名称程序集?
我有一个网站项目,其中我的架构是N层架构。我正在使用 Microsoft Enterprise 库的验证 DLL 文件。截至目前,该 DLL 文件还没有强命名。我需要对该程序集进行强命名。我该怎么做?
我看到一些文章描述了如何通过使用 Visual Studio 2008 命令提示符并键入以下内容来创建强名称程序集:
sn -k publickey.snk
然后将程序集标记添加到 assemblyinfo.cs 文件。我尝试这样做,但我的网站项目没有任何 assembleinfo.cs
文件。
I have a web site project in which my architecture is an N-layered architecture. I am using Micorsoft Enterprise library's validation DLL file. As of now this DLL file is not strongly named. I need to make that assembly strongly named. How can I do this?
I saw some articles which depicts how to create a strong-named assembly by taking the Visual Studio 2008 command prompt and type:
sn -k publickey.snk
Then add the assembly tag to the assemblyinfo.cs
file. I tried to do that, but my website project dosen't have any assemblyinfo.cs
file.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于 ASP.NET 网站项目是动态编译的,因此您无法为程序集指定强名称,因为它(尚)不存在。如果要为 ASP.NET 代码分配强名称,则必须使用 ASP.NET Web 应用程序项目。
至于为第三方 DLL 分配强名称,除非它经过延迟签名,否则您不能这样做。还有另一种方式< /a>,但它可能会违反许可协议。
Since ASP.NET web site projects are compiled dynamically, you can't assign a strong name to the assembly since it does not exist (yet). If you want to assign a strong name your ASP.NET code, you'll have to use a ASP.NET web application project instead.
As for assigning a strong name to a third-party DLL, you can't unless it's been delay signed. There is another way, but it will probably contravene the license agreement.