- Home /
Same namespace but different dll version/code
Reference 2 dll. both library have a 'System.Threading' namespace but in different version. Unity showing :
error CS0433: The type 'TaskScheduler' exists in both 'System.Threading, Version=1.0.2856.102, Culture=neutral, PublicKeyToken=31bf3856ad335e22' and 'Unity.Tasks, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'
In Visual Studio we can set the dll alias name to different the library. But Unity is not supported 'extern alias' -> reference
How can I solve it?
Thanks in advance.
Answer by Hellium · Feb 15, 2017 at 10:36 AM
Simply do not add using <namespace>
at the top of your files and write explicitly the name of the class including the namespace :
Unity.Tasks.TaskScheduler scheduler = ... ;
Unity.Tasks is the dll name. The dll is using the "System.Threading" namespace. I tried your suggestion, remove the using <namespace>
and write the explicitly name when used the TaskScheduler. but it not work :( As I know C# is using namespace to differences the library. How can I call the library depend by the dll name? for example:
lHow to I call lib1.dll "startProcess" method when namespace is same? Sorry I'm new in C# and Unity. And apologize about my English. Hope you understand my question. Thanks in advance.ib1.dll , namespace = System.Threading, public method = StartProcess() lib2.dll , namespace = System.Threading, public method = StartProcess2()
Your answer
![](https://koobas.hobune.stream/wayback/20220612111128im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
XInputDotNetPure plugin: Namespace could not be found. 1 Answer
Missing Namespaces 2 Answers
Why does Boo not see namespaces from dlls? 1 Answer