M
Mugsy_in_Houston
Guest
I'm writing a small program to move every folder from one location to another. When I try to test my code in the debugger, when it attempts to perform the move, a tab opens with the message:
String.cs not found
You need to find String.cs to view the source for the current call stack frame.
The first folder found at the source location is "000_Data", not "String.cs". Searching on Google, other people have reported this same error but with no solution.
My code:
Private Sub btnRun_Click(sender As Object, e As EventArgs) Handles btnRun.Click
For Each foundDir In My.Computer.FileSystem.GetDirectories(lblSrc.Text) ' "lblSrc.Text" contains full path including source foldername.
bolSkip = False ' reset
' Check for existence of folder at target. If it exists, prompt for overwrite. If not, skip.
strTargetFolder = foundDir.Substring(InStrRev(foundDir, "\"))
If My.Computer.FileSystem.DirectoryExists(strDestPath & "\" & strTargetFolder) = True Then
Dim response = MsgBox("Target folder '" & strTargetFolder & "' already exists!" & vbCrLf & vbCrLf & "Overwrite?", MsgBoxStyle.YesNo)
If response = MsgBoxResult.No Then bolSkip = True
End If
If Not bolSkip Then
lblTarget.Text = strDestPath & strTargetFolder & "\" & strTargetFolder
My.Computer.FileSystem.MoveDirectory(foundDir, strDestPath & "\" & strTargetFolder & "\", True)
End If
Next
End Sub
Error does not occur until MoveDirectory is attempted.
What is causing this and how do I fix it? TIA
-*- Mugsy -*-
Continue reading...
String.cs not found
You need to find String.cs to view the source for the current call stack frame.
The first folder found at the source location is "000_Data", not "String.cs". Searching on Google, other people have reported this same error but with no solution.
My code:
Private Sub btnRun_Click(sender As Object, e As EventArgs) Handles btnRun.Click
For Each foundDir In My.Computer.FileSystem.GetDirectories(lblSrc.Text) ' "lblSrc.Text" contains full path including source foldername.
bolSkip = False ' reset
' Check for existence of folder at target. If it exists, prompt for overwrite. If not, skip.
strTargetFolder = foundDir.Substring(InStrRev(foundDir, "\"))
If My.Computer.FileSystem.DirectoryExists(strDestPath & "\" & strTargetFolder) = True Then
Dim response = MsgBox("Target folder '" & strTargetFolder & "' already exists!" & vbCrLf & vbCrLf & "Overwrite?", MsgBoxStyle.YesNo)
If response = MsgBoxResult.No Then bolSkip = True
End If
If Not bolSkip Then
lblTarget.Text = strDestPath & strTargetFolder & "\" & strTargetFolder
My.Computer.FileSystem.MoveDirectory(foundDir, strDestPath & "\" & strTargetFolder & "\", True)
End If
Next
End Sub
Error does not occur until MoveDirectory is attempted.
What is causing this and how do I fix it? TIA
-*- Mugsy -*-
Continue reading...