I'm working with checking out a file to the file system and when I hit the line "Using result = Await connection.EasyCheckOutToFileSystemAsync(fileCabinetId, docId).ConfigureAwait(False)" - it exits the function and does not download a file. No exception is being thrown. I walked thru the code line by line. The variables being passed in are correct - the connection is open, fileCabinetId and docId all have values and they do match up to what DocuWare has. I'm confused on this part.
Async Function CheckOutToFileSystem(ByVal connection As ServiceConnection, ByVal fileCabinetId As String, ByVal docId As Integer) As Task(Of FileInfo)
Try
Set_Status("Downloading file...")
Using result = Await connection.EasyCheckOutToFileSystemAsync(fileCabinetId, docId).ConfigureAwait(False)
Dim tempPath = Path.Combine(Path.GetTempPath(), result.EncodedFileName)
Set_Status("Path: " & tempPath)
Using file = System.IO.File.Create(tempPath)
Using stream = result.Response.Content
Await stream.CopyToAsync(file).ConfigureAwait(False)
End Using
End Using
Set_Status("Download complete!")
Return New FileInfo(tempPath)
End Using
Catch ex As Exception
Beep()
End Try
End Function