You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jg...@apache.org on 2011/10/17 20:35:30 UTC
svn commit: r1185321 - in /activemq/activemq-dotnet/Apache.NMS/trunk: ./
src/main/csharp/NMSConnectionFactory.cs
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