Obfuscated Uno WASM app not working with reflection-based dependency injection (Autofac and TinyIoC) #12057
-
This is a continuation of my issue #11985, where @darenm helped me move past the issue of an obfuscated WASM app not showing anything except the Uno logo after loading. (The temporary fix was to disable the linker by adding the WasmShellILLinkerEnabled = false tag to my WASM csproj file, as recommended in the Using the IL Linker article, while the more permanent fix will be to selectively disable the linker on only certain namespaces/types) To rehash a little from #11985: I am trying to obfuscate the WASM version of a proof of concept app that I wrote. I am using Dotfuscator 6.4 to do the obfuscation on the .clr after publishing the WASM app. I am running the app on Firefox (64-bit, v108.0.2) and on Ubuntu Desktop 20.04. The app loads and runs fine unobfuscated. However, when I obfuscate it, I get resolution errors from the IoC container. (I have configured my project to use either Autofac or TinyIoC, both of which throw resolution errors, albeit different ones.) Resolution error when using Autofac: Resolution error when using TinyIoC: It seems that Uno WASM still has an issue with reflection-based IoC frameworks. (Not sure if this extends to other reflection-based operations... I will have to research that.) For reference, here is my Dotfuscator.config, in case it helps at all:
To note:
Any ideas are appreciated on why this is happening and how to fix it so that I can run an obfuscated Uno WASM app with a DI framework. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
It's likely that TinyIoC is not handling some of the renaming of its attributes or types very well. You may be able to look at the code from TinyIOC to determine which attributes or types need to be excluded from obfuscation for the whole resolution to work. In general, troubleshooting obfuscators issues is done the same way as troubleshooting linker issues, where excluding classes or namespaces progressively can help determine the source of the issue. |
Beta Was this translation helpful? Give feedback.
It's likely that TinyIoC is not handling some of the renaming of its attributes or types very well. You may be able to look at the code from TinyIOC to determine which attributes or types need to be excluded from obfuscation for the whole resolution to work.
In general, troubleshooting obfuscators issues is done the same way as troubleshooting linker issues, where excluding classes or namespaces progressively can help determine the source of the issue.