TFS build error: reference required
I'm using TFS (I think 2008) with VS2010, doing a team build with multiple solutions. I'm getting an error "Reference required to assembly '...' containing the base class '...'. Add one to your project." for one of the solutions.
The project in question does actually have a reference to the assembly, though, and when I build that solution on its own in VS it works fine.
This build is for a development branch, and the build definition was copied from the build definition for the trunk. I went though and changed all the path references from ../Trunk/.. to ../Dev/.., but I'm getting this error. The build for the trunk works fine, and I don't think this particular solution has any changes between the trunk and branch versions.
I'm still pretty new to TFS, so can someone suggest what might be wrong? Thanks!
EDIT: I notice there is also a warning on this build: "The referenced project '(project it was looking for above)' does not exist. I don't know why it says that, because I looked in the source folder on the build server and that file is there. But could it be trying to reference a previously built version of the file in the Trunk instead? That way the version number would be wrong... am I wildly off? Any ideas appreciated!
EDIT 2: The dll for the referenced project is getting built successfully. However, in the buildlog, when it come to the 'Task "Vbc"' part of the build, the /reference option doesn't include this dll, even though I added a direct referen开发者_Python百科ce to it in VS. The error I get is BC30007, for anyone who knows msbuild.
EDIT 3: Found the problem! Posting in case anyone has the same problem in future: It was simply that the path names for the source files were too long (the dev branch has a few extra folder levels, so the path names were a lot longer than in the trunk). Annoyingly the error messages you get in this case don't give any clue as to what the real problem is. "Reference required" indeed.
It is almost certainly a path issue. When we migrated from our previous source control / build system to TFS, we also migrated all of our projects from absolute paths to relative paths.
Look at your various .csproj files and check the reference paths for DLLs and referenced projects. Make sure that they are all stated relative to the project being built (you should see them referenced with a lot of ..\
notation. If you see a drive letter, you've got issues.
Once you get this fixed, the build should work for local builds as well as team builds, regardless of the branch.
精彩评论