JoshKeegan / xRetry

Retry running tests via Xunit and Specflow
MIT License
53 stars 14 forks source link

Could not load file or assembly 'System.CodeDom, Version=4.0.0.0, Culture=neutral #252

Open AhmedElbaik opened 3 days ago

AhmedElbaik commented 3 days ago

Severity Code Description Project File Line Suppression State Error (active) MSB4018 The "GenerateFeatureFileCodeBehindTask" task failed unexpectedly. System.IO.FileNotFoundException: Could not load file or assembly 'System.CodeDom, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified. File name: 'System.CodeDom, Version=4.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' at xRetry.Reqnroll.GeneratorPlugin.customiseDependencies(Object sender, CustomizeDependenciesEventArgs eventArgs) at Reqnroll.Generator.GeneratorContainerBuilder.CreateContainer(ReqnrollConfigurationHolder configurationHolder, ProjectSettings projectSettings, IEnumerable1 generatorPluginInfos, IObjectContainer parentObjectContainer) at Reqnroll.Tools.MsBuild.Generation.WrappedGeneratorContainerBuilder.BuildGeneratorContainer(ReqnrollConfigurationHolder reqnrollConfigurationHolder, ProjectSettings projectSettings, IReadOnlyCollection1 generatorPluginInfos, IObjectContainer rootObjectContainer) at Reqnroll.Tools.MsBuild.Generation.GenerateFeatureFileCodeBehindTaskExecutor.Execute() at Reqnroll.Tools.MsBuild.Generation.GenerateFeatureFileCodeBehindTask.Execute() at Microsoft.Build.BackEnd.TaskExecutionHost.Execute() at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()

WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure logging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. CostbookUITestsBDD C:\Users\elbaika.nuget\packages\reqnroll.tools.msbuild.generation\2.1.1\build\Reqnroll.Tools.MsBuild.Generation.targets 93

I'm facing the above error. I checked https://github.com/reqnroll/Reqnroll/issues/244 and #245, which should fix the problem. as you can see below the versions of the packages I have:- "Reqnroll" Version="2.1.1" "Reqnroll.CustomPlugin" Version="2.1.1" "Reqnroll.Autofac" Version="2.1.1" "Reqnroll.SpecFlowCompatibility" Version="2.1.1" "Reqnroll.Tools.MsBuild.Generation" Version="2.1.1" "Reqnroll.xUnit" Version="2.1.1" "xRetry.Reqnroll" Version="1.0.0" System.CodeDom" Version="8.0.0"

I would appreciate your help with how to fix this issue.

JoshKeegan commented 2 days ago

Hi, does it work if you downgrade all of the Reqnroll packages to 2.0.0?

AhmedElbaik commented 2 days ago

It seems to be working now. One note I have is that adding the "@retry" above feature won't retry the scenarios in this feature file. about this issue, is it something will be fixed in xRetry.Reqnroll Release or should I mention the issue in Reqnroll Repo so they fix it in upcoming releases?

JoshKeegan commented 1 day ago

Do you mean it works after downgrading Reqnroll to 2.0.0? If so, it's likely an issue with Reqnroll, so it'd be worth raising in their repo. I thought they'd fixed this error in https://github.com/reqnroll/Reqnroll/pull/245 though 🤔

Since you're saying that adding @retry isn't working, something still seems wrong though. Are you able to share your project, or a minimal project to reproduce the issue?

AhmedElbaik commented 8 hours ago

unfortunately, I'm not able to share my project. Yes, it worked after downgrading to 2.0.0 when adding @retry above the scenario. However, it was not working when adding it above the Feature, but now it seems to be working there, too! in conclusion Reqnroll 2.0.0 and xRetry.Reqnroll 1.0.0 are working fine together. Thanks for the advice I will raise this issue again in Reqnroll repo issues.