SPRNET-1264

Introduced fallback case to use the AppDomain's .BaseDirectory property instead of the .DyanmicDirectory property as the location for the generated assembly should the .DynamicDirectory property be NULL
This commit is contained in:
sbohlen
2010-09-29 15:21:32 +00:00
parent a4ff2a29c9
commit 0cb6a781b6

View File

@@ -281,7 +281,8 @@ namespace Spring.EnterpriseServices
{
string ext = (ActivationMode == ActivationOption.Library) ? ".dll" : ".exe";
string moduleName = assemblyName + ext;
string assemblyFileName = AppDomain.CurrentDomain.DynamicDirectory.Trim('\\', '/') + "\\" + moduleName;
string basePath = !StringUtils.IsNullOrEmpty(AppDomain.CurrentDomain.DynamicDirectory) ? AppDomain.CurrentDomain.DynamicDirectory : AppDomain.CurrentDomain.BaseDirectory;
string assemblyFileName = String.Format("{0}\\{1}", basePath.Trim('\\', '/'), moduleName);
FileInfo assemblyFile = new FileInfo(assemblyFileName);
GenerateComponentAssembly(assemblyFile);