I have two dlls coded in C# compiled to file1.dll and file2.dll
how can i import file2.dll into file1.dll
file1.dll is on server www.file1.com
file2.dll is on server www.file2.com
i want to reference and use file2.dll in file1.dll
please help!!
Much as I hate the phrase - "This is impossible", I'm not sure the .NET framework allows such a scenario to exist - with the possible exception of web services. If you write file2.dll as a web service, then you can reference it over http inside file1. I'm not sure if this is exactly what you're looking for though - your question implies something slightly different.
A web service allows for centralized management of this "file2.dll" - it's not actually a DLL, it's an ASMX but for the purpose of the application, the ASMX receives some data - does a bunch of stuff to it and sends a bunch of data back...which is what regular methods do. It's just that an ASMX sends/receives data as XML. The ASMX file resides on some web server somewhere. "file1.dll" would reside on some other web server somewhere as another ASMX file.
A call to
http://www.server1.com/MyService.asmx would send data to my webservice on server1 which would do something with the data before calling
http://www.server2.com/MyOtherService.asmx which would do something with that data passing it back to the first web service which then in turn can further manipulate that data before sending it back to the calling application.
.NET Remoting allows for local/remote interaction in some ways also. If you write a DLL that resides on some remote machine and interacts with that remote machine. You can then write a local component that holds code to interact with that remote DLL. Your local computer in effect holds a copy of that remote DLL and references the local DLL as a proxy to the remote, so that the local computer knows what's going on. When you run the code, it steps through it on your local machine, but when you get to the remote portions of the code, that code is actually running on and interacting with the remote machine.
These are the only two ways I am aware of for that local/remote interaction. As you don't really explain what you are trying to achieve as a goal - I can't really offer any advice on an overall solution to the issue.
Ben