Assembly has a strong name, but I"m getting the error that says a strong name is needed

Mykal73 picture Mykal73 · Aug 21, 2015 · Viewed 19.4k times · Source

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:

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).

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

Answer

nvoigt picture nvoigt · Aug 21, 2015

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.