Reputation: 509
I am developing windows application using 3-tier archtecture. So,i have created
two ClassLibraries
that contains BAL and DAL
1.DAL -->I Put all the related connection to the database.
2.BAL -->All the business logic
Now the 3rd one is Windows Forms
Application template. So my solution contains 3 projects:
Now, when I add the reference dal.dll assembly into my BAL
project, then I am using all the related connection object in my BAL
Project.
Then, after that I have added BAL
asembly means bal.dll into my Windows Forms
application.Yes it is added succefully. And i run my project it is working fine.
But the problem comes after building the solution. The output window gives
========== Build: 0 succeeded, 0 failed, 3 up-to-date, 0 skipped ==========
When I rebuild the solution, BAL
reference or assembly could not be found.
I didn't understand what is the issue.Because I added those assemblies successfully those are dot net dll's. The targeting framework is .Net FrameWork4.5. I checked that twice.
Note: Those 3 folders under the same solution only. Note: When i build the solution. In my BAL project..bin --->debug-->bal.dll and dal.dll's are removed.This one also embarssing.
Can you help me what's the issue here? Thanks
Upvotes: 0
Views: 155
Reputation: 38114
To add a project reference:
Update:
For example:
To add DAL
library to BAL
library:
If you are using your BAL
assembly at DAL
assembly, you should add BAL
assembly too like that:
Furthermore, you should add your all assemblies to WinForms
application:
Update 2. Difference between your approach and standard approach: When you adding like you have said:
However, if you choose the adding by Add Reference, it is right way and all projects can connect with all projects in your solution.
Upvotes: 1
Reputation: 25351
It's strange, as it should work the way you described it. Perhaps the dlls get deleted after the successful build.
However, the correct way to do it is to add references to the projects, not the assembly dlls. So for example:
BAL project => Right click on reference => Add reference => Solution => and select DAL project
Upvotes: 0