0

I have two thrid party facebook dlls using in my project, both having different purposes but having same name "facebook.dll". While adding reference i found conflicts with same name, so i changed the name of one dll to "facebookpost" and added its reference. I know its doesn't make any difference by simply changing the name of that dll. But i need to use these two dll in my project. how can i accomplish this?

i tried this following with no luck

<?xml version="1.0"?>
 <configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="ClassLibrary1" publicKeyToken="fbc28d9ca2fc8db5" />
    <publisherPolicy apply="no" />
    <bindingRedirect oldVersion="1.0.0.0" newVersion="1.1.0.0" />
  </dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Update : I have some how managed to get external reference to faceook.dll using "extern alias" But i am getting one error "The extern alias was not specified in a /reference option"

Update By following Orca's approach in The extern alias 'xxx' was not specified in a /reference option, i solved the "The extern alias was not specified in a /reference option" issue. But now ended with this new error - "Could not load file or assembly '[MyAliasName]' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference."

Community
  • 1
  • 1
Nithin Paul
  • 2,169
  • 3
  • 33
  • 55

1 Answers1

0

The DLL's needs to have different AssemblyName. Internally in the compilation. If they have the same name, they need to be signed with different keys to avoid the conflict.

If you have same namespaces, probably will have to use the types by reflection. I don't know if there's a way to create specific namespace aliases for imports from an assembly in C#/.NET.

Eric Lemes
  • 561
  • 3
  • 10
  • Hi Eric thanks for your reply. I tried to use Extern alias technique to avoid this problem. By this technique i was able to refer both library files without any conflicts. But now there is one error showing related with Extern usage "The extern alias was not specified in a /reference option" – Nithin Paul Aug 01 '14 at 04:18
  • Yes Eric, after that i was able to call methods using my new dll alias name. But when i run my project i am getting "Could not load file or assembly '[MyAliasName]' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference." error – Nithin Paul Aug 04 '14 at 05:20