<span class="Apple-style-span" style="font-size: small;">I am new to using RabbitMQ and I couldn't find if this question has been asked on the mailing list before. </span><div><span class="Apple-style-span" style="font-size: small;"><br>
</span></div><div><span class="Apple-style-span" style="font-size: small;">I'm trying to use RabbitMQ.Net inside a Powershell script. Something like this:<br><br></span><div><span class="Apple-style-span" style="font-size: small;">[System.Reflection.Assembly]::LoadFile( "C:\tools\RabbitMQ.Client.dll")</span></div>
<div><span class="Apple-style-span" style="font-size: small;"><br></span></div><div><span class="Apple-style-span" style="font-size: small;">function GetAmqpChannel( $amqp_host ="127.0.0.1", $uid ="guest", $pwd ="guest")</span></div>
<div><span class="Apple-style-span" style="font-size: small;">{</span></div><div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-size: small;">        </span></span><span class="Apple-style-span" style="font-size: small;">$factory = new-object RabbitMQ.Client.ConnectionFactory</span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-size: small;">        </span></span><span class="Apple-style-span" style="font-size: small;">$protocol = [RabbitMQ.Client.Protocols]::DefaultProtocol</span></div>
<div><span class="Apple-tab-span" style="white-space:pre"><span class="Apple-style-span" style="font-size: small;">        </span></span><span class="Apple-style-span" style="font-size: small;">return $factory.CreateConnection($protocol, $amqp_host).CreateModel()</span></div>
<div><span class="Apple-style-span" style="font-size: small;">}</span></div><div><span class="Apple-style-span" style="font-size: small;"><br></span></div><div><span class="Apple-style-span" style="font-size: small;">GetAmqpChannel<br>
</span></div><div><span class="Apple-style-span" style="font-size: small;"><br></span></div><div><span class="Apple-style-span" style="font-size: small;"><br></span></div><div><span class="Apple-style-span" style="font-size: small;"><br>
</span></div><div><span class="Apple-style-span" style="font-size: small;">However I receive the following error:</span></div><div><span class="Apple-style-span" style="font-size: small;"><br></span></div><div><span class="Apple-style-span" style="font-size: small;"><br>
</span></div><div><div><span class="Apple-style-span" style="font-size: small;">The field/property: "shutdownReport" for type: "RabbitMQ.Client.Framing.Impl.v0_8.Connection" differs only in case from</span></div>
<div><span class="Apple-style-span" style="font-size: small;"> the field/property: "ShutdownReport". Failed to use non CLS compliant type.</span></div><div><span class="Apple-style-span" style="font-size: small;"><br>
</span></div><div><span class="Apple-style-span" style="font-size: small;"><br></span></div><div><span class="Apple-style-span" style="font-size: small;">Looking at the source it seems that the problem is that </span><span class="Apple-style-span" style="font-family: Calibri; "><span class="Apple-style-span" style="font-size: small;">RabbitMQ.Client.Impl declares both</span></span></div>
</div><div><p class="MsoNormal"><span style="font-family: Tahoma, sans-serif; color: black; "><span class="Apple-style-span" style="font-size: small;">public </span></span><u><span style="font-family: Tahoma, sans-serif; color: rgb(33, 93, 198); "><span class="Apple-style-span" style="font-size: small;">System.Collections.IList</span></span></u><span style="font-family: Tahoma, sans-serif; color: black; "><span class="Apple-style-span" style="font-size: small;"> ShutdownReport {
get; }</span><span class="Apple-style-span" style="font-size: small;"></span></span></p><p class="MsoNormal"><span class="Apple-style-span" style="font-family: Tahoma; font-size: 12px;"></span></p><p class="MsoNormal"><span style="font-family: Tahoma, sans-serif; color: black; "><span class="Apple-style-span" style="font-size: small;">public </span></span><u><span style="font-family: Tahoma, sans-serif; color: rgb(33, 93, 198); "><span class="Apple-style-span" style="font-size: small;">System.Collections.IList</span></span></u><span style="font-family: Tahoma, sans-serif; color: black; "><span class="Apple-style-span" style="font-size: small;"> shutdownReport</span><span class="Apple-style-span" style="font-size: small;"></span></span></p>
<p class="MsoNormal"><span class="Apple-style-span" style="font-size: small;"><br></span></p><p class="MsoNormal"><span class="Apple-style-span" style="font-size: small;">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?</span></p>
<p class="MsoNormal"><span class="Apple-style-span" style="font-size: 13px;"><br></span></p><p class="MsoNormal"><span class="Apple-style-span" style="font-size: 13px;">Many thanks</span></p><p class="MsoNormal"><span class="Apple-style-span" style="font-size: 13px;">Jon</span></p>
<p class="MsoNormal"><br></p><p class="MsoNormal"><span class="Apple-style-span" style="font-weight: bold;"><br></span></p><p></p></div></div>