<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/avalonia-tool-that-finds-bugs-my-compiler-can-t-see-dpo5lhvjw" -->

---
title: Avalonia Tool That Finds Bugs My Compiler Can't See
description: I just built a Roslyn analyzer that catches Avalonia bugs my actual compiler misses — runtime crashes and previewer failures that silently slip through a...
canonical: https://daily.dev/posts/avalonia-tool-that-finds-bugs-my-compiler-can-t-see-dpo5lhvjw
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Avalonia Tool That Finds Bugs My Compiler Can't See | daily.dev
og:description: I just built a Roslyn analyzer that catches Avalonia bugs my actual compiler misses — runtime crashes and previewer failures that silently slip through a...
og:url: https://daily.dev/posts/avalonia-tool-that-finds-bugs-my-compiler-can-t-see-dpo5lhvjw
og:image: https://api.daily.dev/og/posts/DpO5LHVjW.png
og:image:alt: Avalonia Tool That Finds Bugs My Compiler Can't See
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Avalonia Tool That Finds Bugs My Compiler Can't See

**[AngelSix](https://daily.dev/sources/angelsix)** · 12 min read · 0 upvotes · 0 comments

## Summary

I just built a Roslyn analyzer that catches Avalonia bugs my actual compiler misses — runtime crashes and previewer failures that silently slip through a "successful" build. This episode is the deep dive: fixing the worst style inheritance bugs in the theme library, unveiling that tool, and laying the groundwork for a token-based accent system that could kill 90% of my theme code duplication.

WHAT YOU'LL LEARN:
→ Why style inheritance is genuinely the hardest problem in Avalonia theming right now
→ How I finally fixed the "mangled" ButtonSpinner control (hover effects, full-height stretch, the works)
→ What "God XAML" actually is — a live Rosalyn Analyzer that spins up a temporary Avalonia project in the background to catch errors the standard compiler lets through
→ The token-based accent system I'm proposing next: one `accent` style + a secondary class (`primary`, `secondary`, `warning`...) instead of duplicating 30+ lines per color
→ Why this all matters: flip one accent color and every control in the app should update correctly, with zero exceptions

──────────────

⏱ TIMESTAMPS
0:00 – Style inheritance is mind-boggling (and the bane of Avalonia)
0:55 – Button spinners finally get proper hover effects
1:58 – Why style inheritance is genuinely broken right now
3:30 – The ButtonSpinner fix nobody wants to touch
5:20 – Introducing "God XAML" — catching bugs the compiler misses
6:08 – How the analyzer actually works under the hood
8:19 – The accent color duplication problem (300+ lines per control)
9:06 – Proposing a token-based accent system
11:09 – Stress-testing the new theme engine on ButtonSpinner
12:14 – Swap one accent color, everything updates correctly

──────────────

🔗 LINKS
GitHub: https://github.com/angelsix
Website: https://www.angelsix.com

──────────────

This is part of the ongoing Avalonia Themes series where I'm building out a proper theme engine from scratch — real problems, real fixes, zero shortcuts.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=WQB5kFJWRmc>

---

Tags: [#c](https://daily.dev/tags/c), [#.net](https://daily.dev/tags/.net), [#avalonia](https://daily.dev/tags/avalonia)

[View this post on daily.dev](https://daily.dev/posts/avalonia-tool-that-finds-bugs-my-compiler-can-t-see-dpo5lhvjw)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Avalonia Tool That Finds Bugs My Compiler Can't See","url":"https://daily.dev/posts/avalonia-tool-that-finds-bugs-my-compiler-can-t-see-dpo5lhvjw","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/avalonia-tool-that-finds-bugs-my-compiler-can-t-see-dpo5lhvjw"},"datePublished":"2026-10-04T13:04:28.113Z","dateModified":"2026-10-04T21:47:24.879Z","description":"I just built a Roslyn analyzer that catches Avalonia bugs my actual compiler misses — runtime crashes and previewer failures that silently slip through a...","image":"https://i.ytimg.com/vi/WQB5kFJWRmc/sddefault.jpg","thumbnailUrl":"https://i.ytimg.com/vi/WQB5kFJWRmc/sddefault.jpg","isAccessibleForFree":true,"articleSection":"AngelSix","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"AngelSix","logo":"https://media.daily.dev/image/upload/s--h1ikmN_u--/f_auto,q_auto/v1791119063/logos/angelsix?_a=BAMAMicg0","url":"https://daily.dev/sources/angelsix"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/avalonia-tool-that-finds-bugs-my-compiler-can-t-see-dpo5lhvjw","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"c,.net,avalonia","timeRequired":"PT12M","video":{"@type":"VideoObject","name":"Avalonia Tool That Finds Bugs My Compiler Can't See","description":"I just built a Roslyn analyzer that catches Avalonia bugs my actual compiler misses — runtime crashes and previewer failures that silently slip through a...","thumbnailUrl":"https://i.ytimg.com/vi/WQB5kFJWRmc/sddefault.jpg","uploadDate":"2026-10-04T13:04:28.113Z","duration":"PT12M","url":"https://api.daily.dev/r/DpO5LHVjW","embedUrl":"https://www.youtube.com/embed/WQB5kFJWRmc"}}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"AngelSix","item":"https://daily.dev/sources/angelsix"},{"@type":"ListItem","position":3,"name":"Avalonia Tool That Finds Bugs My Compiler Can't See"}]}
```

