Skip to content

PowerShell and Common Language Specification (CLS) compliant types #264

@ChrisLynchHPE

Description

@ChrisLynchHPE

I have yet to find any PowerShell library that supports SSL Certificate authentication. All implement username/password, which will not work for some RabbitMQ implementations. So, in trying to develop my own that implements SSL Certificate authentication, it appears that the Rabbit.Net Client library still has this nagging issue with PowerShell:

[System.Reflection.Assembly]::LoadFile('C:\Dir\RabbitMQ.Client\3.6.5\RabbitMQ.Client.dll')
$Factory = New-Object RabbitMQ.Client.ConnectionFactory
$Factory
format-default : The field or property: "uri" for type: "RabbitMQ.Client.ConnectionFactory" differs only in letter
casing from the field or property: "Uri". The type must be Common Language Specification (CLS) compliant.
    + CategoryInfo          : NotSpecified: (:) [format-default], ExtendedTypeSystemException
    + FullyQualifiedErrorId : NotACLSComplaintProperty,Microsoft.PowerShell.Commands.FormatDefaultCommand

Here are just a few users noting this issue, dating as far back as November 2011:
http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/2011-November/016313.html
https://groups.google.com/forum/#!topic/rabbitmq-users/L-5WmEUGyaY
https://groups.google.com/forum/#!topic/microsoft.public.windows.powershell/YA95OVrnhWQ

So, when trying to set any SslOption in the ConnectionFactory, I always get the error about the uri property.

I see within ConnectionFactory.cs that Uri is being defined as a System.String, while uri as type System.Uri. Is there a reason for these two public properties? They both wind up calling a private method, SetUri which only accepts a Uri object type.

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