Skip to content
This repository has been archived by the owner on Jan 27, 2019. It is now read-only.

"COMException: Record not found on lookup" when using obfuscated .NET Standard assembly #661

Open
mahalex opened this issue May 15, 2018 · 0 comments

Comments

@mahalex
Copy link

mahalex commented May 15, 2018

I'm using ConfuserEx to obfuscate a .NET Standard 2.0 assembly. The assembly has a class with a static array initializer. Using obfuscated assembly fails with System.TypeInitializationException in the static constructor that is generated by ConfuserEx (in order to initialize the static array field). Inner Exception says "COMException: Record not found on lookup. (Exception from HRESULT: 0x80131130)". This happens even when my ConfuserEx project does not contain any rules:

<project outputDir="." baseDir="." xmlns="http://confuser.codeplex.com">
    <rule preset="none" pattern="true" />
    <module path="TestLibrary.dll" />
</project>

Changing TargetFramework for this library from netstandard2.0 to net471 makes the problem disappear.

I understand that ConfuserEx is no longer maintained. Is there a way to turn off the protection rule that generates this static constructor for array initialization? What should I put in my project file?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant