How to Enable Live Unit Testing in Visual Studio 2022 for C# Projects?

Posted by JaneDoe on Sep 12, 2025 • 15 comments

I'm trying to use Live Unit Testing in Visual Studio 2022 for a C# class library, but the option seems greyed out. I've verified that I have the Enterprise edition installed and that the project builds successfully. Are there any settings I need to adjust, or is this a known issue with certain project types?

visual-studio c# live-unit-testing

Responses

MikeSmith
Sep 12, 2025 at 09:45 AM

Live Unit Testing only works with .NET Core and .NET Standard projects. If you're targeting .NET Framework, the feature will be disabled. Consider migrating your library to .NET Standard or .NET 6+.

LauraK
Sep 12, 2025 at 10:12 AM

Make sure you have the Microsoft.NET.Test.Sdk package installed in your test project. Without it, Visual Studio can't discover the tests for live execution.

JaneDoe
Sep 12, 2025 at 11:03 AM

Thanks, both! I changed the target framework to .NET 6 and added the test SDK, and Live Unit Testing is now available.

Leave a Comment