5

I'm working on a C# application which uses the EasyHook library for DLL Injection. EasyHook requires that any application using it be strongly named. In order to strongly name the application I need to make sure that all the libraries I use are strongly named as well.

This is easy to do for all of my managed libraries, but I also have an unmanaged c++ library which I need to strongly name. After some searching I can't seem to find a way to sign my unmanaged dll, even with the source code. Can this be done, and if so what do I need to do?

Thanks for any suggestions or assistance!

StayOnTarget
  • 11,743
  • 10
  • 52
  • 81
Luke Belbina
  • 5,708
  • 12
  • 52
  • 75
  • 1
    You cannot strong-name a native DLL. There's something very wrong with your assertion that a strong name is needed to use EasyHook, it doesn't make sense. – Hans Passant Mar 30 '11 at 02:29

1 Answers1

5

I assume that you're calling the DLL using P/Invoke.

You don't need to (and cannot) strongly-name it.

Strong naming is a .Net concept that applies to managed assemblies (and C++/CLI); it has no meaning for unmanaged libraries.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
  • The reason I need it to be strongly signed is because its included in a .NET library which I need to strongly sign. Is there a way to sign to managed library without having to convince it I need to sign the unmanaged library (as this can't be done)? – Luke Belbina Mar 30 '11 at 02:26
  • You can just sign the managed assembly; it won't complain about P/Invoke imports. – SLaks Mar 30 '11 at 02:33
  • I think the problem is though EasyHook needs to put the dll in the GAC but the GAC will only accepted strongly named things. – Luke Belbina Mar 30 '11 at 02:46
  • **You can sign your managed DLL even though it uses P/Invoke**. You have nothing to worry about. – SLaks Mar 30 '11 at 02:51
  • You cant put unmanaged assemblies in the GAC (as far as i know). Your problem may be that the unmanaged DLL cannot be "seen" by the managed library when its in the GAC? You may need to place the unmanaged library somewhere in the PATH (?) i didnt try this though. – Stephen Jun 03 '14 at 07:33