dotnet / dotnet/msbuild

Unexpected duplicate items

Open
#7,714 4 comments 0 reactions 0 assignees View on GitHub
Area: Language bug triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### Issue Description

In the Dependency target below, OutFiles is what I expect. But its content is duplicated when accessed in the Primary target.

The issue goes away if I remove the `Input` and `Output` attributes.

_Issue.targets:_

```xml










```

_Output:_

```
PS> dotnet build Issue.targets --nologo

In Dependency target. OutFiles: A.out;B.out
In Primary target. OutFiles: A.out;B.out;A.out;B.out
```

### Steps to Reproduce

Here's a working example, since it may depend on file time stamps:
[MSBuildIssue.zip](https://github.com/dotnet/msbuild/files/8931581/MSBuildIssue.zip)

Unzip and run `dotnet build Issue.targets`.

### Expected Behavior

```
In Dependency target. OutFiles: A.out;B.out
In Primary target. OutFiles: A.out;B.out
```

### Actual Behavior

```
In Dependency target. OutFiles: A.out;B.out
In Primary target. OutFiles: A.out;B.out;A.out;B.out
```

### Versions & Configurations

msbuild.exe
- Microsoft (R) Build Engine version 17.3.0-preview-22277-01+f1dae6ab6 for .NET Framework
17.3.0.27701

dotnet.exe
- 6.0.400-preview.22301.10

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.