Question

I knew , it has been asked several times and for a common case , I had solution too. So kindly donot vote close/delete. Read it first then decide is it really needed to remove or not.

Actually my scenario is that I have an existion solution with 100+ projects from where I am picking two separate projects, called Project1 & Project2. Both projects have few common classes like clsPatient, clsServices, clsCoverage etc. Also the name space for are kept somewhat common for various modules in all projects. Like for all entities we have CompanyName.Project.Entities, for DAO - CompanyName.Project.DAO, BO - CompanyName.Project.BO and So on.

Now a situation came when I have to use the Entities class that exists in both Project1 and Project2 in a new Project called Project3, but here it started giving me compile time error 'ClassName' is ambuguous in 'Namespace' . I just want to know is there any way to call that particular class from a particular dll. Kindly note all references are in form of Dll not project references and I want to keep ambiguity, as I dont want change the Building Sequence or the project references. It will become a mess than.

I tried Import abc = xyz.prs but it too wont work.

Any workarounds?????

Was it helpful?

Solution

You will need to use the fully-qualified namespace, i.e. all the way from the beginning of the root namespace. E.g. Project1.First.Second.Third.ClassName vs. Project2.First.Second.Third.ClassName.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top