Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
AhmedElbaik opened this issue Nov 1, 2024 · 1 comment · Fixed by #316
Closed
Labels
bug Something isn't working

Comments

@AhmedElbaik
Copy link

AhmedElbaik commented Nov 1, 2024

Reqnroll Version

2.1.1

Which test runner are you using?

xUnit

Test Runner Version Number

2.9.2

.NET Implementation

.NET 8.0

Test Execution Method

Visual Studio Test Explorer

Content of reqnroll.json configuration file

{
"$schema": "https://schemas.reqnroll.net/reqnroll-config-latest.json",
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning"
}
},
"specflow": {
"bindingCulture": {
"language": "en-us"
},
"language": {
"feature": "en-us"
},
"stepAssemblies": [
{ "assembly": "CostbookUITestsBDD/StepDefinitions" }
],
"unitTestProvider": {
"name": "xUnit"
}
}
}

Issue Description

I'm facing the below error. When I updated the Reqnroll packages to 2.1.1, When I returned back to 2.0.0, I had a successful build to my project, I checked #244 and JoshKeegan/xRetry#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"

Also, kindly check my conversation with @JoshKeegan on the issue JoshKeegan/xRetry#252.

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

Steps to Reproduce

add "xRetry.Reqnroll" Version="1.0.0" with the below packages:
"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"
System.CodeDom" Version="8.0.0"

Then you get the mentioned error when you try to build your project.

Link to Repro Project

No response

@AhmedElbaik AhmedElbaik added the bug Something isn't working label Nov 1, 2024
gasparnagy added a commit that referenced this issue Nov 6, 2024
…gin (#316)

* Fix: Could not load System.CodeDom exception with xRetry.Reqnroll plugin (#310)

* update CHANGELOG.md

* improve infra to load binding files from resource

* use test files from resource

* Fix Linux CI
@gasparnagy
Copy link
Contributor

It is going to be included in v2.2.0 that is hopefully released tomorrow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants