dotnet / dotnet/msbuild

Wildcard expansion is silently disabled when a glob expansion encounters an I/O exception

Open
#406 36 comments 11 reactions 0 assignees View on GitHub
Breaking Change bug Feature - Globbing Feature: Warning Waves User Experience
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 6h
Merged PRs (30d)
139

Description

This was reported as [a Connect issue](http://connect.microsoft.com/VisualStudio/feedback/details/2116449/msbuild-fails-to-find-files-in-directory-with-huge-sub-directory).

The repro is simple:

``` xml





```

Where there are files in `MyDir\node_modules` that exceed `MAX_PATH`. That returns:

```
C:\Users\raines\Downloads>msbuild test.proj
Microsoft (R) Build Engine version 14.0.24720.0
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 12/16/2015 12:46:15 PM.
Project "C:\Users\raines\Downloads\test.proj" on node 1 (default targets).
C:\Users\raines\Downloads\test.proj(8,3): warning : Inputs = MyDir\**\*.*
Done Building Project "C:\Users\raines\Downloads\test.proj" (default targets).

Build succeeded.
```

Note that the wildcards weren't actually expanded.

The original issue mentions an expectation that the `Exclude` element would prevent this from happening because that directory and all its contents are excluded. The reason that doesn't work is because we build the `Include` list fully first, then build the `Exclude` list, then do a subtraction. The failure occurs when building the `Include` list, so `Exclude` has no effect.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.