Sharing a single file between projects?

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
jessek
Posts: 13
Joined: Thu Mar 01, 2007 10:09 am

Sharing a single file between projects?

Post by jessek » Sun Mar 04, 2007 2:48 pm

I've got a single file (utils.js) which is used by several solutions in my repository. How do I get Visual Studio to see it? Or do I have to manage it using the Vault client directly?

I can see how to add solutions and projects to source control via VS 2005, but not individual files.

Thanks!

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Mon Mar 05, 2007 11:19 am

Do you want to share the file, so that any change in on project is reflected in the copy of the file in another project?

Do do this, use the Vault GUI Client to share the file from ProjectA to ProjectB.

Then do a get latest into your ProjectB working directory. Open ProjectB in Visual Studio. Select the project, and select Add->Existing Item. In the Add Existing Item window, select the file to add to your project. You'll get a message that the same item exists in source control; do you want it to assume that identity? Click yes. This should add the file to your project and also checkout the project file . Checkin the new file and the project file and your file should now be shared in ProjectB.
Linda Bauer
SourceGear
Technical Support Manager

Jamie Clayton
Posts: 39
Joined: Tue Oct 02, 2007 3:21 am
Location: Brisbane, Australia
Contact:

Post by Jamie Clayton » Thu Nov 01, 2007 5:59 pm

G'day,

If I do the following with Vault 4.0.4 I get an error.

1. With VS2005 solution open.
2. In Vault client application, share a file between project/folders, eg Company.snk.
3. In Vault client application, get latest version to download file to project folder.
4. Return to VS2005 and add file (right click and include in project).
5. Checkin the solution items and recieve an error on the Company.snk file. See Vault output.
Beginning transaction
Item $/Jenasys/SharedComponents/../Company.snk caused the transaction to fail: An item with the same name or object id already exists in the selected folder.
Transaction failed
I didn't get the message you suggest above (aka "Do you want to assume identity" yes/no).

Now I can seem to get this error to go away and VS2005 / vault source control marks the file "Add File" in the type column of the commit dialog screen. How do I resolve this?
Jamie Clayton
Jenasys Design Pty Ltd (Australia)

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Post by lbauer » Fri Nov 02, 2007 6:52 am

The instructions in my post were for VS 2003-style integration, which was the only type of integration prior to Vault 4.x.

You may be using the VS 2005 plugin, which behaves differently.

You can remove the Add from the pending change set by selecting the transaction and clicking on the red "undo" arrow above.
Linda Bauer
SourceGear
Technical Support Manager

Post Reply