DirectoryNotFoundException thrown during glob evaluation
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 890
- Avg merge
- 2h 11m
- Merged PRs (30d)
- 10
Description
**Operating System**: `Windows`
**DocFX Version Used**: 2.45.1.0
**Template used**: `default`
I'm running docfx on a folder which contains some deeply nested paths (Yarn / NPM). I get a `DirectoryNotFoundException` related to one of these paths as soon as I run docfx.
I have tried to exclude this path using the `exclude` below, since I am not interested in running docfx on these folders - but this technically requires the glob to be evaluated against the package cache anyway in order to exclude it.
```
"exclude": [ "**/packages-cache/**", "**/node_modules/**" ]
```
If I use the config below (no globbing), it works as expected:
```
"src": [{ "src": "../../", "files": [ "*/*.csproj" ] }]
```
Full exception is:
```
System.IO.DirectoryNotFoundException: Could not find a part of the path 'D:\Working\Blah\Blah\trunk\MyWebApp\build\packages-cache\v4\npm-babel-plugin-transform-cjs-system-wrapper-0.3.0-f5759f29becd356faab7af52c99cde8e7bad0b21\node_modules\babel-plugin-transform-cjs-system-wrapper\test\fixtures\not-return-module.export-if-module-redeclared-in-scope'.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileSystemEnumerableIterator1.CommonInit()
at System.IO.FileSystemEnumerableIterator1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler1 resultHandler, Boolean checkHost)
at System.IO.Directory.GetFiles(String path, String searchPattern, SearchOption searchOption)
at Microsoft.DocAsCode.Glob.FileGlob.d__2.MoveNext()
at Microsoft.DocAsCode.Glob.FileGlob.d__2.MoveNext()
at Microsoft.DocAsCode.Glob.FileGlob.d__2.MoveNext()
at Microsoft.DocAsCode.Glob.FileGlob.d__2.MoveNext()
at Microsoft.DocAsCode.Glob.FileGlob.d__2.MoveNext()
at Microsoft.DocAsCode.Glob.FileGlob.d__2.MoveNext()
at Microsoft.DocAsCode.Glob.FileGlob.d__2.MoveNext()
at Microsoft.DocAsCode.Glob.FileGlob.d__2.MoveNext()
at Microsoft.DocAsCode.Glob.FileGlob.d__2.MoveNext()
at Microsoft.DocAsCode.Glob.FileGlob.d__2.MoveNext()
at Microsoft.DocAsCode.Glob.FileGlob.d__2.MoveNext()
at Microsoft.DocAsCode.Glob.FileGlob.d__1.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable1 collection)
at Microsoft.DocAsCode.GlobUtility.ExpandFileMapping(String baseDirectory, FileMapping fileMapping)
at Microsoft.DocAsCode.SubCommands.MetadataCommand.ConvertToInputModel(MetadataJsonItemConfig configModel)
at Microsoft.DocAsCode.SubCommands.MetadataCommand.ExecCore()
at Microsoft.DocAsCode.SubCommands.MetadataCommand.Exec(SubCommandRunningContext context)
at Microsoft.DocAsCode.SubCommands.CompositeCommand.Exec(SubCommandRunningContext context)
at Microsoft.DocAsCode.Program.ExecSubCommand(String[] args)
```
Contributor guide
Assessment
This issue has not been assessed yet.