What is the right way to organize projects in .NET,? thanks!

D

davidw

I am using microsoft development enviroment 2003. I created a solution, and
have some projects, I put the root dir as my IIS home, and each project has
their own directory, so it is like


c:\solution
c:\solution\project1
c:\solution\project2
....

I put my main dll under c:\solution\bin, it works fine. When I compile
project1, I get a dll under c:\solution\project1\bin. But the dll of
project1 is used to handle root http request, I need it handle url like
http://mydomain/chat.aspx, not something like
http://mydomain/project1/chat.aspx, so I think I need put the project1 dll
into the bin under c:\solution, but I can not change the output path, it is
"bin\" now, everytime I changed it to "..\bin\", it always changed back
automatically, I remember I did do this successfully on my other projects, I
have no idea if this should work and why it doesn't work. Any suggestion to
my problem?


Thanks.
 
R

Raghavendra T V

Hi David,

Assume that you have 3 projects.
1) project 1 - DLL
2) project 2 - DLL
3) project 3 - Need reference to project 1 - DLL and project 2 - DLL

All you need to do is Add a reference (right click on references -> Add
references and select the project 1 dll and project2 dll from the Projects
Tab)in Project 3
Now your project 3 has references to project 1 dll and project 2 dll ..and
you need to just build the solutions which will automatically places the
latest project 1dll and project 2 dll
to your project 3 dll.

Hope this solves your problem.

Thanks
Raghavendra
 
N

Nick Malik

Hi David,

You said:
I put the root dir as my IIS home <

I have never heard of anyone doing that before. I assume that means that
you have asked Visual Studio to place the solution into the
C:/inetpub/wwwroot folder.

That is not the most effective thing to do.

Set it to a normal folder, somewhere out from under IIS.

Then, when you create web app in Visual Studio, and reference the DLL from a
project that simply compiles to a DLL, then the DLL will automatically be
copied to the /bin directory of your web app, without you needing to worry
about it.

Just let Visual Studio handle the act of creating the web application.

--- Nick
 
D

davidw

Sorry, I didn't explain well, I did set it as normal folder.

My question is I put different projects under different sub-directory, I
think it is the right way since you don't want to mix files of different
projects together. Since they are under different sub-directories, they will
create bin under those sub-directories. Their dll would not go to the /bin
of my web app, they are one level down
 
D

davidw

I don;t have problem on reference, refrence doesn't care much where you put
it. I just have several dlls created by several projects, they will handle
requests like /chat, /image, things like that, but I could not find a way to
make the compiled dlls go to the bin under my web root.
 
N

Nick Malik

OK, so let me get this straight...

You have a solution file in a normal folder. Neither the solution file, nor
any of its subdirectories are addressable from the web server at all.

Under the solution file, you have one web project and one or more DLL
projects.
Visual Studio creates seperate subdirectories for each DLL project. VS
created the web project under your IIS wwwroot folder and created the /bin
directory under that.

Am I still on the page with you? You didn't create the subdirectories...
you created the projects... VS created the subdirectories... right?
Also, you didn't create the web application in IIS... VS did that for you,
right?
(this would be normal).

Now, you open the solution, and in the web project, you make project
references to the DLL projects. Still with me?

And you are stating that when compile all of it, VS is not putting the DLLs
into the /bin folder of the web project? That's pretty odd, because VS has
never failed to do this for me. It simply copies the DLLs for you. By
default... no special settings are needed.

Now... what am I missing?

--- Nick
 

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

Top