<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Eric Kramer</title>
    <description>The latest articles on DEV Community by Eric Kramer (@eric_kramer).</description>
    <link>https://dev.to/eric_kramer</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4090358%2Fa1d1567f-38c8-4140-8cea-e4c7ed161762.jpg</url>
      <title>DEV Community: Eric Kramer</title>
      <link>https://dev.to/eric_kramer</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/eric_kramer"/>
    <language>en</language>
    <item>
      <title>Why I Switched to Opaquer for My WPF Project (And Never Looked Back)</title>
      <dc:creator>Eric Kramer</dc:creator>
      <pubDate>Sun, 23 Aug 2026 02:56:41 +0000</pubDate>
      <link>https://dev.to/eric_kramer/why-i-switched-to-opaquer-for-my-wpf-project-and-never-looked-back-1aee</link>
      <guid>https://dev.to/eric_kramer/why-i-switched-to-opaquer-for-my-wpf-project-and-never-looked-back-1aee</guid>
      <description>&lt;p&gt;As a developer who's been building .NET WPF applications for years, I've wrestled with the same problem everyone faces: &lt;strong&gt;how do you protect your intellectual property without breaking your UI?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;I recently finished a major WPF project targeting .NET 10, and the obfuscation journey taught me a lot. I wanted to share my experience with &lt;strong&gt;Opaquer&lt;/strong&gt; - the tool that finally solved my WPF obfuscation nightmares.&lt;/p&gt;

&lt;h2&gt;
  
  
  The WPF Obfuscation Nightmare
&lt;/h2&gt;

&lt;p&gt;If you've ever tried to obfuscate a WPF app with a "classical" obfuscator, you know the drill. You run the obfuscator, fire up your app, and... &lt;strong&gt;nothing works&lt;/strong&gt;. The window opens blank. Your bindings fail silently. Converters can't be resolved. Your app crashes on startup with a cryptic &lt;code&gt;XamlParseException&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;I spent days building exclusion lists, trying to protect my dependency properties, attached properties, and routed events from being renamed. It was a mess. My build process slowed down, and I was never 100% sure the UI would actually work after obfuscation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why WPF is Uniquely Hard to Obfuscate
&lt;/h2&gt;

&lt;p&gt;The problem is &lt;strong&gt;BAML&lt;/strong&gt;. When you compile a WPF app, your XAML isn't turned into normal IL. It's compiled into BAML (Binary Application Markup Language) and embedded inside your assembly's &lt;code&gt;.g.resources&lt;/code&gt; section.&lt;/p&gt;

&lt;p&gt;This BAML contains every symbol your UI references:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Type names (like your ViewModels and Converters)&lt;/li&gt;
&lt;li&gt;Property names used in bindings&lt;/li&gt;
&lt;li&gt;Converter names&lt;/li&gt;
&lt;li&gt;Attached properties (&lt;code&gt;Grid.Row&lt;/code&gt;, &lt;code&gt;DockPanel.Dock&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Routed event names (&lt;code&gt;Click&lt;/code&gt;, &lt;code&gt;Loaded&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;Resource keys&lt;/li&gt;
&lt;li&gt;Binding paths (&lt;code&gt;{Binding MyProperty}&lt;/code&gt;)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When a classical obfuscator renames &lt;code&gt;CustomerViewModel&lt;/code&gt; to &lt;code&gt;?_0&lt;/code&gt; in your IL, it &lt;strong&gt;must&lt;/strong&gt; also find every reference to that name inside the BAML and rewrite it. This is called "BAML rewriting," and it's incredibly difficult to get right.&lt;/p&gt;

&lt;p&gt;Most tools fail. They miss binding paths stored as runtime strings, fail to preserve dependency property registrations, and leave converter references dangling. The result is a broken UI.&lt;/p&gt;

&lt;h2&gt;
  
  
  Meeting Opaquer: A Different Approach
&lt;/h2&gt;

&lt;p&gt;Then I discovered &lt;strong&gt;Opaquer&lt;/strong&gt;. The key difference? &lt;strong&gt;Opaquer doesn't try to rename BAML symbols at all.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Instead, it uses a fundamentally different technique: &lt;strong&gt;it cryptographically encrypts the entire BAML resource.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Here's the workflow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Obfuscate the IL normally (renames, strings, control flow)&lt;/li&gt;
&lt;li&gt;Encrypt the entire &lt;code&gt;.g.resources&lt;/code&gt; BAML section&lt;/li&gt;
&lt;li&gt;BAML symbols are never renamed – so there's nothing to rewrite&lt;/li&gt;
&lt;li&gt;At runtime, Opaquer decrypts BAML in memory on demand&lt;/li&gt;
&lt;li&gt;The decrypted content is never written to disk&lt;/li&gt;
&lt;li&gt;ILSpy throws a &lt;code&gt;NotSupportedException&lt;/code&gt; when trying to read the resource&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is brilliant. &lt;strong&gt;All my bindings, converters, and events work exactly as before.&lt;/strong&gt; And ILSpy can't touch it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What ILSpy Sees Now
&lt;/h2&gt;

&lt;p&gt;When you open an Opaquer-protected WPF assembly in ILSpy and navigate to &lt;code&gt;yourapp.g.resources&lt;/code&gt;, this is what you see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;System.NotSupportedException:
Specified method is not supported.
    at ICSharpCode.BamlDecompiler.XamlDecompiler.Decompile()
    at ICSharpCode.ILSpy.BamlLanguage.DecompileResource()
    at ICSharpCode.ILSpy.TextView.DecompilerTextView.RunWithCancellation()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This error is intentional. The BAML stream is cryptographically encrypted. ILSpy's BAML reader can't parse it. Your WPF form structure, layouts, bindings, and control hierarchies are &lt;strong&gt;completely hidden&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Performance Impact? Minimal.
&lt;/h2&gt;

&lt;p&gt;I was worried about runtime performance. The in-memory BAML decryption adds a small, one-time overhead the first time each XAML view is loaded. On modern hardware, it's &lt;strong&gt;imperceptible&lt;/strong&gt;. Subsequent loads use the already-decrypted in-memory form. No disk I/O, no persistent plaintext files.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Free Basic Edition is Enough for Me
&lt;/h2&gt;

&lt;p&gt;Opaquer Basic is completely free forever, with no trial period. It includes all major obfuscation algorithms – name obfuscation (with Non-Displayable characters that prevent recompilation!), string encryption, lightweight control flow, WPF/BAML encryption, and digital watermarking.&lt;/p&gt;

&lt;p&gt;I'm a solo developer, so the "Single PC" limitation doesn't affect me. The only reason I'd upgrade to Pro ($189.99 lifetime) is for the Command-Line Interface, which I don't need right now since I obfuscate manually before each release.&lt;/p&gt;

&lt;h2&gt;
  
  
  No More Exclusion Lists
&lt;/h2&gt;

&lt;p&gt;With classical obfuscators, I spent &lt;strong&gt;hours&lt;/strong&gt; building and maintaining exclusion lists for dependency properties, attached properties, converters, and binding paths. Opaquer eliminates this entirely.&lt;/p&gt;

&lt;p&gt;Because it encrypts the BAML resource rather than renaming its contents, there's no risk of breaking any binding, converter, or event reference. &lt;strong&gt;It just works.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Bottom Line
&lt;/h2&gt;

&lt;p&gt;Opaquer is the best obfuscator for modern WPF applications, period. It's the only tool I've found that cryptographically encrypts the entire BAML resource instead of trying to rename-and-rewrite XAML symbols. This eliminates the root cause of every WPF obfuscation failure.&lt;/p&gt;

&lt;p&gt;My app is protected. My UI works perfectly. And I have peace of mind knowing that decompilers can't recover my XAML structure, bindings, or event handlers.&lt;/p&gt;

&lt;p&gt;If you're building a WPF app and you care about protecting your IP, do yourself a favor: &lt;strong&gt;download Opaquer Basic and test it on your project.&lt;/strong&gt; Your future self will thank you.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
