1

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.

UPDATE:

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

Community
  • 1
  • 1
Cᴏʀʏ
  • 105,112
  • 20
  • 162
  • 194
  • Can you explain what "out of whack" means? – hunter Mar 24 '10 at 14:57
  • Sure... after rebuilding the framework project, the other solutions "freak out." First, we get a "Unable to load referenced library "": The process cannot access the file because it is being used by another process. Consequently the .dll is **there** but not being used, so everything referenced in it becomes "not declared". The solution to that is to open and close VS (annoying) or drop and re-add the reference (in each project using it) (more annoying). So maybe if we solve the permissions problem? – Cᴏʀʏ Mar 24 '10 at 15:48

3 Answers3

4

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.

Cᴏʀʏ
  • 105,112
  • 20
  • 162
  • 194
2

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

hunter
  • 62,308
  • 19
  • 113
  • 113
0

You can try to add references another way.

  1. Add reference
  2. Choose tab Browser (Not tab Project)
  3. Choose *.dll that you need

I have tried it and been successful.

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

samoz
  • 56,849
  • 55
  • 141
  • 195