MSBuild fails to report errors during restore on Directory.Packages.props
- Dominant language
- C#
- Stars
- 5.5k
- Forks
- 1.5k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 141
Description
### Issue Description
When running `dotnet restore`, msbuild is failing to report errors in importing the Directory.Packages.props due to syntactic errors. This misleads the user into thinking that they have package version issues, when in fact their package versions may be fine, but they have syntax errors in their package versions.
### Steps to Reproduce
1. ensure dotnet sdk 6.0.402 is installed and the only installed 6.x version.
2. clone the project at https://github.com/erinlah-ms/bug-repros/tree/main/repro-cpm-nowarn
3. dotnet restore /bl
### Expected Behavior
Expect error `Directory.Packages.props(10,3): error MSB4085: A must contain
at least one `
### Actual Behavior
The following misleading error appears. (Note, in the real world use case, user received dozens of Nu1202 and Nu1701 errors that mislead user into wasting time trying to figure out where the bad package versions were being imported.)
```
repro-cpm-nowarn.csproj : error NU1604: Project dependency Microsoft.NE
TFramework.ReferenceAssemblies does not contain an inclusive lower bound. Include a lower bound in the dependency versi
on to ensure consistent restore results.
```
### Analysis
Suspect this relates to the `WarnAndContinue` setting. This setting instructs msbuild to defer certain kinds of error processing during the 'restore' target used by nuget. However, this setting can result in msbuild failing to process inputs to the restore process, as is the case in this bug.
### Versions & Configurations
OS: Windows
dotnet/msbuild versions:
```
$ dotnet --version
6.0.402
$ dotnet msbuild --version
MSBuild version 17.3.2+561848881 for .NET
17.3.2.46306
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.