Reputation: 4104
We have a few solutions with multiple projects in them. It's honestly laid out pretty poorly, and sometimes when we check in certain files some projects need to be re-built and others do not. Anyways, if I look at the actual project file in a text editor I see this:
<ProjectReference Include="..\admin.data\Admin.Data.vbproj">
<Project>{some-random-numbers-and-letters}</Project>
<Name>Admin.Data</Name>
</ProjectReference>
In other projects, I see references like this:
<Reference Include="company.someProject">
<Name>company.someProject</Name>
<HintPath>bin\company.someProject.dll</HintPath>
</Reference>
Can someone explain what the functional difference is between these two "styles" of references and how they're created? Any time I add a reference, I've always just right clicked the References folder, Add, Browse, and go and locate the DLL. I wasn't sure if using the Project tab in the Add Reference popup made a difference, or what...?
If it makes a difference, those two snippets are from .vbproj files but I assume a .csproj would look the same.
Upvotes: 1
Views: 69
Reputation: 941317
There is never any point in picking the DLL with the Browse button if the project is included in the solution. The IDE works all-around better when it knows about the project. Off the top of my head:
A good reason to intentionally remove a project from the solution and replace it with a file reference is when the project should not change anymore. Usually because it is a "foundation" project where minor changes can ripple throughout the entire solution and destabilize existing code. Or when the solution just has too many projects and takes too long to load and/or build.
Upvotes: 2
Reputation: 101604
One referenced the compiled binary (latter), the other references another source project in the solution (former with guid).
And yes, how you included the reference made the difference.
Upvotes: 1