views:

85

answers:

2

Hi. I have a VS 2008 VB.NET Solution, which is quite large. Every once in a while, if I take latest code from source control, I get hundreds of errors. These aren't real errors. They are all about classes not implementing functions/events from interfaces (which they DO implement).

"Class [class name] must implement [event or function name] for interface [interface name]"

I usually end up spending couple of hours doing a combination of: building/rebuilding the solution project by project, cleaning the solution, deleting everything locally, taking latest... etc. At some point, everything just magically builds. Does anyone have any idea what is causing this? Other people on my team experience this as well. I do not see any circular references. Any help is greatly appreciated.

+3  A: 

Yes, I've been there.

The root of the problem is that some projects are trying to build and they are dependent on the dll's that other projects generate.

You can solve this by modifying the build order of your projects.

Once you do this, everything should work fine on the first build attempt after check out.

Robert Greiner
Let me check out your link. Although, I've been through build order a few times already and so were my teammates.
Dimskiy
Sounds good. It's all about getting the dependencies defined properly. After that, you should be golden. Good luck!
Robert Greiner
My team suffers the same problem, and we've double checked our build order many times. While having the wrong build order will cause these types of errors, this is something else i think.
Caladain
So, I checked the build order about 3 times in the past couple of days. I made a tiny change, which theoretically speaking, shouldn't make a difference. As I am typing this message right now, one of my teammates is having the above mentioned problem :(
Dimskiy
Interesting... did you try building your application one project at a time? Go down the list and try to build each project, then write down the ones that build correctly. Then iterate again and hopefully you'll get more projects to build. Keep going until you are done. I know this is like O(n^2) inefficient but it may help you get the ordering down so you don't have to deal with this anymore.
Robert Greiner
I don't think it's a build order issue.
Caladain
A: 

I've seen it as well.

I think it's related to some of the metadata/files Visual studio keeps around..my running theory is that VS isn't refreshing it's internal stuff when you do the latest pull from source control. Thus it tries to do a build, it thinks some files haven't been "updated" (thus it has an old intermediate object file lying around it uses instead) gets confused, and fails.

Generally doing a combination of Build->Clean Solution, Build->Build Solution solves it most of the time. I have, twice, had to blow away the entire build directory and pull a fresh copy from source control (Clearcase) and do a fresh build.

Edit: I have Clearcase integrated with VS2008, and do my checkouts/checkins/version history from within VS2008. Not sure if using the standalone windows tool would solve this issue, and haven't the time to test (not to mention being unable to reproduce the error consistantly)

Edit2: When i say twice, i mean twice in the last 12 months or so.

Caladain
Thanks! Well, we currently have SourceSafe for this project. Deleting everything locally and pulling all latest from SS is one of the tasks I do. I don't notice any consistency in deleting/grabbing latest, building/rebuilding/cleaning, etc.
Dimskiy
I'm watching this thread closely..I'm hoping it's some voodoo setting in VS2008 that's improperly set, but i have a feeling it's just VS being VS at times. (for us at least)
Caladain
@Caladian Do you have a mix of VB.NET and C# projects in your solution by any chance?
Dimskiy
Negative, CLI/C++ only.
Caladain
So, it seems like it has something to do with memory. Theoretically speaking, once VS runs out of memory, it just spits out all references that it didn't resolve. I tried doing this: http://stevenharman.net/blog/archive/2008/04/29/hacking-visual-studio-to-use-more-than-2gigabytes-of-memory.aspx VS compiled quickly and without errors, but then the rest of my system is partially non-functional (to a point where localhost server wouldn't start up). Porting to VS 2010 doesn't resolve the issue. We're thinking of maybe restructuring the solution.
Dimskiy