I get the following error:
The CLR has been unable to transition from COM context 0x1a01d0 to COM context 0x1a0340 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.
when I run the following code:
[VB]
Dim files As ReadOnlyCollection(Of String)
files = My.Computer.FileSystem.GetDirectories(pathString, FileIO.SearchOption.SearchAllSubDirectories)
[/VB]
This just gets all the sub-directories in a specified folder. The error only occurs when pathString is set to a folder with a lot of subfolders in it (4000+).
I dont know how to interpret the error message to make this code work. I just know that after 60 seconds the program errors out. Can anyone tell me what I need to do to make this work when there is a lot of folders/subfolders? Thanks...
The CLR has been unable to transition from COM context 0x1a01d0 to COM context 0x1a0340 for 60 seconds. The thread that owns the destination context/apartment is most likely either doing a non pumping wait or processing a very long running operation without pumping Windows messages. This situation generally has a negative performance impact and may even lead to the application becoming non responsive or memory usage accumulating continually over time. To avoid this problem, all single threaded apartment (STA) threads should use pumping wait primitives (such as CoWaitForMultipleHandles) and routinely pump messages during long running operations.
when I run the following code:
[VB]
Dim files As ReadOnlyCollection(Of String)
files = My.Computer.FileSystem.GetDirectories(pathString, FileIO.SearchOption.SearchAllSubDirectories)
[/VB]
This just gets all the sub-directories in a specified folder. The error only occurs when pathString is set to a folder with a lot of subfolders in it (4000+).
I dont know how to interpret the error message to make this code work. I just know that after 60 seconds the program errors out. Can anyone tell me what I need to do to make this work when there is a lot of folders/subfolders? Thanks...