I don't know why this error keeps popping up, but my code never used to do this.
Here is the code:
Dim proc = Process.GetProcessesByName("chrome")
For i As Integer = 0 To proc.Count - 1
proc(i).CloseMainWindow()
Next i
On the second line, the error occurs. Here is the error:
Public member 'Count' on type 'Process()' not found.
This code never did this until yesterday, I don't know what is causing it either. The code has no errors, so I am not sure that is causing it.
GetProcessesByName() returns an array. It has a
Length
property to indicate the number of elements.You might have accidentally used the Linq Enumerable.Count() extension method. An edit that removed the
Imports
statement for System.Linq would be an explanation. It is certainly best to use Length instead.