I have a website “project”. It has assembly references to external DLLs that we update from time to time (a “framework” of sorts). Visual Studio 2008 happily creates the “refresh” files that it uses to update references at compile time.
I made an addition to an enum in the external assembly and recompiled it. Back in the website project, I updated the reference (both by right-clicking the external DLL that’s listed under the “Bin” folder and choosing “Update Reference” and by going into the Property Pages for the website and on the References page, highlighting my external assembly and clicking the “Update” button.
There’s a class in the website’s App_Code folder that I made some changes to that use the new enum value from the external assembly. Intellisense picks up the new addition and the IDE does not complain about me using it at all — until I try to build the solution.
Upon building the solution, I get an error BC30456, which is a “‘{0}’ is not a member of {1}” error. The error stays in the “Error List” view and on the “Output” window until I once again Update the reference to the external assembly, after which the error goes away immediately.
If I remove the reference from the project completely, VS correctly starts complaining about missing the enum type and warns that the namespace I’m trying to import cannot be found. When I re-add the assembly reference, after a few seconds all of the errors and warnings go away. Upon the first attempt at rebuilding the solution and/or the website, I get the error again.
I’ve tried to confirm I’m not crazy by doing these tasks:
- Cleaning out the Temporary ASP.NET files folder for the website, both 32-bit and 64-bit versions of the Framework
- Manually copying the assembly from the external location straight into the Bin folder
- Closing and reopening Visual Studio
- Restarting the computer
The ONE thing that I just noticed now is that the external DLL was last built on 11/14/2011. When that version of the DLL is in the Bin folder, Intellisense is accurate. As soon as I try a build, the DLL and PDB revert to an 11/7/2011 build. I do not know where this is coming from. Both the DEBUG and RELEASE builds of that DLL on this machine are for 11/14. The DLLs are not checked in to our source control system, only the .refresh files are, so it can’t be updating them from the source control server.
I’m really, truly, stumped, and looking for any ideas you may have.
And of course I figure it 5 minutes after asking the question…
The website project has another external assembly reference (B) which depends on the one I was having trouble with (A). Upon build, while it was updating reference B, it was overriding reference A’s DLL from the location in the .refresh file with the DLL from the bin folder of where B was built, which happened to be the 11/7 build.
Updating reference A copied the correct DLL into the Bin folder. Updating reference B overrode it at compile time.