extent-framework / extentreports-csharp

Extent Reporting Library, .NET
http://extentreports.com
Apache License 2.0
50 stars 40 forks source link

v4.1.0: IO.FileLoadException When Attempt to Run SpecFow Tests #99

Open dcdraper opened 4 years ago

dcdraper commented 4 years ago

After updating the nuget package from 4.0.3 to 4.1.0, I get the following eror when attempting to run tests. I have cleaned the bin directories and nuget cache and that does not help...

Message: System.IO.FileLoadException : Could not load file or assembly 'System.Collections.Immutable, Version=1.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) TearDown : System.IO.FileLoadException : Could not load file or assembly 'System.Collections.Immutable, Version=1.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Stack Trace: RoslynCompilerServiceBase.CompileType(TypeContext context) RazorEngineCore.CreateTemplateType(ITemplateSource razorTemplate, Type modelType) RazorEngineCore.Compile(ITemplateKey key, Type modelType) RazorEngineService.CompileAndCacheInternal(ITemplateKey key, Type modelType) RazorEngineService.GetCompiledTemplate(ITemplateKey key, Type modelType, Boolean compileOnCacheMiss) RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) DynamicWrapperService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) <>cDisplayClass16_0.b0(TextWriter writer) RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag) ExtentHtmlReporter.Flush(ReportAggregates reportAggregates) <>cDisplayClass59_0.b0(IExtentReporter x) List1.ForEach(Action1 action) ReportObservable.NotifyReporters() ReportObservable.Flush() ExtentReports.Flush() ReporterFactory.CreateTestStepNode(Status status, String stepType, String name, String description, String details, String screenshotPath) line 123 ReporterFactory.LogTestResult(TestResult result, String stepType, String name, String description, String details, Driver driver) line 185 Hooks_Reporting.AfterStepInsertStepResults() line 65 lambda_method(Closure , IContextManager ) BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) TestExecutionEngine.InvokeHook(IBindingInvoker invoker, IHookBinding hookBinding, HookType hookType) TestExecutionEngine.FireEvents(HookType hookType) TestExecutionEngine.FireScenarioEvents(HookType bindingEvent) TestExecutionEngine.OnStepEnd() TestExecutionEngine.ExecuteStep(IContextManager contextManager, StepInstance stepInstance) TestExecutionEngine.Step(StepDefinitionKeyword stepDefinitionKeyword, String keyword, String text, String multilineTextArg, Table tableArg) TestRunner.Given(String text, String multilineTextArg, Table tableArg, String keyword) NAV_PublicStorageFeature.FeatureBackground() line 4 NAV_PublicStorageFeature.PublicStorage_NAV_03_RentASpace_ContactInformationScreenNavigation() line 3 --TearDown RoslynCompilerServiceBase.CompileType(TypeContext context) RazorEngineCore.CreateTemplateType(ITemplateSource razorTemplate, Type modelType) RazorEngineCore.Compile(ITemplateKey key, Type modelType) RazorEngineService.CompileAndCacheInternal(ITemplateKey key, Type modelType) RazorEngineService.GetCompiledTemplate(ITemplateKey key, Type modelType, Boolean compileOnCacheMiss) RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) DynamicWrapperService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) <>cDisplayClass16_0.b0(TextWriter writer) RazorEngineServiceExtensions.WithWriter(Action`1 withWriter) RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag) ExtentHtmlReporter.Flush(ReportAggregates reportAggregates) <>cDisplayClass59_0.b0(IExtentReporter x) List1.ForEach(Action1 action) ReportObservable.NotifyReporters() ReportObservable.Flush() ExtentReports.Flush() ReporterFactory.CreateTestStepNode(Status status, String stepType, String name, String description, String details, String screenshotPath) line 123 ReporterFactory.LogTestResult(TestResult result, String stepType, String name, String description, String details, Driver driver) line 185 Hooks_Reporting.AfterScenarioLogEndOfTestStep() line 43 lambda_method(Closure , IContextManager ) BindingInvoker.InvokeBinding(IBinding binding, IContextManager contextManager, Object[] arguments, ITestTracer testTracer, TimeSpan& duration) TestExecutionEngine.InvokeHook(IBindingInvoker invoker, IHookBinding hookBinding, HookType hookType) TestExecutionEngine.FireEvents(HookType hookType) TestExecutionEngine.FireScenarioEvents(HookType bindingEvent) TestExecutionEngine.OnScenarioEnd() TestRunner.OnScenarioEnd() NAV_PublicStorageFeature.TestTearDown()

Overclock303 commented 3 years ago

My System.IO.FileNotFoundException on 4.1.0 was just a missing filename .html in SPA (V3 like) reporter mode, filename was not mandatory in 4.0.3 (not SPA) forced to index.hml and the 2 others. so, carefull now.

dcdraper commented 3 years ago

@Overclock303 I do not understand what you are saying. I did not use v3 and do not use any html files in my project. How do I specify these filenames? Do I have to include html files in the project now? If you could please provide more detail I would appreciate it.

Overclock303 commented 3 years ago

reporter = new ExtentV3HtmlReporter(path); // is V3 with filename in path reporter = new ExtentHtmlReporter(path, ViewStyle.SPA); // is V4.1.0 with html structure like V3 (SPA), with filename in path

When i call the flush() method to generate the html file in 4.1.0, i got System.IO.FileNotFoundException if i miss the filename in the path from V4 ExtentHtmlReporter and ViewStyle.SPA. In 4.0.3, was not mandatory to define a filename, it is auto.

But may be you discover other failure. the new dependencies gave me some troubles.

dcdraper commented 3 years ago

Please help. I still cannot resolve this with the latest updates

Mishell133 commented 3 years ago

Try to downgrade to 4.0.3. On 4.0.3 it works fine

dcdraper commented 3 years ago

@Mishell133 - Yes I have remained on 4.0.3 since it works there. I probably should have mentioned that. I am just hoping that this can get addressed so I start updating it again.

Robin-Wils commented 2 years ago

Same issue here. I wonder if anyone is looking into this.