Skip to content

Question: Has the way Python imports a .NET6 library changed? #1951

Closed as not planned

Description

@DareDevilDenis

To import a .NET6 library, my understanding is that the steps in Python.Net 3.0 are:

from clr_loader import get_coreclr
from pythonnet import set_runtime

runtime = get_coreclr('MyApplication.runtimeconfig.json')
set_runtime(runtime)

However, with clr-loader 0.2.3 (released 5 days ago), the call to get_coreclr with one argument fails with exception:
TypeError: get_coreclr() takes 0 positional arguments but 1 was given

I've raised this issue in clr-loader: pythonnet/clr-loader#35

However, I was wondering if the change to the get_coreclr() API might be intentional, meaning that the recommended steps to import a .NET6 library has changed. Can anyone please confirm?

Activity

  1. filmor commented on Sep 22, 2022

    @filmor
    Member
    1. This is already answered
    2. Please don't post in three places at the same time
  2. DareDevilDenis commented on Sep 22, 2022

    @DareDevilDenis
    Author

    Thanks for the quick response @filmor. Sorry for posting in three places - after raising as a bug I then wondered if it was an API change so I raised the question here. To be honest, I wasn't expecting breaking changes at this stage of release candidates. I guess these sometimes happen though - maybe breaking changes could be pinned at the top of the issues/discussion pages...

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