Reposted under ArcObjects group.
pWorkspace = pWorkspaceFactory.OpenFromFile(prefixOutput, 0)
Dim version As IVersion = CType(pWorkspace, IVersion)
Dim versionName As String = version.VersionName
Dim targetVersion As IVersion = Nothing
' check if working with Editor's version
If version.VersionName <> strEditorVersion Then
targetVersion = CType(pWorkspace.FindVersion(strEditorVersion ), IVersion) ************ It crashes here
End If
ERROR MESSAGE
Error Message: Object reference not set to an instance of an object.Date1/16/2019
I also tried this code and it also fails:
dim version As IVersion = CType(pWorkspace, IVersion)
Dim versionName As String = version.VersionName
Dim targetVersion As IVersion = Nothing
Console.WriteLine("versionName: " & versionName)
'
' working with Editor's version
'
If version.VersionName <> strAEditingVersion Then
Dim VrsWrkSpc = CType(pWorkspace, IVersionedWorkspace3) FAILS HERE!!!!!!!!!!!
targetVersion = VrsWrkSpc.FindVersion(strEditingVersion)
End If