Click here to Skip to main content
15,918,976 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I have one project in Asp.net MVC in that i have one DLL DeveDefind and Other Dll is
E.g ABC problem is that DevDefined Dll is already include in ABC so when I write any method Like Oauthsession that it give me conflict between Devdefined Dll and ABC Dll.because method find in both Dll . and I cant defined as
devdefined.Oauth.MethodName becase that Devdefined already in my ABC Dll.

Please give me any usefull suggestion
And Thanks In Advance....

What I have tried:

I tried with class library.but its not useful for me .i have to use in project not different class library .
Posted
Updated 2-May-17 1:13am

1 solution

In Visual Studio click on the DeveDefind reference under the References section and you'll see a property of the reference called Aliases and it'll be "global" by default. Change that to something like "DeveDefind". Now when you reference a class inside DeveDefind rather than referring to it like;

MyNamespace.MyClass


use;

DeveDefind::MyNamespace.MyClass


That will tell the code explicitly which DLL to use for MyClass.
 
Share this answer
 
Comments
hardy panchal 2-May-17 7:14am    
Can you please elaborate ?
F-ES Sitecore 2-May-17 8:35am    
There's not much more to say, just give the reference an alias and use that alias to prefix your class names so if your class was "XYZ" where XYZ is a class in the referenced dll then change that to YourAlias::YourNamespace.XYZ so for example

List<xyz> data;

will become

List<youralias::yournamespace.xyz> data;

that way the compiler knows exactly which dll to look in for your class and there is no ambiguity.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900