Reputation: 607
I wrote some code to get the files in a directory. In order to do this I used the Directory.GetFiles method. I've used it before, so I know it exists and works.
So I started using it (I'm using the System.IO namespace) and it tells me that 'System.IO.Directory' does not contain a definition for 'GetFiles'. Indeed, if I use the intellisense, there is no such method. MSDN tells me that there is though, and I know I've used it before, and I'm 99% sure it was System.IO.Directory.
I do have System.IO.Directory... it just doesn't have that method. It has methods like 'GetCreationTime', 'GetDirectoryRoot', 'GetLastAccessTime', 'SetCurrentDirectory' and so on, but no 'GetFiles'.
Can anyone offer any help?
Upvotes: 3
Views: 2829
Reputation: 1
If you focus this issue using the framework of Silverlight 4
just change the use of .Getfiles(string directory)
into .EnumerateFiles(string directory)
instead
Upvotes: 0
Reputation: 44916
How are you making the call? That will tell us a lot about why the compiler might be complaining.
There are 3 Overloads for GetFiles on System.IO.Directory
Could you be looking for DirectoryInfo.GetFiles
Indeed, if I use the intellisense, there is no such method
The only 2 logical things I can think of that might cause this:
GetFiles
was introduced in 2.0)Upvotes: 4