# error NU1107: Version conflict detected for 'PackageA'. Reference packages: PackageB 2.0.0 -> PackageA (>= 1.5.0), PackageC 3.0.0 -> PackageA (>= 2.0.0).

- **ID:** `dotnet/nuget-package-version-conflict`
- **Domain:** dotnet
- **Category:** build_error
- **Error Code:** `NU1107`
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

NuGet package version conflict occurs when different packages in the dependency graph require incompatible versions of the same package, causing the build to fail.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 5.0 | active | — | — |
| 6.0 | active | — | — |
| 7.0 | active | — | — |
| 8.0 | active | — | — |
| 9.0 | active | — | — |

## Workarounds

1. **Add a binding redirect or use a PackageReference with a specific version in the project file. Example: <PackageReference Include="PackageA" Version="2.0.0" /> and ensure all dependent packages are updated to compatible versions.** (90% success)
   ```
   Add a binding redirect or use a PackageReference with a specific version in the project file. Example: <PackageReference Include="PackageA" Version="2.0.0" /> and ensure all dependent packages are updated to compatible versions.
   ```
2. **Use the 'dotnet nuget why' command to analyze the dependency tree. Example: dotnet nuget why PackageA** (75% success)
   ```
   Use the 'dotnet nuget why' command to analyze the dependency tree. Example: dotnet nuget why PackageA
   ```
3. **Update all packages to their latest compatible versions using: dotnet list package --outdated then dotnet update package** (85% success)
   ```
   Update all packages to their latest compatible versions using: dotnet list package --outdated then dotnet update package
   ```

## Dead Ends

- **Manually editing the .csproj file to force a specific version of PackageA without considering transitive dependencies** — Forcing a version may break other packages that depend on a different version, leading to runtime errors or further conflicts. (65% fail)
- **Removing one of the conflicting packages entirely from the project** — Removing a package may remove required functionality, causing build errors or missing method exceptions. (50% fail)
- **Running 'dotnet restore --force' without resolving the version mismatch** — Restore only re-downloads packages; it does not resolve version conflicts unless package versions are explicitly aligned. (80% fail)
