views:

876

answers:

5

I'll try to make this as straight forward as possible.

  1. Currently our team has a VSS database where our projects are stored.
  2. Developers grab the code and place on their localhost machine and develop locally.
  3. Designated developer grabs latest version and pushes to development server.

The problem is, when a file is removed from the project (by deleting it in VS2008) then the next time another developer (not the one who deleted it) checks in, it prompts them to check in those deleted files because they still have a copy on their local machine.

Is there a way around this? To have VSS instruct the client machine to remove these files and not prompt them to check back in? What is the preferred approach for this?


Edit Note(s):

  1. I agree SVN is better than VSS
  2. I agree Web Application project is better than Web Site project
  3. Problem: This same thing happens with files which are removed from class libraries.
+4  A: 

You number one way around this is to stop using web site projects. Web Site Projects cause visual studio to automatically add anything it finds in the project path to the project.

Instead, move to Web Application Projects which don't have this behavior problem.

Web Site projects are good for single person developments.

UPDATE:

VB shops from the days gone past had similiar issues in that whatever they had installed affected the build process. You might take a page from their playbook and have a "clean" build machine. Prior to doing a deployment you would delete all of the project folders, then do a get latest. This way you would be sure that the only thing deployed is what you have in source control.

Incidentally, this is also how the TFS Build server works. It deletes the workspace, then creates a new one and downloads the necessary project files.

Further, you might consider using something like Cruise Control to handle builds.

Chris Lively
Hey Chris - Thanks for the response. Unfortunately not the ideal solution at the moment since we have been going down this path for a while, and changes to the process are slower the more people we have. I will make this recommendation going forward though.
Kyle B.
There are a lot of problems with Web Site projects especially in regards to team development. WS was a new project type added for VS2005. By VS2005 SP1, MS had already started moving away from it to WAPs.
Chris Lively
We have the same issue, except I am now a team of 1 so it no longer is an issue. This was the only solution we could come up with.
JoshBerke
I'm curious how using a build machine will prevent someone from accidentally checking in files which were previously deleted?
Kyle B.
Also, this is a problem with class libraries, not just web site projects.
Kyle B.
@Kyle: When utilizing a build machine, prior to getting the latest source code you delete the entire local workspace. This removes any dead files or other crap. Then you get latest, build, and deploy.
Chris Lively
A: 

Your best solution would be to switch to a better version control system, like SVN.

At my job we recently acquired a project from an outsourcing company who did use VSS as their version control. We were able to import all of the change history into SVN from VSS, and get up and running pretty quickly with SVN at that point.

And with SVN, you can set up ignores for files and folders, so the files in your web projects dont get put into SVN and the ignore attributes are checked out onto each developer's machine

I believe we used VSSMigrate to do the migration to SVN http://www.poweradmin.com/sourcecode/vssmigrate.aspx

bwknight877
I see that git is gaining traction. I was crushed when Linus Torvalds spoke harshly about svn. I still like it very much.
duffymo
I use SVN at home and I agree with you, unfortunately the business is entrenched in VSS at the moment. change is slow, would prefer a solution using VSS and Web site project, even though I realize this is not an ideal scenario.
Kyle B.
I think this problem would still occur with SVN? Isn't the issue that Visual Studio thinks all the files in a directory are part of the new site and then will do the add for any file not in a source control?
JoshBerke
I think the AnkhSVN plugin for VS is smart enough to not include some certain files, but with SVN your blacklist of ignored files is stored in SVN, so each checkout folder on each dev's machine has that same list of ignored files
bwknight877
+1  A: 

Maybe the dev should take care to only check in or add things that they have been working on. Its kind of sloppy if they are adding things that they were not even using.

StingyJack
Agreed, still some learners in the process of development though. Not everyone like you and I can be perfect all the time :)
Kyle B.
@StingyJack: The problem really isn't the developer, it's the project type. Everything from references to the files that make up the project are automatically updated every time the solution is opened. The dev can't do anything about this.
Chris Lively
A: 

VSS is an awful versioning system and you should switch to SVN but that's got nothing to do with the crux of the problem. The project file contains references to what files are actually part of the project. If the visual studio project isn't checked in along with the changes to it, theres no way for any other developer to be fully updated hence queries to delete files when they grab the latest from VSS. From there you've got multiple choices...

  1. Make the vbproj part of the repository. Any project level changes will be part of the commit and other developers can be notified. Problem here is it's also going to be on the dev server. Ideally you could use near the same process to deploy to dev as you would to deploy as release. This leads into the other way...

  2. SVN gives you hooks for almost all major events, where hooks are literally just a properly named batch file / exe. For your purposes, you could use a post-commit hook to push the appropriate files, say via ftp, to the server on every commit. File problems solved, and more importantly closer towards the concept of continuous integration.

Krypes
A: 

Something you may want to consider doing:

  1. Get Latest (Recursive)
  2. Check In ...

Its a manual process, but it may give you the desired result, plus if VS talks about deleted files, you know they should be deleted from the local machine in step 1.

Redbeard 0x0A