Home Directory.GetFiles() does not look at parent folder
Reply: 0

Directory.GetFiles() does not look at parent folder

user777
1#
user777 Published in May 22, 2018, 9:09 pm

In the past this worked fine, but not anymore. I used the line of code below to retrieve files from this location:

C:\Users\ZAT\source\repos\KPItoolConsole\KPItoolConsole\input\patterns

string[] files = Directory.GetFiles(@"input\patterns", "*.json", SearchOption.AllDirectories);

But now I get the following error when debugging:

Could not find a part of the path 'C:\Users\ZAT\source\repos\KPItoolConsole\KPItoolConsole\bin\Debug\netcoreapp2.0\input\patterns'

Can someone tell me how I can make it look at the parent folder again?

This is for a Console .NET Core application. I think it stopped working after a Visual Studio update.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.330682 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO