This is a pretty massive project (and protected) so I can't share the content, but I'm encountering a compilation error, only in my release configuration:
EXEC : error : Error occurred during processing of input file 'NAME.dll' --> Stage 'Phase 1': Error at 'NAME.il':1589 --> Encountered a cyclic dependency in chain of forwarders for type 'System.Type, netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'.
When I compile in release mode, the assembly is obfuscated using Gapotchenko Eazfuscator (version 2021.4.430), and I believe this error is occurring during the obfuscation phase since the follow up to the previous error is:
NAME.dll : error : Obfuscation failed
Done building project "NAME.csproj" -- FAILED.
I've searched high and low for related issues, and all I keep finding are circular references in code. When I search through my code, I'm not finding any, and the error is pointing to System.Type
in .NET Standard, which is either very generic, or very unhelpful, but likely both. I checked all of my assemblies and none of them seem to reference this directly.
Non-Custom Dependencies
The following dependencies are installed via NuGet or referenced directly as a DLL:
- Assemblies
- System.Windows.Forms
- Frameworks
- Microsoft.AspNetCore.App
- Microsoft.NETCore.App
- Packages
- Gapotchenko.Eazfuscator.NET (202.4.430)
- Newtonsoft.Json (13.0.1)
- Swashbuckle.AspNetCore (5.6.3)
- System.Configuration.Configurationmanager (5.0.0)
- System.Data.SqlClient (4.8.2)
- System.ServiceProcess.ServiceController (5.0.0)
Custom Dependencies
There are three additional projects referenced directly by the one that isn't compiling (they compile just fine); let's call them A, B, and C. These projects all run on .NET Framework (target 4.7.2). They all have their own rather large lists of dependencies I can search through, with guidance based on the dependency list for the project that is failing to compile.
Additionally, there are infinitely many (albeit, currently just one) assemblies running on .NET Framework (target 4.7.2) loaded at runtime, though I'm not sure what this would have to do with compile-time, I'm including it, just in case it's important to know that dependency injection is involved at runtime.
For clarity, my debug configuration compiles and runs just fine while my release configuration does not. Additionally, my target framework is .NET 5.0.
How can I locate the cyclic dependency here and eliminate it?