Directory.GetFiles finds nonexisting files

后端 未结 3 615
無奈伤痛
無奈伤痛 2021-02-07 04:27

I just stumbled upon an undocumented behavior of the GetFiles methods in System.IO.Directory.

Whenever the searchPattern parameter

3条回答
  •  耶瑟儿~
    2021-02-07 04:56

    As an addendum to this, had a related issue when using a json config file in an MSTest dll. When I called it Test_Settings_Develop.json, Directory.GetFiles found it, but said it did not exist, so my tests failed to run, on attempting to load it.

    Renamed it to TestSettings_Develop.json and it worked.

提交回复
热议问题