Skip to content

Device build fails with Error NETSDK1047 #24487

@marcoburato-ecutek

Description

@marcoburato-ecutek

Apple platform

iOS

Framework version

net10.0-*

Affected platform version

.NET iOS 26.2.10191/10.0.100

Description

I'm upgrading our app from .NET 9 to .NET 10. I had it building for both the Simulator and my device, but at some point it started failing with this error:

0>Microsoft.PackageDependencyResolution.targets(266,5): Error NETSDK1047 : Assets file '/Users/marco/Desktop/App/EviApp/EviApp.iOS/obj/project.assets.json' doesn't have a target for 'net10.0-ios26.2/ios-arm64'. Ensure that restore has run and that you have included 'net10.0-ios26.2' in the TargetFrameworks for your project. You may also need to include 'ios-arm64' in your project's RuntimeIdentifiers.

I tried to delete the bin, obj folders and the NuGet packages folder to start from a clean state, but I keep getting the same error.

It seems like it's trying to do a simulator build even when it should do a device build. This happens in both Debug and Release configuration.

I'm using JetBrains Rider 2025.3.1 as the IDE.

This should be the relevant part of the project file:

<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
    <TargetFramework>net10.0-ios26.2</TargetFramework>
    <OutputType>Exe</OutputType>
    <SupportedOSPlatformVersion>15.0</SupportedOSPlatformVersion>
    <Configurations>Debug;Release</Configurations>
    <RootNamespace>EviApp</RootNamespace>
    <EnableDefaultNoneItems>false</EnableDefaultNoneItems>
    <TrimmerSingleWarn>false</TrimmerSingleWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <DefineConstants>TRACE</DefineConstants>
    <WarningLevel>4</WarningLevel>
    <NoWarn>1701;1702;IL2026;IL2035;IL2036;IL2057;IL2062;IL2065;IL2067;IL2072;IL2080</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <DefineConstants>TRACE</DefineConstants>
    <WarningLevel>4</WarningLevel>
    <NoWarn>1701;1702;IL2026;IL2035;IL2036;IL2057;IL2062;IL2065;IL2067;IL2072;IL2080</NoWarn>
</PropertyGroup>

If I add

<RuntimeIdentifiers>ios-arm64;iossimulator-x64</RuntimeIdentifiers>

then the build produces this warning:

0>Xamarin.Shared.Sdk.targets(309,3): Warning  : RuntimeIdentifier was set on the command line, and will override the value for RuntimeIdentifiers set in the project file.

...however, it will build successfully.

I don't think that's the right solution, though. Always building both RIDs would be a waste of time and I would not want to include x64 binaries when building the app bundle for release.

Steps to Reproduce

  1. Select a real device in the IDE as the run target
  2. Build the project (either Debug or Release)

Did you find any workaround?

No

Build logs

I can't provide build logs publicly, but I can send them privately if there's a way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThe issue or pull request is an enhancementneed-infoWaiting for more information before the bug can be investigatedno-auto-replyFor internal use

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions