 |
| General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category.
** PLEASE BE SPECIFIC WITH YOUR QUESTION **
When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

August 7th, 2007, 08:41 AM
|
|
Authorized User
|
|
Join Date: Mar 2007
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Connect to VSS check-in Check-out Programatically
Hello,
Can u give me any example that will programatically Check-in ,Check-out files, get Latest Version of a File, connecting to a VSS code etc.
Give me any suggestion that will help me.
Pls if there is any program written, give me the Link.
Thanks in advance
Rupesh Dhore
|
|

August 7th, 2007, 08:54 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
VSS is available thru COM. You can bring it in with a COM interop and access the various methods you desire.
NAnt is a build tool that has tasks for VSS operations. It's written in .NET and is hosted at sourceforge. You can download the complete source from there.
http://nant.sourceforge.net/
I believe the VSS tasks are in the NAntContrib "add-on" project.
http://nantcontrib.sourceforge.net/
Another open source .NET based application that interacts with VSS (among other SCM systems) is CruiseControl which is a continuous integration system.
http://confluence.public.thoughtworks.org/display/CCNET
Either of these two should provide you with very solid examples of .NET VSS calls.
-Peter
|
|

August 7th, 2007, 11:24 AM
|
|
Authorized User
|
|
Join Date: Mar 2007
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thank you Sir firstly for ur quick contribution/reply.
I am quite happy with ur links.
But pls can u help me by giving program, example in C#.Net
I have already included a SSAPI.dll in the references from VSS's Win32 folder.
But I don't know how to connect to the VSS is it by a connection string or something else
Secondly how to take a latest version from the VSS using a button_Click or via any event
Pls help me, give me Wrox's book or any book, a site that has the program.
Thanking you in anticipation
|
|

August 8th, 2007, 08:02 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
There isn't really a connection string per se, you provide the file path to the database config file. Something like this:
\\myserver\vss\somedatabasefolder\srcsafe.ini
Have you looked at the code for those apps I linked you to? It will have examples of the code necessary for the various VSS operations you want to perform.
-Peter
|
|

August 9th, 2007, 05:33 AM
|
|
Authorized User
|
|
Join Date: Mar 2007
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Sir , this is my present situation, I have suceeded in Checkin, Checkout
Pls help me with How to get latest?
Sir I really respect you and expect to do the needful
This is the view of my VSS
$/
|--DevTemp
| |_____Research
|--QATemp
|_____Research
DevTemp is for Developers
QA Temp is the latest solution, all deployment is done through this solution.
All changes made by Developer in DevTemp -> Research
are taken Latest in QATemp ->Research
Both the Research folder path are set to E:\Research on local derive
I have added the Source SafeTypeLib;
using SourceSafeTypeLib;
I created VSSDatabse object
IVSSDatabase vdb = new VSSDatabase();
IVSSItem vFile;
I have opened the VSS by open statement on Form_Load
vdb.Open(@"\\dev3\TestDeploy1\srcsafe.ini", "spatil", "spatil");
string s = "$/QATemp/Research/abc.xml"
vFile = vdb.get_VSSItem(s, false);
Check-out can be achieved by
vFile.Checkout("", "E:\\Research\\abc.xml", 0);
this checks out the file abc.xml from QATemp ->Research
********************************************
Now comes the MAJOR part
How to get the latest from the DevTemp -> Research?
********************************************
Then Check in can be done by
vFile.Checkin("", "E:\\Research\\abc.xml" + comboBox1.Text, 0);
this checks inâs the file abc.xml to QATemp ->Research
Thus changes are reflected in QATemp ->Research
|
|

August 9th, 2007, 10:30 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
In the NAntContrib source files that I referenced you will find what you need.
nantcontrib-0.85\src\Tasks\SourceSafe\GetTask.cs
Line 208: Item.Get(ref localPath, flags);
Look in the detail of the ExecuteTask method for full details.
-Peter
|
|

August 12th, 2007, 07:46 AM
|
|
Authorized User
|
|
Join Date: Mar 2007
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks Sir that does work.
|
|
 |