Skip to content

.NET 6: remove the concept of binding projects and add support for binding native libraries/frameworks to normal library/executable projects #10254

Open

Description

@rolfbjarne

There's nothing special about binding projects that couldn't also be made to work from other projects (library / executable) projects, so to simplify things, we should just make that happen for .NET 6.

Some care would have to be taken with regards to default compile includes, since there will be *.cs files in the project directory which should be pre-processed, and not passed to csc like other *.cs files (ApiDefinition.cs / StructsAndEnums.cs, etc).

Scenarios (to add tests for):

  • Creating a NuGet for a library project with a binding.
  • Referencing a library project with a binding from an executable project.
  • Referencing a library project with a binding in another library project.
  • Adding a binding directly to an executable project.

Activity

  1. added
    enhancementThe issue or pull request is an enhancement
    macOSIssues affecting macOS
    iOSIssues affecting iOS
    dotnetAn issue or pull request related to .NET
    on Dec 10, 2020
  2. added this to the .NET 6 milestone on Dec 10, 2020
  3. added
    dotnet-pri1.NET 6: important for stable release
    featureA feature to be implemented
    and removed
    enhancementThe issue or pull request is an enhancement
    on Feb 3, 2021
  4. modified the milestones: .NET 6, .NET 7 on Jan 25, 2022
  5. modified the milestones: .NET 7, .NET 8 on Aug 26, 2022
  6. modified the milestones: .NET 8, .NET 9 on Sep 12, 2023
  7. moved this to Technical Debt in .NET 9on Aug 27, 2024
  8. modified the milestones: .NET 9, .NET 10 on Sep 27, 2024
  9. modified the milestones: .NET 10, .NET 11 on Oct 22, 2025
  10. rolfbjarne commented on Jul 9, 2026

    @rolfbjarne
    MemberAuthor

    One way to implement this would be to set IsBindingProject=true if the project has any @(ObjcBindingApiDefinition) items. Then the concept of a binding project will really just be something we use internally, and customer projects can just remove IsBindingProject=true from their projects.

    However, we'll have to check with any IDEs to see if they check @(ProjectCapability) for "<platform>BindingProject", because otherwise we might have a chicken-and-egg problem: if an IDE shows a custom UI for binding projects (to add api definitions for instance), but the project isn't a binding project (because it doesn't have an api definition yet).

    That said, I'm not sure if there's a great benefit here, having a binding-project/class-library-project split isn't that onerous on us at the moment anyway

  11. modified the milestones: .NET 11, .NET 12 on Jul 9, 2026
  12. dalexsoto commented on Jul 9, 2026

    @dalexsoto
    Member

    Yeah tbh having it being explicit seems more user friendly, than it being an obscure feature that customers need to know about ObjcBindingApiDefinition while templates solve the need to know probably it is also better for AI now having that property IsBindingProject around

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    binding-projectsIssue or PR that affects binding projectsdotnetAn issue or pull request related to .NETfeatureA feature to be implementediOSIssues affecting iOSmacOSIssues affecting macOS

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions