activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgo...@apache.org
Subject svn commit: r684955 - /activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/NMSConnectionFactory.cs
Date Mon, 11 Aug 2008 22:03:47 GMT
Author: jgomes
Date: Mon Aug 11 15:03:47 2008
New Revision: 684955

URL: http://svn.apache.org/viewvc?rev=684955&view=rev
Log:
When loading provider implementation configuration files and assemblies, prepend the currenty
executing assembly's folder path to load them from the assembly's directory rather than whatever
happens to be the current directory.

Modified:
    activemq/activemq-dotnet/Apache.NMS/trunk/src/main/csharp/NMSConnectionFactory.cs

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=684955&r1=684954&r2=684955&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
Aug 11 15:03:47 2008
@@ -102,8 +102,13 @@
 			Type factoryType = null;
 
 			if(LookupConnectionFactoryInfo(scheme, out assemblyFileName, out factoryClassName))
-			{
-				Assembly assembly = Assembly.LoadFrom(assemblyFileName);
+			{
+#if NETCF
+				string assemblyFolder = "";
+#else
+				string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+#endif
+				Assembly assembly = Assembly.LoadFrom(Path.Combine(assemblyFolder, assemblyFileName));
 
 				if(null != assembly)
 				{
@@ -141,7 +146,12 @@
 		/// <returns></returns>
 		private static bool LookupConnectionFactoryInfo(string scheme, out string assemblyFileName,
out string factoryClassName)
 		{
-			string configFileName = String.Format("nmsprovider-{0}.config", scheme.ToLower());
+#if NETCF
+			string assemblyFolder = "";
+#else
+			string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
+#endif
+			string configFileName = Path.Combine(assemblyFolder, String.Format("nmsprovider-{0}.config",
scheme.ToLower()));
 			bool foundFactory = false;
 
 			assemblyFileName = String.Empty;



Mime
View raw message