Urgent.News

What's breaking now, across thousands of outlets.

Tech

Stop Letting Obfuscation Break Your Reflection Code: A Practical .NET Survival Guide

You've finished your .NET application, run it through an obfuscator, and everything looks great. Then production starts throwing exceptions: TypeLoadException MissingMethodException JsonSerializationException Nothing changed in your business logic. Unit tests passed before protection. Yet the obfuscated build suddenly behaves differently. If this sounds familiar, you're probably dealing with one…

Your .NET application runs smoothly after obfuscation, but suddenly production starts throwing exceptions. TypeLoadException, MissingMethodException, and JsonSerializationException occur even though your unit tests passed before protection. This is a common .NET protection pitfall: reflection-aware code colliding with aggressive symbol renaming.

Most obfuscators rename classes, methods, properties, and fields. For example, MyApp.DataProcessor might become a.a and ProcessData() might become b(). Standard .NET calls usually continue working because internal references are maintained. However, reflection depends on textual names at runtime, which can lead to failures when names change.

Many developers assume reflection is limited to specialized frameworks, but it powers modern .NET infrastructure like dynamic plugin loading, dependency injection, JSON serialization, and runtime factory patterns. Before obfuscating, audit your codebase for patterns that look for types, methods, properties, and assemblies. These identifiers may need to remain unchanged.

Everything else can be protected using control-flow transformations, string encryption, and anti-tamper features. If reflection risks are identified before obfuscation, the application will behave consistently. Testing the obfuscated binary, not the original assembly, is crucial.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

OpenTakeoff: measuring construction plans in the browser and over MCP

I'm developing OpenTakeoff. My background is commercial flooring estimating, so the part I focus on is evaluating on held out completed takeoffs.

  • OpenTakeoff measures construction plans in browser and MCP
  • Manual measurements via browser canvas with scale verification
  • Agent-assisted measurements with distinct verdict from human approval

RemoveMacAI: Turn off Apple Intelligence and free up disk space

Apple Intelligence sigue ocupando espacio en tu Mac incluso después de que apagues cada una de sus funciones desde Ajustes del Sistema.

  • RemoveMacAI disables Apple Intelligence features via command-line
  • Deletes downloaded models to free disk space
  • Reversible command restores original settings

ShelfLife-KIMS

This is a submission for the Hacktoberfest Weekend Challenge: Build for a Friend What I Built I built ShelfLife-KIMS, a smart kitchen management system that helps a household decide what to cook based…

  • ShelfLife-KIMS is a smart kitchen management system
  • Application uses React, TypeScript, FastAPI, and Python
  • AI component planned to utilize Gemma models

My browser video compressor choked on a 2.2 GB AVI. Here's why

I run SquishyFile, a video compressor that works entirely in the browser. Most files go through WebCodecs with Mediabunny.

  • SquishyFile choked on 2.2 GB AVI due to memory limit in Chromium
  • readFile() failed to read large files >2 GiB, causing NotReadableError
  • WORKERFS solution reads file slices on demand, bypassing memory limits

More from Monday 5 October →