extent-framework / extentreports-csharp

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

Could not load type 'Microsoft.AspNetCore.Razor.Language.RazorTemplateEngine' #141

Open stephenjg24-git opened 3 years ago

stephenjg24-git commented 3 years ago

Hello,

I have a C# solution that is .Net 4.8.

When I have Extent Report 4.0.3 it builds and executes and crates the reports without issue.

If I update to 4.1.0 I get the error: Could not load type 'Microsoft.AspNetCore.Razor.Language.RazorTemplateEngine'

This error is when I call Report.Flush()

I have update all nugets except for "RazorEngine.NetCore" I haev this on version 2.2.6. Since this is not a CORE but it is .net4.8 I can not update to 3.1.0

Is there any fixes for this? 2021-09-10_14-07-26

nahush-hombali commented 2 years ago

I am seeing the same issue and have the exact same setup. Any fixes/workarounds would be helpful.

Peadge commented 2 years ago

I have the same issue, had to downgrade.

SleeplessDeveloper commented 10 months ago

two whole years and still no solution...

anshooarora commented 10 months ago

Hello @SleeplessDeveloper - can you check with the latest 5.0.1? https://www.nuget.org/packages/ExtentReports

SleeplessDeveloper commented 10 months ago

@anshooarora I did... and i had to downgrade from 5.0.1 to 4.1.0 be able to resolve my issues.

untoldstory69 commented 10 months ago

@anshooarora I am using the latest version of the extent report. I am getting the same exception in extent.flush();

I tried to downgrade to 4.1.0 but still having an issue.

is there any resolution for this issue? System.TypeLoadException HResult=0x80131522 Message=Could not load type 'Microsoft.AspNetCore.Razor.Language.RazorTemplateEngine' from assembly 'Microsoft.AspNetCore.Razor.Language, Version=6.0.24.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'. Source=RazorEngine.NetCore StackTrace: at RazorEngine.Compilation.CompilerServiceBase.GetGeneratorResult(IEnumerable1 namespaces, TypeContext context) at RazorEngine.Compilation.CompilerServiceBase.GetCodeCompileUnit(TypeContext context) at RazorEngine.Roslyn.CSharp.RoslynCompilerServiceBase.CompileType(TypeContext context) at RazorEngine.Templating.RazorEngineCore.CreateTemplateType(ITemplateSource razorTemplate, Type modelType) at RazorEngine.Templating.RazorEngineCore.Compile(ITemplateKey key, Type modelType) at RazorEngine.Templating.RazorEngineService.CompileAndCacheInternal(ITemplateKey key, Type modelType) at RazorEngine.Templating.RazorEngineService.GetCompiledTemplate(ITemplateKey key, Type modelType, Boolean compileOnCacheMiss) at RazorEngine.Templating.RazorEngineService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.DynamicWrapperService.RunCompile(ITemplateKey key, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, TextWriter writer, Type modelType, Object model, DynamicViewBag viewBag) at RazorEngine.Templating.RazorEngineServiceExtensions.<>c__DisplayClass16_0.b__0(TextWriter writer) at RazorEngine.Templating.RazorEngineServiceExtensions.WithWriter(Action1 withWriter) at RazorEngine.Templating.RazorEngineServiceExtensions.RunCompile(IRazorEngineService service, String name, Type modelType, Object model, DynamicViewBag viewBag) at AventStack.ExtentReports.Reporter.ExtentSparkReporter.OnNext(ReportEntity value) at System.Reactive.Subjects.Subject1.OnNext(T value) at AventStack.ExtentReports.Core.ReactiveSubject.Flush() at AventStack.ExtentReports.Core.AbstractProcessor.OnFlush() at AventStack.ExtentReports.ExtentReports.Flush() at Microsoft.Dynamics365.UIAutomation.Sample.Test_POC.Tests.AssemblyCleanup() in C:\Users\kishor.sharma\Source\Repos\Ki\EasyReproD365\Microsoft.Dynamics365.UIAutomation.Sample\Test_POC\UnitTest1.cs:line 110 ` Thanks

SleeplessDeveloper commented 10 months ago

@untoldstory69 what other packages are installed in your project's dependencies?

untoldstory69 commented 10 months ago

@untoldstory69 what other packages are installed in your project's dependencies?

@SleeplessDeveloper I've used extentreport 3.1.0 and now it is working. Thanks for the reply.

SleeplessDeveloper commented 10 months ago

@untoldstory69 try upgrade extent reports to Version"4.1.0". And let me know if it solves your issue.

untoldstory69 commented 10 months ago

@SleeplessDeveloper I tried using 4.1.0 but I was having issue. But it is working fine with 3.1.0.

cl-oalami commented 4 months ago

This issue is still current, with 5.0.0, 5.0.1 and 5.0.2.

Same setup as stephenjg24-git (OP), can only be resolved by switching to 3.1.0, is there any fix in any upcoming version ?