Visitar URL original
Can't use InternalsVisibleTo to expose internal C# classes to Python code · Issue #2560 · pythonnet/pythonnet · GitHub
Skip to content

Can't use InternalsVisibleTo to expose internal C# classes to Python code #2560

Description

@pbregener

My .NET class library has an internal class that I want to use from Python.

I tried various variations of InternalsVisibleTo on the C# end (had hoped that <InternalsVisibleTo Include="Python.Runtime" /> in the csproj would be enough), but cannot get it to work.

Once I change the class from internal to public it’s all working fine.
Is this expected/working as designed? Or is there a way to make internal objects accessible to Python code?

Activity

  1. locked and limited conversation to collaborators on Mar 14, 2025
  2. converted this issue into a discussion #2562 on Mar 14, 2025
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions