Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
dTub
Скачать

C# Source Generators – Why and How

Автор: Microsoft Visual Studio

Загружено: 2025-12-16

Просмотров: 5679

Описание:

In this recorded Live! 360 session, you’ll learn how C# source generators work, why they matter, and how they can dramatically improve app performance by eliminating runtime reflection, reducing allocations, and enabling ahead-of-time (AOT) execution. Jim Wooley walks through real examples, from logging and regex optimization to JSON serialization, and shows how incremental generators improve build performance and keep generated code in sync as you type.

You’ll also explore how to write your own source generator using Roslyn APIs, understand syntax trees and semantic models, and validate generators with unit tests. If you're building .NET apps and want to automate boilerplate, remove reflection, or tune your app for speed, this session gives you the foundations to get started.

🔑 What You’ll Learn
• What source generators are and how they fit into meta-programming
• How generators eliminate reflection and support AOT compilation
• Real examples: logging, regex, JSON, validation, mappers
• How incremental generators improve performance over older models
• How to explore Roslyn syntax trees & semantic models
• How to write your own generator using attributes & visitors
• Unit testing and debugging approaches for source generators
• Performance impacts and comparisons (AutoMapper, Mapster, mocking libs)

⏱️ Chapters
00:00 Intro + What source generators are & why they exist
02:54 Eliminating reflection and enabling AOT
05:44 How source generators differ from GenAI
08:05 Examples in .NET: logging, regex, JSON, validation
11:58 Demo: Logging generator & partial methods
14:46 Demo: Regex generator & performance benefits
16:14 Demo: JSON serialization generator
17:40 Live change-tracking: how generators respond to edits
19:20 Using attributes to trigger generation
20:00 Intro to Roslyn syntax trees & code analysis
26:05 Navigating syntax with the Syntax Visualizer
29:32 Understanding attributes & metadata via Roslyn APIs
31:00 Demo: Building a simple CSV generator
35:55 Classic (non-incremental) generator architecture
38:30 Walking the syntax tree & extracting semantic info
41:52 Generating new code with StringBuilder
43:10 Incremental generators & why they matter
45:30 Transformations, caching, and performance optimization
47:25 Using records and value semantics in generator pipelines
49:00 Executing generation & adding output to the compilation
50:55 Demo: Extended CSV generator with new properties
54:00 How to test generators with xUnit & Verify snapshots
58:30 Debugging generators (best practices & pitfalls)
1:01:00 How Roslyn builds trees, tokens, trivia & factories
1:01:49 When meta-programming makes sense (mapping, DTOs, reflection removal)
1:03:00 Performance comparisons (AutoMapper, Mapster, mocking frameworks)
1:06:20 Licensing, open source considerations & practical guidance
1:08:48 Q&A + extending the sample generator
1:10:03 Additional resources & where to go next

👤 Speaker: Jim Wooley
Senior Principal, Slalom Consulting

🔗 Links
• Jim's Roslyn Labs repo: https://github.com/jwooley/RoslynLabs
• Explore more Live! 360 sessions: https://aka.ms/L360Orlando25
• Check out upcoming VS Live! events: https://aka.ms/VSLiveEvents

#csharp #dotnet #visualstudio #roslyn

C# Source Generators – Why and How

Поделиться в:

Доступные форматы для скачивания:

Скачать видео mp4

  • Информация по загрузке:

Скачать аудио mp3

Похожие видео

Что нового в C# 14

Что нового в C# 14

Good Bye Electron, Hello Rust + Tauri! - Andreas Lillebø Holm - NDC TechTown 2025

Good Bye Electron, Hello Rust + Tauri! - Andreas Lillebø Holm - NDC TechTown 2025

Next-Level Debugging with GitHub Copilot in Visual Studio

Next-Level Debugging with GitHub Copilot in Visual Studio

Aspire – Beyond the Basics

Aspire – Beyond the Basics

"Hybrid Web and Desktop apps with .NET MAUI and Blazor" By Rachel Kang

Deep .NET: Writing async/await from scratch in C# with Stephen Toub and Scott Hanselman

Deep .NET: Writing async/await from scratch in C# with Stephen Toub and Scott Hanselman

Чистая архитектура с ASP.NET Core 10

Чистая архитектура с ASP.NET Core 10

Нет, монорепозитории НЕ проще

Нет, монорепозитории НЕ проще

Visual Studio Toolbox Live - Visual Studio 2026 December Release Party

Visual Studio Toolbox Live - Visual Studio 2026 December Release Party

Building the PERFECT Linux PC with Linus Torvalds

Building the PERFECT Linux PC with Linus Torvalds

10 Things I Do On Every .NET App - Scott Sauber - NDC Oslo 2025

10 Things I Do On Every .NET App - Scott Sauber - NDC Oslo 2025

The Forgotten Features of Visual Studio You NEED In Your Life!

The Forgotten Features of Visual Studio You NEED In Your Life!

Property Patterns Will Change How You Write C# Code

Property Patterns Will Change How You Write C# Code

Correcting Common Async/Await Mistakes in .NET 9 - Brandon Minnick - NDC Melbourne 2025

Correcting Common Async/Await Mistakes in .NET 9 - Brandon Minnick - NDC Melbourne 2025

Почему большинство разработчиков программного обеспечения застревают на месте (я наблюдаю это уже...

Почему большинство разработчиков программного обеспечения застревают на месте (я наблюдаю это уже...

Забудь VS Code — Вот Почему Все Переходят на Cursor AI

Забудь VS Code — Вот Почему Все Переходят на Cursor AI

On .NET Live: Lessons Learned Building Source Generators

On .NET Live: Lessons Learned Building Source Generators

НОВОСТИ ИИ: Nvidia покупает Groq, Опенсорс Nano Banana, GLM и Minimax Обходят Claude 4,5

НОВОСТИ ИИ: Nvidia покупает Groq, Опенсорс Nano Banana, GLM и Minimax Обходят Claude 4,5

Улучшения производительности в .NET 10

Улучшения производительности в .NET 10

AI, DevOps, and Kubernetes: Kelsey Hightower on What’s Next

AI, DevOps, and Kubernetes: Kelsey Hightower on What’s Next

© 2025 dtub. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]