How to set multiple startup projects in Visual Studio

Since VS2019, you can set multiple startup projects in the solution’s properties. This is useful when you have multiple projects in the same solution that you want to start at the same time (with or without debugging). Before this, you’d have to set a project as the startup project, start it, then repeat with all … Read more

C# – How to treat warnings like errors

Warnings are easy to ignore and forget about, which isn’t good. They point out potential problems that you might want to fix. To make it easier to pay attention to warnings, you can treat them like errors. You can choose which warnings to treat like errors by using settings in the project file. There are … Read more

Visual Studio – How to make the Implement Interface quick action generate auto properties

When you use the Implement Interface quick action in Visual Studio, it generates all members that throw exceptions, even the property getters and setters: This is fine for methods, but not for properties. You’d expect it to generate auto properties. Instead, it generates getters/setters that you then have to go clean up. Fortunately, this behavior … Read more

Visual Studio – How to use conditional breakpoints

Breakpoints cause execution to pause when you’re running the debugger. This is referred to as breaking, and it allows you to look at the current state of things for debugging purposes. In some cases, you may want to use a conditional breakpoint to only break execution when certain conditions are met (ex: break when name … Read more

Visual Studio project templates without minimal API and top-level statement

Devs want the option to create new projects in Visual Studio without all of the minimalist stuff that was recently added (top-level statement, minimal API). At the very least, these features should be optional instead of being the default without a way to opt-out (to be fair, minimal API is optional). What I typically do … Read more

Microsoft.TextTemplating.targets was not imported due to the file not existing

Problem You have a project that is using text templating and you’re upgrading to a new version of Visual Studio. When you open the project, you get error messages about not being able to import the Microsoft.TextTemplating.targets project: Project “…\v16.0\TextTemplating\Microsoft.TextTemplating.targets” was not imported by “…SomeProject.csproj” at (7,3), due to the file not existing. The error … Read more