473,378 Members | 1,518 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Sourcesafe automation in VB.Net

I am trying to call the Get method on the VSSItem object for a specific
file, but I keep getting an COMException that includes:

Additional information: This command only works on projects.

According to the docs:

"The Get method may be called against both file and project objects. When
called against a project, all files in the project are gotten regardless of
their CheckOut status."

Here's the code I am using. v is a VSSItem object that points at the SS
project I am working with. The exception occurs on the Get method:

For Each i In v.Items
If i.Type = VSSItemType.VSSITEM_FILE Then
i.Get(i.LocalSpec, VSSFlags.VSSFLAG_REPSKIP)
End If
Next

Does anyone have an example of code that can show me how to get the latest
version of a file, not a project? I do not want to check it out, just get
the latest version.

Thanks,

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #1
8 4523
Chris,

Do you want the file in ur system? if so, pass a reference to the path as
the 1st param in Get():

VSSItem.Get(ref targetFolder,0)

Hope that helps.

--
Cheers!
Rajiv. R
Rajspace.Org

"Chris Dunaway" <dunawayc@_lunchmeat_sbcglobal.net> wrote in message
news:1c*****************************@40tude.net...
I am trying to call the Get method on the VSSItem object for a specific
file, but I keep getting an COMException that includes:

Additional information: This command only works on projects.

According to the docs:

"The Get method may be called against both file and project objects. When
called against a project, all files in the project are gotten regardless of their CheckOut status."

Here's the code I am using. v is a VSSItem object that points at the SS
project I am working with. The exception occurs on the Get method:

For Each i In v.Items
If i.Type = VSSItemType.VSSITEM_FILE Then
i.Get(i.LocalSpec, VSSFlags.VSSFLAG_REPSKIP)
End If
Next

Does anyone have an example of code that can show me how to get the latest
version of a file, not a project? I do not want to check it out, just get
the latest version.

Thanks,

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.

Nov 20 '05 #2
Chris,

Do you want the file in ur system? if so, pass a reference to the path as
the 1st param in Get():

VSSItem.Get(ref targetFolder,0)

Hope that helps.

--
Cheers!
Rajiv. R
Rajspace.Org

"Chris Dunaway" <dunawayc@_lunchmeat_sbcglobal.net> wrote in message
news:1c*****************************@40tude.net...
I am trying to call the Get method on the VSSItem object for a specific
file, but I keep getting an COMException that includes:

Additional information: This command only works on projects.

According to the docs:

"The Get method may be called against both file and project objects. When
called against a project, all files in the project are gotten regardless of their CheckOut status."

Here's the code I am using. v is a VSSItem object that points at the SS
project I am working with. The exception occurs on the Get method:

For Each i In v.Items
If i.Type = VSSItemType.VSSITEM_FILE Then
i.Get(i.LocalSpec, VSSFlags.VSSFLAG_REPSKIP)
End If
Next

Does anyone have an example of code that can show me how to get the latest
version of a file, not a project? I do not want to check it out, just get
the latest version.

Thanks,

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.

Nov 20 '05 #3
On Mon, 5 Apr 2004 21:10:36 +0530, Rajiv R wrote:
Chris,

Do you want the file in ur system? if so, pass a reference to the path as
the 1st param in Get():

VSSItem.Get(ref targetFolder,0)

Hope that helps.


Thanks for the response. I have changed the code to the following. That
seemed to have resolved my first problem, now I am encountering another.
When this code runs, every file returns an exception "Version Not Found".

HOWEVER: If I step through the code in debug mode, it doesn't!!!!! Just
running the code I get the exception, but stepping through the code line by
line, NO EXCEPTIONS!!??!!

Any thoughts on that one?

Private Sub GetLatestFiles(ByVal prj As VSSItem)
Dim i As VSSItem

For Each i In prj.Items
If i.Type = VSSItemType.VSSITEM_FILE Then
pbProgress.Increment(1)
Try
i.Get(i.Parent.LocalSpec & "\" & i.Name,0)
Catch ex As COMException
Debug.WriteLine("Error getting file: " & ex.Message)
End Try
pbProgress.Update()
sbStatus.Update()
Else
sbpFile.Text = "Getting " & i.Name
pbProgress.Update()
sbStatus.Update()
GetLatestFiles(i)
End If
Next
End Sub

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #4
On Mon, 5 Apr 2004 21:10:36 +0530, Rajiv R wrote:
Chris,

Do you want the file in ur system? if so, pass a reference to the path as
the 1st param in Get():

VSSItem.Get(ref targetFolder,0)

Hope that helps.


Thanks for the response. I have changed the code to the following. That
seemed to have resolved my first problem, now I am encountering another.
When this code runs, every file returns an exception "Version Not Found".

HOWEVER: If I step through the code in debug mode, it doesn't!!!!! Just
running the code I get the exception, but stepping through the code line by
line, NO EXCEPTIONS!!??!!

Any thoughts on that one?

Private Sub GetLatestFiles(ByVal prj As VSSItem)
Dim i As VSSItem

For Each i In prj.Items
If i.Type = VSSItemType.VSSITEM_FILE Then
pbProgress.Increment(1)
Try
i.Get(i.Parent.LocalSpec & "\" & i.Name,0)
Catch ex As COMException
Debug.WriteLine("Error getting file: " & ex.Message)
End Try
pbProgress.Update()
sbStatus.Update()
Else
sbpFile.Text = "Getting " & i.Name
pbProgress.Update()
sbStatus.Update()
GetLatestFiles(i)
End If
Next
End Sub

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #5
On Mon, 5 Apr 2004 11:17:59 -0500, Chris Dunaway wrote:

Thanks for any and all responses, but I resolved the issue.

Apparently, I was using a version 5 of the VSS database without realizing
it. Here is a KB article that helped me RESOLVE the problem:

http://support.microsoft.com/default...97&Product=vss
--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #6
On Mon, 5 Apr 2004 11:17:59 -0500, Chris Dunaway wrote:

Thanks for any and all responses, but I resolved the issue.

Apparently, I was using a version 5 of the VSS database without realizing
it. Here is a KB article that helped me RESOLVE the problem:

http://support.microsoft.com/default...97&Product=vss
--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.
Nov 20 '05 #7
Have a look at the sample application written in VB at:

http://msdn.microsoft.com/ssafe/downloads/samples.asp

It does its best using the automation model to duplicate the VSS Explorer
interface. Usually you can see how things are done from the code there.

If you need the VSS Automation documentation, you can find it here:

http://msdn.microsoft.com/ssafe/technical/articles.asp

Joe

"Chris Dunaway" <dunawayc@_lunchmeat_sbcglobal.net> wrote in message
news:1c*****************************@40tude.net...
I am trying to call the Get method on the VSSItem object for a specific
file, but I keep getting an COMException that includes:

Additional information: This command only works on projects.

According to the docs:

"The Get method may be called against both file and project objects. When
called against a project, all files in the project are gotten regardless of their CheckOut status."

Here's the code I am using. v is a VSSItem object that points at the SS
project I am working with. The exception occurs on the Get method:

For Each i In v.Items
If i.Type = VSSItemType.VSSITEM_FILE Then
i.Get(i.LocalSpec, VSSFlags.VSSFLAG_REPSKIP)
End If
Next

Does anyone have an example of code that can show me how to get the latest
version of a file, not a project? I do not want to check it out, just get
the latest version.

Thanks,

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.

Nov 20 '05 #8
Have a look at the sample application written in VB at:

http://msdn.microsoft.com/ssafe/downloads/samples.asp

It does its best using the automation model to duplicate the VSS Explorer
interface. Usually you can see how things are done from the code there.

If you need the VSS Automation documentation, you can find it here:

http://msdn.microsoft.com/ssafe/technical/articles.asp

Joe

"Chris Dunaway" <dunawayc@_lunchmeat_sbcglobal.net> wrote in message
news:1c*****************************@40tude.net...
I am trying to call the Get method on the VSSItem object for a specific
file, but I keep getting an COMException that includes:

Additional information: This command only works on projects.

According to the docs:

"The Get method may be called against both file and project objects. When
called against a project, all files in the project are gotten regardless of their CheckOut status."

Here's the code I am using. v is a VSSItem object that points at the SS
project I am working with. The exception occurs on the Get method:

For Each i In v.Items
If i.Type = VSSItemType.VSSITEM_FILE Then
i.Get(i.LocalSpec, VSSFlags.VSSFLAG_REPSKIP)
End If
Next

Does anyone have an example of code that can show me how to get the latest
version of a file, not a project? I do not want to check it out, just get
the latest version.

Thanks,

--
Chris

To send me an E-mail, remove the underscores and lunchmeat from my E-Mail
address.

Nov 20 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Rod | last post by:
I'm having trouble with VS.NET2003 and Visual SourceSafe. I upgraded from VS.NET2002 with Visual SourceSafe already installed, and then upgraded to 2003. My Source Control option has disappeared...
3
by: Lou | last post by:
SSADMIN.exe crashes when I try to run it? What can i do about this. Could it be an .ini setting??? The error message is: Microsoft SourceSafe User Shell has encountered a problem and needs to...
1
by: uphid | last post by:
So, we recently spent the last few hours chasing a rather obscure bug... We thought we would share with the group in the hopes that someone else finds this information useful. We use Access...
0
by: Nick Zdunic | last post by:
Hi, I'm trying to get this going and I believe I have followed all the steps outlined in the documentation. I have selected to Add To Source Control the stored procedures in my database from...
1
by: Mike Hutton | last post by:
I need some help. I am trying to set up our development environment so as to make life easy for my fellow developers (none of whom have used ASP.NET or VS.NET before). We are developing our...
4
by: Jason Shohet | last post by:
I'm using Visual Studio, with ASP.NET. Is VSS on a separate CD. Also, is it possible to use the VSS beta (2005) with .NET if I'm not using the .NET beta. And finally, where do I get the VSS...
6
by: Chris Dunaway | last post by:
I am trying to call the Get method on the VSSItem object for a specific file, but I keep getting an COMException that includes: Additional information: This command only works on projects. ...
0
by: CheshireCat | last post by:
Hi, I've just installed 2008 on my home pc and am trying to open a project, stored in sourcesafe, across the internet. Ive enabled the sourcesafe internet plug in. In VS2005, I would select to...
6
by: teddysnips | last post by:
I'm having trouble adding Access 2003 databases to Sourcesafe. I go to Tools, Sourcesafe, Add Database to Sourcesafe... at which point a message box appears saying "This database must be closed...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.