user366312
user366312

Reputation: 16988

Why Visual Studio allows us to add a reference to a DB project?

I have a VS2010 solution with two projects.

  1. SqlServer 2008 Database project, and another

  2. Winforms project

I see that visual studio allows me to add a reference of the Winforms-project to the DB-project. But the opposite is not possible.

My question is why would someone need to add a reference of Winforms-project to the DB-project or vice versa?

Upvotes: 0

Views: 73

Answers (2)

Damien_The_Unbeliever
Damien_The_Unbeliever

Reputation: 239754

Because, at the end of the day, a lot of code isn't actually dependent on a specific runtime model - you may have picked a particular model that your code (normally) conforms to, but that doesn't mean (by the .NET rules) that your code cannot be consumed by another piece of code.

To some extent, it's only a conventional thing that reusable components end up in DLLs and "non-reusable" components end up in EXEs. There's no real difference at the .NET level (they're both assemblies). And what particular VS projects produce these components is very much lost.

As to whether you can easily reference particular projects or not from within VS is a VS issue.

Upvotes: 0

STLDev
STLDev

Reputation: 6174

The reason you can add a reference to a database project is because a winforms project may have dependencies on the database. However, a database would typically never have a dependency on a windows forms project, so I think that it makes sense that VS doesn't allow you to create a reference from a database project to a winforms project.

Upvotes: 1

Related Questions