12

I have a VS 2008 C# web app with a bunch of project references to custom dlls. These are all at a relative path from the web project. Recently I've noticed that Clean Solution removes some, but not all, of the dlls from the web app's bin\debug folder. For example:

<Reference Include="TowerCo.Utilities, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\..\Components\TowerCo.Utilities\bin\Debug\TowerCo.Utilities.dll</HintPath>
</Reference>
<Reference Include="TowerCo.WebControls, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>..\..\Components\TowerCo.WebControls\bin\Debug\TowerCo.WebControls.dll</HintPath>
</Reference>

The first one works normally (clean cleans it, new versions copied to web project on rebuild) but the second does not. A side effect is that I don't automatically pick up changes to the dependency.

Thanks for any help.

John Price
  • 191
  • 1
  • 1
  • 7
  • Is the second DLL possibly in the GAC where the first one is not? – Steve Danner Oct 25 '10 at 16:36
  • Good idea, but no, I don't have any of my dlls in the GAC. In general we use project references and deploy separate copies of components with each app. – John Price Oct 27 '10 at 14:47
  • I'm having this same problem. There seems to be a related issue in that the build server doesn't want to deploy this same assembly that doesn't get cleaned. It works on all other dev machines when compiling – Joel Martinez Nov 08 '10 at 18:49
  • Is it possible the dll not being removed is in use (or being held onto ) by the system when it is to be deleted? – Toby Allen Jan 17 '11 at 17:59
  • try build/re build your solution. – Crimsonland Feb 11 '11 at 23:25
  • Does this answer your question? [How to clean Visual Studio bin and obj folders](https://stackoverflow.com/questions/1088593/how-to-clean-visual-studio-bin-and-obj-folders) – StayOnTarget Jun 02 '20 at 19:09

2 Answers2

4

It only seems to delete files it 'knows about'.

For instance old library files, and old references after having renamed projects are still there. Very strange. I always assumed 'Clean' was just a straightforward delete - and I don't quite understand why it isn't. Go in and check each folder by hand if in doubt.

Simon_Weaver
  • 140,023
  • 84
  • 646
  • 689
2

Sometime VS doesn't pick the latest dll if the version is same. Try changing your version in AssemblyInfo.cs and it should work.

In past, I faced the same issue when I was relying on size/timestamp but I later realized that by changing the version, Studio removes the older DLLs and copies the new DLLs.

sajoshi
  • 2,733
  • 1
  • 18
  • 22
  • I can confirm this issue still occurs when you have modified the AssemblyInfo.cs version number by the smallest revision number. – Keith Hoffman Apr 16 '12 at 05:50