From commits-return-17168-apmail-activemq-commits-archive=activemq.apache.org@activemq.apache.org Mon Oct 17 18:35:52 2011 Return-Path: X-Original-To: apmail-activemq-commits-archive@www.apache.org Delivered-To: apmail-activemq-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 3B34F9C69 for ; Mon, 17 Oct 2011 18:35:52 +0000 (UTC) Received: (qmail 81768 invoked by uid 500); 17 Oct 2011 18:35:52 -0000 Delivered-To: apmail-activemq-commits-archive@activemq.apache.org Received: (qmail 81716 invoked by uid 500); 17 Oct 2011 18:35:52 -0000 Mailing-List: contact commits-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@activemq.apache.org Delivered-To: mailing list commits@activemq.apache.org Received: (qmail 81709 invoked by uid 99); 17 Oct 2011 18:35:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Oct 2011 18:35:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Oct 2011 18:35:51 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 077602388900 for ; Mon, 17 Oct 2011 18:35:31 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1185321 - in /activemq/activemq-dotnet/Apache.NMS/trunk: ./ src/main/csharp/NMSConnectionFactory.cs Date: Mon, 17 Oct 2011 18:35:30 -0000 To: commits@activemq.apache.org From: jgomes@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111017183531.077602388900@eris.apache.org> Author: jgomes Date: Mon Oct 17 18:35:30 2011 New Revision: 1185321 URL: http://svn.apache.org/viewvc?rev=1185321&view=rev Log: Merged revision(s) 1185320 from activemq/activemq-dotnet/Apache.NMS/branches/1.5.x: Add exception handling around directory name parsing. Fixes [AMQNET-337]. (See https://issues.apache.org/jira/browse/AMQNET-337) Modified: activemq/activemq-dotnet/Apache.NMS/trunk/ (props changed) activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/NMSConnectionFactory.cs Propchange: activemq/activemq-dotnet/Apache.NMS/trunk/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Mon Oct 17 18:35:30 2011 @@ -1 +1 @@ -/activemq/activemq-dotnet/Apache.NMS/branches/1.5.x:1143990 +/activemq/activemq-dotnet/Apache.NMS/branches/1.5.x:1143990,1185320 Modified: activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/NMSConnectionFactory.cs URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/NMSConnectionFactory.cs?rev=1185321&r1=1185320&r2=1185321&view=diff ============================================================================== --- activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/NMSConnectionFactory.cs (original) +++ activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/NMSConnectionFactory.cs Mon Oct 17 18:35:30 2011 @@ -314,18 +314,34 @@ namespace Apache.NMS // Check the current folder first. pathList.Add(""); #if !NETCF - AppDomain currentDomain = AppDomain.CurrentDomain; - - // Check the folder the assembly is located in. - pathList.Add(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); - if(null != currentDomain.BaseDirectory) + try { - pathList.Add(currentDomain.BaseDirectory); - } + AppDomain currentDomain = AppDomain.CurrentDomain; - if(null != currentDomain.RelativeSearchPath) + // Check the folder the assembly is located in. + Assembly executingAssembly = Assembly.GetExecutingAssembly(); + try + { + pathList.Add(Path.GetDirectoryName(executingAssembly.Location)); + } + catch(Exception ex) + { + Tracer.DebugFormat("Error parsing executing assembly location: {0} : {1}", executingAssembly.Location, ex.Message); + } + + if(null != currentDomain.BaseDirectory) + { + pathList.Add(currentDomain.BaseDirectory); + } + + if(null != currentDomain.RelativeSearchPath) + { + pathList.Add(currentDomain.RelativeSearchPath); + } + } + catch(Exception ex) { - pathList.Add(currentDomain.RelativeSearchPath); + Tracer.DebugFormat("Error configuring search paths: {0}", ex.Message); } #endif