htm11h
htm11h

Reputation: 1779

Source Safe check in not allowing LABEL assignment

I am trying to apply a LABEL (not a comment, which works) to a VSSItem just prior to check in of a visual source safe file.

I have tested a number of parameters, checked file type etc.

I can correctly check in the file with no issues and add the comment which is a property of the checkin method. What I am unable to do is add the label....

vssItem.Label(msg1, msg2)

msg1 and msg2 are just strings defined above the for stmt.

For Each vssItem As IVSSItem In vssFolder.Items(False)
        Console.Write(" {0}", vssItem.Name)

        Dim localPCpath As String = "C:\..\..\Projects\test\newtest"

        Dim localpath As String = Path.Combine(localPCpath, Path.GetFileName(vssItem.Name))

        **vssItem.Label(msg1, msg2)**

        vssItem.Checkin("Test 11 of checkin with label", localpath)

        If DirectCast(vssItem.IsCheckedOut, VSSFileStatus) = VSSFileStatus.VSSFILE_NOTCHECKEDOUT Then
            Console.WriteLine(vssItem.Spec + " is checked in.")
        Else
            Console.WriteLine(vssItem.Spec + " is checked out.")
        End If
Next

The error reported is....

System.Runtime.InteropServices.COMException was unhandled

ErrorCode=-2147352566

HelpLink="ssusexp.hlp#10170"

Message="Invalid access code (bad parameter)."

Source="SourceSafe"

StackTrace:

   at Microsoft.VisualStudio.SourceSafe.Interop.IVSSItem.Label(String Label, String Comment)
   at DBConversionUpdate.testSS.Button2_Click(Object sender, EventArgs e) in C:\..\..\Documents\Visual Studio 2008\Projects\DBConversionUpdate\DBConversionUpdate\testSS.vb:line 209
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(ApplicationContext context)
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()
   at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)
   at DBConversionUpdate.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81
   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

InnerException:

Let me also say, I know this is old software and many feel that MS Source Safe is junk, but I am stuck with it for now.

Upvotes: 1

Views: 202

Answers (0)

Related Questions