diff --git a/src/Pickles/Pickles.UserInterface/MainWindowViewModel.cs b/src/Pickles/Pickles.UserInterface/MainWindowViewModel.cs index c37456d50..69a030461 100644 --- a/src/Pickles/Pickles.UserInterface/MainWindowViewModel.cs +++ b/src/Pickles/Pickles.UserInterface/MainWindowViewModel.cs @@ -505,25 +505,25 @@ private void DoGenerate() private void DoWork() { - var builder = new ContainerBuilder(); - builder.RegisterAssemblyTypes(typeof(Runner).Assembly); - builder.Register(_ => new FileSystem()).As().SingleInstance(); - builder.RegisterModule(); - var container = builder.Build(); - - var configuration = container.Resolve(); - var fileSystem = container.Resolve(); - - configuration.FeatureFolder = fileSystem.DirectoryInfo.FromDirectoryName(this.featureFolder); - configuration.OutputFolder = fileSystem.DirectoryInfo.FromDirectoryName(this.outputFolder); - configuration.SystemUnderTestName = this.projectName; - configuration.SystemUnderTestVersion = this.projectVersion; - configuration.TestResultsFile = this.IncludeTests ? fileSystem.FileInfo.FromFileName(this.testResultsFile) : null; - configuration.TestResultsFormat = this.testResultsFormats.Selected; - configuration.Language = this.selectedLanguage != null ? this.selectedLanguage.TwoLetterISOLanguageName : CultureInfo.CurrentUICulture.TwoLetterISOLanguageName; - foreach (DocumentationFormat documentationFormat in this.documentationFormats.Selected) { + var builder = new ContainerBuilder(); + builder.RegisterAssemblyTypes(typeof(Runner).Assembly); + builder.Register(_ => new FileSystem()).As().SingleInstance(); + builder.RegisterModule(); + var container = builder.Build(); + + var configuration = container.Resolve(); + var fileSystem = container.Resolve(); + + configuration.FeatureFolder = fileSystem.DirectoryInfo.FromDirectoryName(this.featureFolder); + configuration.OutputFolder = fileSystem.DirectoryInfo.FromDirectoryName(this.outputFolder); + configuration.SystemUnderTestName = this.projectName; + configuration.SystemUnderTestVersion = this.projectVersion; + configuration.TestResultsFile = this.IncludeTests ? fileSystem.FileInfo.FromFileName(this.testResultsFile) : null; + configuration.TestResultsFormat = this.testResultsFormats.Selected; + configuration.Language = this.selectedLanguage != null ? this.selectedLanguage.TwoLetterISOLanguageName : CultureInfo.CurrentUICulture.TwoLetterISOLanguageName; + configuration.DocumentationFormat = documentationFormat; var runner = container.Resolve(); runner.Run(container);