程序集有一个强名称,但是我得到一个错误,提示需要一个强名称 [英] Assembly has a strong name, but I"m getting the error that says a strong name is needed

查看:190
本文介绍了程序集有一个强名称,但是我得到一个错误,提示需要一个强名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将第三方COM dll加载到我的应用程序中。一切正常,但是当我运行应用程序时,我不断从应用程序中收到以下消息:

I am trying to load a third party COM dll into my application. Everything builds fine but when I run the application I keep getting this message from my application:


无法加载文件或程序集' assembly ,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = null或其依赖项之一。需要一个全名程序集。 (来自HRESULT的异常:0x80131044)。

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

当我执行 sn -vf assembly 时,它表示该程序集已验证。

When I do a sn -vf "assembly" it says the assembly is valid. Has anyone seen this type of behavior before?

推荐答案

您正在尝试加载的程序集没有有个好名字这可以通过您的消息看到,显示为 PublicKeyToken = null 。如果它有一个强名,它将有一个公共密钥令牌。

The assembly you are trying to load does not have a strong name. This can be seen by your message, it says PublicKeyToken=null. If it had a strong name, it would have a public key token.

如果您给它一个强名,则在编译或引用后它,请尝试在您的项目中再次引用它。也许您的项目仍使用旧参考,并尝试加载未签名的版本。

If you have given it a strong name after you compiled or referenced it, try to reference it again in your project. Maybe your project has still the old reference and is trying to load an unsigned version.

这篇关于程序集有一个强名称,但是我得到一个错误,提示需要一个强名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆