gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 08:16:39 24 4
gpt4 key购买 nike

我正在编写一个供内部使用的 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com