Uploaded image for project: 'Couchbase .NET client library'
  1. Couchbase .NET client library
  2. NCBC-2991

DI NET 6.0 - PlatformNotSupportedException is thrown

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • 3.2.0
    • 3.2.5
    • library
    • None
    • 1

    Attachments

      No reviews matched the request. Check your Options in the drop-down menu of this sections header.

      Activity

        Jeff Morris

        Actually, the core problem is the way the assemblies were built. 3.2.0 was built signed (with SIGNING constant defined) while 3.1.6 was built unsigned. This changes the behaviors of the NamedBucketProxyGenerator. If 3.1.6 had been built signed we'd be seeing the same problem.

        It's possible that we can get away with not needing the dynamic assembly to be strongly signed on .NET 6, in which case we'll have to add a net6.0 target that also suppresses the signing logic in NamedBucketProxyGenerator.

        btburnett3 Brant Burnett added a comment - Jeff Morris Actually, the core problem is the way the assemblies were built. 3.2.0 was built signed (with SIGNING constant defined) while 3.1.6 was built unsigned. This changes the behaviors of the NamedBucketProxyGenerator. If 3.1.6 had been built signed we'd be seeing the same problem. It's possible that we can get away with not needing the dynamic assembly to be strongly signed on .NET 6, in which case we'll have to add a net6.0 target that also suppresses the signing logic in NamedBucketProxyGenerator.
        jmorris Jeff Morris added a comment -

        Brant Burnett -

        Yes, you are correct. I would love to do away with signing for .NET 6 and above and the fact its not even supported by MS is telling. The only consideration I have is for older enterprises which often require signing for whatever reason. Your solution sounds like the right move and we can document the behavior change for signing >= NET 6

        Jeff

        jmorris Jeff Morris added a comment - Brant Burnett - Yes, you are correct. I would love to do away with signing for .NET 6 and above and the fact its not even supported by MS is telling. The only consideration I have is for older enterprises which often require signing for whatever reason. Your solution sounds like the right move and we can document the behavior change for signing >= NET 6 Jeff

        Here's the change in .NET 6 that is causing the problem with strong naming: https://github.com/dotnet/runtime/pull/50941/files

        btburnett3 Brant Burnett added a comment - Here's the change in .NET 6 that is causing the problem with strong naming: https://github.com/dotnet/runtime/pull/50941/files
        jmorris Jeff Morris added a comment - And the signing code: https://github.com/couchbase/couchbase-net-client/blob/master/src/Couchbase.Extensions.DependencyInjection/Internal/ProxyModuleBuilder.cs#L17-L22
        btburnett3 Brant Burnett added a comment - - edited

        I'm not 100% sure, but I think if we just switch to use:

        #if SIGNING && !NET6_0_OR_LATER

        in ProxyModuleBuilder it may just work (combined with adding a net6.0 target to the NuGet package). This is based on the assumption that .NET no longer looks at strong names on assemblies at all in .NET 6, for any case. But that's a bit unclear to me at the moment.

        btburnett3 Brant Burnett added a comment - - edited I'm not 100% sure, but I think if we just switch to use: #if SIGNING && !NET6_0_OR_LATER in ProxyModuleBuilder it may just work (combined with adding a net6.0 target to the NuGet package). This is based on the assumption that .NET no longer looks at strong names on assemblies at all in .NET 6, for any case. But that's a bit unclear to me at the moment.
        jmorris Jeff Morris added a comment -

        I pretty sure we'll need VS2022 for .NET 6.

        jmorris Jeff Morris added a comment - I pretty sure we'll need VS2022 for .NET 6.

        People

          btburnett3 Brant Burnett
          jmorris Jeff Morris
          Votes:
          1 Vote for this issue
          Watchers:
          4 Start watching this issue

          Dates

            Created:
            Updated:
            Resolved:

            Gerrit Reviews

              There are no open Gerrit changes

              PagerDuty