dotnet / dotnet/docfx

DocFX crashes when looking for content if path contains symbolic links

Open
#7,593 0 comments 0 reactions 0 assignees View on GitHub
fundamental
Dominant language
C#
Stars
4.4k
Forks
890
Avg merge
2h 11m
Merged PRs (30d)
10

Description

**Operating System**: Windows

**DocFX Version Used**: 2.58.2

**Template used**: default

**Steps to Reproduce**:

In a repo where the files tree contains symbolic links, DocFX crashes with this error:

```txt
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileSystemEnumerableIterator`1.CommonInit()
at System.IO.FileSystemEnumerableIterator`1..ctor(String path, String originalUserPath, String searchPattern, SearchOption searchOption, SearchResultHandler`1 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__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(IEnumerable`1 collection)
at Microsoft.DocAsCode.GlobUtility.ExpandFileMapping(String baseDirectory, FileMapping fileMapping)
at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.ConfigToParameter(BuildJsonConfig config, TemplateManager templateManager, ChangeList changeList, String baseDirectory, String outputDirectory, String templateDir)
at Microsoft.DocAsCode.SubCommands.DocumentBuilderWrapper.BuildDocument(BuildJsonConfig config, TemplateManager templateManager, String baseDirectory, String outputDirectory, String pluginDirectory, String templateDirectory)
at Microsoft.DocAsCode.SubCommands.BuildCommand.BuildDocument(String baseDirectory, String outputDirectory)
at Microsoft.DocAsCode.SubCommands.BuildCommand.Exec(SubCommandRunningContext context)
at Microsoft.DocAsCode.Program.ExecSubCommand(String[] args)
```

This happens even if I mark the path it's trying to read in the "exclude" section of our docfx.json.

This is a MSFT internal repro if you want to see repro together via Teams.

**Expected Behavior**:

It would ignore all folders in this path, since I've marked them as exclude, or, it would resolve these file paths through the symbolic link

**Actual Behavior**:

Docfx crashes

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.