
There are several ways of fixing this problem and it usually involves editing your machine.config, web.config or app.config file. One of the possibilities that might have raised this error is a bug that you’ll encounter when uninstalling Microsoft Azure SDK. Apparently when you install the Microsoft Azure SDK, it adds a few lines to your machine.config file. However when you uninstall it, it doesn’t revert the changes causing your machine.config to refer to unavailable libraries.
So in order to fix this error, you’ll have to comment/delete these few lines from your machine.config file.
[sourcecode language="xml"]
<!– Under <behaviorExtensions> –>
<add name="connectionStatusBehavior" type="Microsoft.ServiceBus.Configuration.ConnectionStatusElement, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="transportClientEndpointBehavior" type="Microsoft.ServiceBus.Configuration.TransportClientEndpointBehaviorElement, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="serviceRegistrySettings" type="Microsoft.ServiceBus.Configuration.ServiceRegistrySettingsElement, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
[/sourcecode]
[sourcecode language="xml"]
<!– Under <bindingElementExtensions> –>
<add name="tcpRelayTransport" type="Microsoft.ServiceBus.Configuration.TcpRelayTransportElement, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="httpRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpRelayTransportElement, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="httpsRelayTransport" type="Microsoft.ServiceBus.Configuration.HttpsRelayTransportElement, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="onewayRelayTransport" type="Microsoft.ServiceBus.Configuration.RelayedOnewayTransportElement, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
[/sourcecode]
[sourcecode language="xml"]
<!– Under <bindingExtensions> –>
<add name="basicHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.BasicHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="webHttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WebHttpRelayBindingCollectionElement, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="ws2007HttpRelayBinding" type="Microsoft.ServiceBus.Configuration.WS2007HttpRelayBindingCollectionElement, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netTcpRelayBinding" type="Microsoft.ServiceBus.Configuration.NetTcpRelayBindingCollectionElement, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netOnewayRelayBinding" type="Microsoft.ServiceBus.Configuration.NetOnewayRelayBindingCollectionElement, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add name="netEventRelayBinding" type="Microsoft.ServiceBus.Configuration.NetEventRelayBindingCollectionElement, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
[/sourcecode]
[sourcecode language="xml"]
<!– Under <client> –>
<endpoint address="" binding="netTcpRelayBinding" contract="IMetadataExchange"
name="sb" />
<!– Under <metadata><policyImporters> –>
<extension type="Microsoft.ServiceBus.Description.TcpRelayTransportBindingElementImporter, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension type="Microsoft.ServiceBus.Description.HttpRelayTransportBindingElementImporter, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension type="Microsoft.ServiceBus.Description.OnewayRelayTransportBindingElementImporter, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<!– Under <metadata><wsdlImporters> –>
<extension type="Microsoft.ServiceBus.Description.StandardRelayBindingImporter, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension type="Microsoft.ServiceBus.Description.TcpRelayTransportBindingElementImporter, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension type="Microsoft.ServiceBus.Description.HttpRelayTransportBindingElementImporter, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<extension type="Microsoft.ServiceBus.Description.OnewayRelayTransportBindingElementImporter, Microsoft.ServiceBus, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
[/sourcecode]
Thank You!!
Thank You!!
Thank You!!
Thank You!!! Saved lot of my debugging time with precise steps.
Thank you. This saved me a lot of time.
hi,
i have verified the machine configs. I do not have these entries in there. Still it does not work for me.
Nice. Make sure to modify the machine.config @ C:WindowsMicrosoft.NETFrameworkv4.0.30319Config
When you want a WCF Service consumer web role to run from cloud, you need to take some more steps. The consumer connects to your on-premise WCF service using netTcpRelayBinding. These steps are not required if you want to run the consumer on local dev server.
I tried the method explained on MSDN at http://msdn.microsoft.com/en-us/library/microsoft.servicebus.configuration.relayconfigurationinstaller.aspx, which explains that the tool named RelayConfigurationInstaller.exe needs to be run on VM as a startup task (on local machine, this tool is available in service bus SDK installation folder C:Program FilesWindows Azure AppFabric SDKV1.0AssembliesNET4.0). So I added the startup task to the role project config and re-deployed the package. Later, the consumer role came up and running and it also consumed on-premise WCF service running on my machine by connecting to service bus using net tcp relay binding. I also added to the role project the tool RelayConfigurationInstaller.exe and RelayConfigurationInstaller.exe.config so that these were available on the Azure VM.
Startup task:
When you want a WCF Service consumer web role to run from cloud, you need to take some more steps. The consumer connects to your on-premise WCF service using netTcpRelayBinding. These steps are not required if you want to run the consumer on local dev server.
I tried the method explained on MSDN at http://msdn.microsoft.com/en-us/library/microsoft.servicebus.configuration.relayconfigurationinstaller.aspx, which explains that the tool named RelayConfigurationInstaller.exe needs to be run on VM as a startup task (on local machine, this tool is available in service bus SDK installation folder C:Program FilesWindows Azure AppFabric SDKV1.0AssembliesNET4.0). So I added the startup task to the role project config and re-deployed the package. Later, the consumer role came up and running and it also consumed on-premise WCF service running on my machine by connecting to service bus using net tcp relay binding. I also added to the role project the tool RelayConfigurationInstaller.exe and RelayConfigurationInstaller.exe.config so that these were available on the Azure VM.
Startup task:
When you want a WCF Service consumer web role to run from cloud, you need to take some more steps. The consumer connects to your on-premise WCF service using netTcpRelayBinding. These steps are not required if you want to run the consumer on local dev server.
I tried the method explained on MSDN at http://msdn.microsoft.com/en-us/library/microsoft.servicebus.configuration.relayconfigurationinstaller.aspx, which explains that the tool named RelayConfigurationInstaller.exe needs to be run on VM as a startup task (on local machine, this tool is available in service bus SDK installation folder C:Program FilesWindows Azure AppFabric SDKV1.0AssembliesNET4.0). So I added the startup task to the role project config and re-deployed the package. Later, the consumer role came up and running and it also consumed on-premise WCF service running on my machine by connecting to service bus using net tcp relay binding. I also added to the role project the tool RelayConfigurationInstaller.exe and RelayConfigurationInstaller.exe.config so that these were available on the Azure VM.
Startup task:
Thank you. I just removed Azure from my machine and did changes suggested by you and everything is working smoothly.
Regards,
Ojas
http://ojasmaru.blogspot.in/
That did it … have found a LOT of references to this problem and this is the only one that fixed it. Good job!
You have saved us a day, thank you
[...] to the correct machine.config files. The configuration content that must be added is outlined at http://justinlee.sg/2011/04/27/how-to-fix-this-error-configuration-binding-extension-system-servicem…. Ensure all of the content is added to the .NET 4.0 machine.config files (32 and 64-bit) with the [...]