.net - 强烈命名第 3 方程序集 - 无法加载文件或程序集

标签 .net visual-studio-2012 strongname vsix

我正在编写一个供内部使用的 Visual Studio 2012 扩展,这要求所有程序集都具有强名称。我依赖于 RestSharp(以及其他一些 dll),并且由于它没有强名称,因此我通过以下 this 为其添加强名称。 。一切都根据进程的输出进行,如果我查看项目引用中 RestSharp.dll 的属性,甚至 Visual Studio 也声称它是强命名的。然而,当我使用我的扩展时,我收到一个 FileLoadException 声明:

Could not load file or assembly 'RestSharp, Version=104.1.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044)

关于如何解决这个问题或解决这个问题有什么想法吗?

最佳答案

我编写了一个 NuGet 解决方案级别包,以帮助使用您自己的 key 对第 3 方程序集进行强命名。

This is targeted for signing the contents of NuGet packages that are using unsigned assemblies, in order to be able to link to these packages where the consuming project is strongly named. Access to the original source code is not required, and you may sign any assembly with your own strong naming key. You may also delay-sign if desired.

https://nuget.org/packages/Nivot.StrongNaming

您可以在我的博客上阅读更多相关信息:

http://www.nivot.org/blog/post/2013/04/30/Signing-unsigned-assemblies-in-NuGet-packages

关于.net - 强烈命名第 3 方程序集 - 无法加载文件或程序集,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13943091/

相关文章:

c# - MVC 5 不适用于 IIS 7

.net - 您如何签名由ILMerge操作生成的程序集?

strongname - 无法验证强名称签名

c# - 命名空间被编译器混淆

.NET Core MSTest 参数

c# - IOException HResult 可能的值

c# - 我如何为 shdocvw.dll 创建一个强命名的互操作 dll

c# - 在属性的父引用更改后刷新属性的绑定(bind)

php - XDebug with IISExpress + PHP Tools for Visual Studio

c++ - 什么是 Windows 工具包以及它们如何工作?