Unhandled Exception: System.Reflection.ReflectionTypeLoadException
Hey!
I was trying to perform compilation of .NET tools via Codecepticon (command: --action obfuscate --module csharp --verbose --path "path-to-file.sln" --map-file "path-to-folder\Obfuscated\Map.html" --precompile --build --build-path "path-to-folder\Obfuscated" --rename ncefpavs --rename-method markov --markov-min-length 3 --markov-max-length 9 --markov-min-words 3 --markov-max-words 4 --string-rewrite --string-rewrite-method single) through GitHub CI CD pipelining, I am seeing this error:
[08:11:16] Codecepticon v1.2.3 is starting...
[08:11:16] Training Markov Generator...
[08:11:20] Getting Visual Studio Instance
[08:11:20] Creating MSBuild Workspace
Unhandled Exception: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.RuntimeAssembly.get_DefinedTypes()
at System.Composition.Hosting.ContainerConfiguration.<>c.<WithAssemblies>b__16_0(Assembly a)
at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
at System.Composition.TypedParts.TypedPartExportDescriptorProvider..ctor(IEnumerable`1 types, AttributedModelProvider attributeContext)
at System.Composition.Hosting.ContainerConfiguration.CreateContainer()
at Microsoft.CodeAnalysis.Host.Mef.MefHostServices.Create(IEnumerable`1 assemblies)
at Microsoft.CodeAnalysis.Host.Mef.MSBuildMefHostServices.get_DefaultServices()
at Codecepticon.Modules.CSharp.VisualStudioManager.GetWorkspace(Dictionary`2 properties)
at Codecepticon.Modules.CSharp.CSharpManager.<Obfuscate>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Codecepticon.Modules.CSharp.CSharpManager.<Run>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Codecepticon.Program.<Main>d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Codecepticon.Program.<Main>(String[] args)
Write-Error: ❌ CodeCepticon compilation failed!
Error: Process completed with exit code 1.
Do you have any suggestions on why I am seeing this? I am not getting this error while doing the same locally from cmd/powershell. I am facing this only when I am using GitHub CI CD.
Thanks, waiting eagerly for your reply.