Reference a dll in a separate web application/directory

B

benliu

i have a visual studio website that i am integrating with community
server, a third party software for creating communities. To
paraphrase, i am trying to have users that log in to my site
automatically log in to the community server site (which is its own web
application, with its own dlls and web.config files, and in a separate
directory etc). To do this, i need to access the classes located in
the community server dll...

Sounds easy enough - I referenced the dll's located in that directory
through visual studio, and it copies the dll over to the website's bin
direcotry. However, i find then that there are multiple dependencies
on other dll's, as well web.config files, and directory structures that
the dll expects. If i just keep referencing dll's and copying files
over to my website project, the project will be convuluted with a bunch
of "crap." I'd like to keep my project separate from the community
server project.

So, I'd like to be able to reference the dll directly in the other web
application. I noticed that in visual studio projects, you can select
something like "keep local" for the dll's, but that option is not
available in the website project. Also, as those dll's will be loaded
into memory, i don't want to create another copy of the same dll within
my project. I just want to use "their" copy of the dll. This way, the
dll also knows where to find the web.config files, etc that it depends
on. How do i accomplish this?

Sorry, not sure if i clearly stated what i'm trying to do. If not, i
can clarify further. Thanks...
 
B

benliu

Thanks, that might work, although still will take a bit of work. Is
there really no way to use a dll in a different application??
 
V

V

Hi,

I am not sure if this helps, but this is not a good design to directly
access the DLL's of the community server application.

If possible, you should maybe make a web service in the community
server app and use that web service to log in from your app. Or you
could host the DLLs via remoting and then call them from your app.

Of course, for both of these, I am thinking that you can make a change
to the community server app.

If not, then my suggestions won't help a lot.

- Vaibhav
 
B

benliu

Vaibhav,

Thanks for the suggestions. Why is it bad design to directly access
the dll's?

And yes, i can modify the code in the community server app, so i can
write a web service - i had not thought of that and that should work
great - i'm not familiar with remoting? Can you elaborate a bit on
that method?

Thanks much,

Ben
 
V

V

Ben,

The reason I say it is bad design is simply because your community
server dlls were probably not designed (an assumption on my part), to
be accessed as a class library by an external app. Hence, I don't think
that it is a good design to actually do so.

I think that when an application (community server) wants to expose an
interface to another application, it should be through a well defined
API. In your case, you are treating the dlls of the community server as
if they were part of your own application.

I would say it was still better, if the dlls that you are referencing
were considered as a third component and were made into a shared
library and published in the GAC, from where both the community server
and your app should reference them.

I hope you understand what i am saying, because i realize that what i
wrote above is not very crisp.

As for Remoting, it is a mechanism through which you can share objects
over a network. it is hard for me to explain but this link offers a
quick intro:
http://samples.gotdotnet.com/quickstart/howto/doc/Remoting/mainfeatures.aspx

Let me know if I can help out in any other way.

- Vaibhav
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top