From 88e26358a1430c82c0ad2afe9ab509540119cfb4 Mon Sep 17 00:00:00 2001 From: Gaspar Nagy Date: Thu, 29 Apr 2010 15:02:26 +0200 Subject: [PATCH] change external step binding assembly configuration to use the assembly name instead of the file --- Runtime/Configuration/ConfigurationSectionHandler.cs | 10 +++++----- Runtime/Configuration/RuntimeConfiguration.cs | 7 ++++--- Tests/FeatureTests/App.config | 4 ++-- Tests/FeatureTests/FeatureTests.csproj | 8 ++++++++ 4 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Runtime/Configuration/ConfigurationSectionHandler.cs b/Runtime/Configuration/ConfigurationSectionHandler.cs index df29bd064..aa1892fea 100644 --- a/Runtime/Configuration/ConfigurationSectionHandler.cs +++ b/Runtime/Configuration/ConfigurationSectionHandler.cs @@ -268,17 +268,17 @@ protected override ConfigurationElement CreateNewElement() protected override object GetElementKey(ConfigurationElement element) { - return ((StepAssemblyConfigElement)element).File; + return ((StepAssemblyConfigElement)element).Assembly; } } public class StepAssemblyConfigElement : ConfigurationElement { - [ConfigurationProperty("file", DefaultValue = null, IsRequired = false)] - public string File + [ConfigurationProperty("assembly", DefaultValue = null, IsRequired = false)] + public string Assembly { - get { return (string)this["file"]; } - set { this["file"] = value; } + get { return (string)this["assembly"]; } + set { this["assembly"] = value; } } } } diff --git a/Runtime/Configuration/RuntimeConfiguration.cs b/Runtime/Configuration/RuntimeConfiguration.cs index 650d51dd6..271499a3d 100644 --- a/Runtime/Configuration/RuntimeConfiguration.cs +++ b/Runtime/Configuration/RuntimeConfiguration.cs @@ -118,9 +118,10 @@ public static RuntimeConfiguration LoadFromConfigFile(ConfigurationSectionHandle foreach (var element in configSection.StepAssemblies) { - string stepAssemblyFileName = ((StepAssemblyConfigElement)element).File; - string fullPath = Path.GetFullPath(stepAssemblyFileName); - Assembly stepAssembly = Assembly.LoadFile(fullPath); +// string stepAssemblyFileName = ((StepAssemblyConfigElement)element).File; +// string fullPath = Path.GetFullPath(stepAssemblyFileName); +// Assembly stepAssembly = Assembly.LoadFile(fullPath); + Assembly stepAssembly = Assembly.Load(((StepAssemblyConfigElement)element).Assembly); config._additionalStepAssemblies.Add(stepAssembly); } diff --git a/Tests/FeatureTests/App.config b/Tests/FeatureTests/App.config index fe47acad7..6c026b5ed 100644 --- a/Tests/FeatureTests/App.config +++ b/Tests/FeatureTests/App.config @@ -22,8 +22,8 @@ /> - - + + diff --git a/Tests/FeatureTests/FeatureTests.csproj b/Tests/FeatureTests/FeatureTests.csproj index 39a1fd65c..f61a0fda2 100644 --- a/Tests/FeatureTests/FeatureTests.csproj +++ b/Tests/FeatureTests/FeatureTests.csproj @@ -92,6 +92,14 @@ TechTalk.SpecFlow True + + {3836A6FC-4ECC-413A-AC8F-83A0A773EC9E} + ExternalStepsCS + + + {D3F6B835-B228-4DCF-B533-B6ED469A33B3} + ExternalStepsVB +