c# - How to distinguish between two classes with the same name (and namespace) in 2 DLL's? -


i've got 2 dll's - common.dll , cfw.infrastructure.sdk.dll. both dll's contain following class:

cfw.common.hashing.blockhasher 

i have test project references both dll's. when try test blockhasher, following error:

blockhasher exists in both dll's

i test 1 in cfw.infrastructure.sdk.dll. because qualified names same can't fix 'normal' using.

external aliasses can used.

1. add alias dll reference

open solution explorer. navigate dll , add alias it.

properties of reference

2. reference alias

add following the c# file (must on top):

extern alias sdk; 

3.add usings distinguish:

i've added classes gave problems usings:

using blockhasher = sdk.cfw.common.hashing.blockhasher;  using signingalgorithm = sdk.cfw.common.hashing.signingalgorithm; 

4.done!

got idea extern alias walkthrough.


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -