dotnet / dotnet/project-system
Adding a COM reference causes one instance of overbuild
- Dominant language
- C#
- Stars
- 1k
- Forks
- 415
- PR merge metrics
- No merged PRs in 30d
Description
## Visual Studio Version
17.2
## Steps to Reproduce
1. Create a .NET project
2. Add a COM reference
3. Build
4. Build again
## Expected Behavior
The second build should be up-to-date
## Actual Behavior
The second build occurs due to:
```
Adding UpToDateCheckBuilt outputs:
C:\MyProject\bin\Debug\net6.0\MyProject.dll
C:\MyProject\obj\Debug\net6.0\MyProject.pdb
C:\MyProject\obj\Debug\net6.0\MyProject.dll
C:\MyProject\bin\Debug\net6.0\MyProject.pdb
Adding project file inputs:
C:\MyProject\MyProject.csproj
Adding newest import input:
C:\MyProject\MyProject.csproj
Adding Compile inputs:
C:\MyProject\Program.cs
Adding ResolvedCompilationReference inputs:
C:\MyProject\obj\Debug\net6.0\Interop.AZROLESLib.dll
Input ResolvedCompilationReference item 'C:\MyProject\obj\Debug\net6.0\Interop.AZROLESLib.dll' (22/03/2022 14:34:41) has been modified since the last up-to-date check (22/03/2022 14:34:40), not up-to-date.
Up-to-date check completed in 1.0 ms
```
## User Impact
A third build will be correctly identified as up-to-date:
```
Adding UpToDateCheckBuilt outputs:
C:\MyProject\bin\Debug\net6.0\MyProject.dll
C:\MyProject\obj\Debug\net6.0\MyProject.pdb
C:\MyProject\obj\Debug\net6.0\MyProject.dll
C:\MyProject\bin\Debug\net6.0\MyProject.pdb
Adding project file inputs:
C:\MyProject\MyProject.csproj
Adding newest import input:
C:\MyProject\MyProject.csproj
Adding Compile inputs:
C:\MyProject\Program.cs
Adding ResolvedCompilationReference inputs:
C:\MyProject\obj\Debug\net6.0\Interop.AZROLESLib.dll
No inputs are newer than earliest output 'C:\MyProject\obj\Debug\net6.0\MyProject.pdb' (22/03/2022 14:34:42). Newest input is 'C:\MyProject\obj\Debug\net6.0\Interop.AZROLESLib.dll' (22/03/2022 14:34:41).
Adding input reference copy markers:
obj\Debug\net6.0\Interop.AZROLESLib.dll
Adding output reference copy marker:
C:\MyProject\obj\Debug\net6.0\MyProject.csproj.CopyComplete
No input markers exist, skipping marker check.
Project is up-to-date.
Up-to-date check completed in 1.0 ms
```
Therefore the impact of this is fairly limited. The extra build will occur only for a project that has a COM reference, and only after clone or clean.
Contributor guide
Assessment
This issue has not been assessed yet.