dotnet / dotnet/sdk

Assembly Version Conflict: Targeted net8.0-ios17.2 Project Fails with Microsoft.iOS, Version=18.0.0.0 Dependency Mismatch

Open
#44,388 1 comment 0 reactions 1 assignee Claimed by @dsplaisted View on GitHub
Area-NetSDK untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

**Description:** I am encountering a version conflict when targeting net8.0-ios17.2 in my project. The problem arises when creating NuGet packages on a machine with the latest .NET SDK. The package appears to automatically target Microsoft.iOS, Version=18.0.0.0, despite specifying net8.0-ios17.2 in the project file.

When I add this package to a project and attempt to build it on another machine without the latest .NET SDK, I receive the following error:

`Error: Assembly uses 'Microsoft.iOS, Version=18.0.0.0', which has a higher version than referenced assembly 'Microsoft.iOS' with identity 'Microsoft.iOS, Version=17.2.0.0'
`

**Expected Behavior:** The project should build successfully with when targeting net8.0-ios17.2, without triggering a conflict with Microsoft.iOS, Version=18.0.0.0.

**Actual Behavior:** The build fails due to a version mismatch, as the assembly version defaults to Microsoft.iOS, Version=18.0.0.0, rather than respecting the specified target of 17.2.0.0 in the .csproj file.

**Steps to reproduce:**

1. On a machine with the latest .NET SDK, create a NuGet package targeting net8.0-ios17.2.
2. Add this package to a project on another machine that does not have the latest .NET SDK.
3. Ensure the project’s .csproj file explicitly targets net8.0-ios17.2.
4. Build the project and observe the version conflict error in the output.

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.