VS 2008 and references

May 29 2009 6:12 AM
First of all, hi to everyone.

I'm quite new of .NET and VS 2008 and the first problem that i have met is dependencies and references among projects. Now i will explain my scenario:

3 solutions (because i'm trying to make reusable dll)

SOLUTION 1: solution with a project with all my custom exceptions which can accour into any my application

SOLUTION 2: solution with all classes related with databases that i could use (MSSQL, MySQL, PostreSQL, ....). In this solution, classes can handle exception generated by every dbms and throw a custom exception created by me (in solution 1). Of course, to use my exceptions, i have added an existing projet (the one in solution 1) and among references, i have added it. Everything work fine

SOLUTION 3: This solution contain my application which need to interact with databases so i have added project from solution 2. Plus i have references the project.

In solution 3, I can see all the classes of project of solution 2 BUT can't handle my exceptions because i can't reach them. This is making me crazy because the only way to work with them is to import the dll of the exception or the project but this seems me so strange. I mean, if i have a big application with many dependency and references located as a tree, should i have to make references at the top of the tree with every dll/project if i wanna work with an object no directly link with this class? It's a bit hard to explain :) For example, in my case, can i access to project in solution 1 from project in solution 3 if project in solution 3 has a references with project in solution 2 and project in solution 2 has a references with project in solution 1?

Thank in advanced and please help me to clarify this thing because it is related to the organization of the classes and code.

Answers (1)