mkaring / ConfuserEx

An open-source, free protector for .NET applications
https://mkaring.github.io/ConfuserEx/
MIT License
2.31k stars 353 forks source link

Application crashed due to `Failed to rename all targeted members, because the references are blocking each other` #379

Closed KvanTTT closed 2 years ago

KvanTTT commented 3 years ago

Confuser displays the error during confusing (by yellow color):

Failed to rename all targeted members, because the references are blocking each other

But application crashes with a similar exception (these definitions match definitions from the abovementioned warning message):

System.TypeInitializationException: The type initializer for '_TxP0AsG8nfNdg13bierh6qBfDmUA' threw an exception. ---> System.TypeLoadException: Method '_5eWIIuvnOFv3kKlDFd5OIn0ZamC' in type '_RQbl3JXbfV9R9u8bfHFRVVZD5Kd' from assembly 'Test, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.

This probably happens due to renaming protection with renPublic = true and related to cases when the method in base type implements an interface method for the derived type. shortNames option does not help.

I'll try to extract a minimal code sample later (it's quite complicated because of the big project and intertwined structure).

Is it possible to fix it (it worked in previous versions)? Or similar entities should be excluded from renaming?

KvanTTT commented 3 years ago

Unfortunately, I was not able to find a minimal sample that covers this issue. But I found out how to fix it, please check the related pull request.

KvanTTT commented 3 years ago

It seems like I've found such a sample (see in the attached pull request)!

github-actions[bot] commented 2 years ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.