views:

373

answers:

4

Hi all-- I've got a question about something that's just been irritating me.

A colleague and I are building a support framework for our current client that we want to reference in other projects.

The DLL we want as a reference in our project would be an external reference. We're adding it by doing "Add Reference...", then browsing to the location of the .dll. What I want Visual Studio to do is only add the .xml, .pdb, and a .dll.refresh file, but instead it copies the actual .dll (and .xml and .pdb) into the bin.

When we rebuild the framework project, the other project that uses its .dll gets all out of whack until we drop and re-add the reference. Everything I've read online says that VS2008 is supposed to create the .dll.refresh files for you, but it never does.

Any ideas? Am I missing something or doing something wrong?

At this point I'm ready to add a pre-build event to simply copy the framework .dll into my bin, but the .refresh file seems like less of a hassle if it would just work.

Thanks,

Cory

UPDATE:

This SO post describes the actions that are supposed to be happening with the refresh files.

+1  A: 

If the Projects are in the same Solution and you add a "Project Reference" that should solve your problem.

hunter
Our goal is to not use Project references for various reasons. Eventually we're moving to a GAC-only solution, and we don't want the implementation of our framework to be available to some in-house developers wanting to use it in their solutions.
Cory Larson
A: 

Never heard of a .refresh.

What Hunter said, first of all.

Second, if the dll is an external dependency, what I usually do is add the DLL to the solution under a folder called 'Dependencies' within the solution tree. Then any project that references that dll will reference that specific instance. This ensures 1) all projects are referencing the correct DLL and 2) all projects are upgraded to a new version at the same time.

Maybe I've never heard of a .refresh is because I've never needed it.

Will
A: 

So it turns out that .refresh files are only created for Web Site projects, not Web Application projects.

The problem stems from Visual Studio having trouble deleting lock files for DLL references over 64kb, a problem supposedly fixed in VS 2010.

The current workaround is to close and reopen the solution or to unload and reload the project containing the references.

Cory Larson
A: 

You can try add reference by another way. As below: 1. Add reference 2. Choose tab Browser (Not tab Project) 3. Choose *.dll that you need I have try and it done successful.

If you choose tab Project --> there are no *.dll.refresh added

lucyhoang