https://issues.apache.org/activemq/browse/AMQNET-281

Fix error in CreateSession URI parsing
diff --git a/src/main/csharp/Connection.cs b/src/main/csharp/Connection.cs
index 75aa5ed..00840bc 100755
--- a/src/main/csharp/Connection.cs
+++ b/src/main/csharp/Connection.cs
@@ -359,9 +359,15 @@
             Session session = new Session(this, info, sessionAcknowledgementMode, this.dispatchAsync);
 
             // Set properties on session using parameters prefixed with "session."
-            StringDictionary options = URISupport.ParseQuery(this.brokerUri.Query);
-            options = URISupport.GetProperties(options, "session.");
-            URISupport.SetProperties(session, options);
+            if(!String.IsNullOrEmpty(brokerUri.Query) && !brokerUri.OriginalString.EndsWith(")"))
+            {
+                // Since the Uri class will return the end of a Query string found in a Composite
+                // URI we must ensure that we trim that off before we proceed.
+                string query = brokerUri.Query.Substring(brokerUri.Query.LastIndexOf(")") + 1);
+                StringDictionary options = URISupport.ParseQuery(query);
+                options = URISupport.GetProperties(options, "session.");
+                URISupport.SetProperties(session, options);
+            }
 
             session.ConsumerTransformer = this.ConsumerTransformer;
             session.ProducerTransformer = this.ProducerTransformer;