[rabbitmq-discuss] RabbitMQ.Net, Windows Powershell and CLS compliance

Jon Palmer jonspalmer at gmail.com
Mon Mar 2 00:16:45 GMT 2009


I've made the very simple change in RabbitMQ.Client.Impl.ConnectionBase to
make shutdownReport a private not public field and so far my Powershell
problems are fixed.
It feels like shutdownReport being public is just a bug and that it is
intended as the private backing field for the public property. I'll wait to
here more once the week starts.

Thanks
Jon

On Sun, Mar 1, 2009 at 11:33 AM, Alexis Richardson <
alexis.richardson at cohesiveft.com> wrote:

> Jon,
>
> Thanks very much for raising this here.  Someone will look at your
> 'getter and the field' question asap.
>
> Meanwhile (as it is Sunday..), can I ask if you have tried patching
> the code per your suggested fix?  If so, can you let us know what
> happens.
>
> alexis
>
>
> On Sun, Mar 1, 2009 at 6:36 PM, Jon Palmer <jonspalmer at gmail.com> wrote:
> > I am new to using RabbitMQ and I couldn't find if this question has been
> > asked on the mailing list before.
> > I'm trying to use RabbitMQ.Net inside a Powershell script. Something like
> > this:
> >
> > [System.Reflection.Assembly]::LoadFile(  "C:\tools\RabbitMQ.Client.dll")
> > function GetAmqpChannel( $amqp_host ="127.0.0.1", $uid ="guest", $pwd
> > ="guest")
> > {
> > $factory = new-object RabbitMQ.Client.ConnectionFactory
> > $protocol = [RabbitMQ.Client.Protocols]::DefaultProtocol
> > return $factory.CreateConnection($protocol, $amqp_host).CreateModel()
> > }
> > GetAmqpChannel
> >
> >
> >
> > However I receive the following error:
> >
> > The field/property: "shutdownReport" for type:
> > "RabbitMQ.Client.Framing.Impl.v0_8.Connection" differs only in case from
> >  the field/property: "ShutdownReport". Failed to use non CLS compliant
> type.
> >
> > Looking at the source it seems that the problem is
> that RabbitMQ.Client.Impl
> > declares both
> >
> > public System.Collections.IList ShutdownReport { get; }
> >
> > public System.Collections.IList shutdownReport
> >
> > As a result the Client.Impl class isn't CLS compliant. This prevents me
> from
> > using RabbitMQ.Net inside powershell. Does anyone have suggestions about
> how
> > this can be fixed? Are both the getter and the field a required part of
> the
> > public API or could one be removed?
> >
> > Many thanks
> >
> > Jon
> >
> >
> > _______________________________________________
> > rabbitmq-discuss mailing list
> > rabbitmq-discuss at lists.rabbitmq.com
> > http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> >
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20090301/a1135c74/attachment.htm 


More information about the rabbitmq-discuss mailing list