You don’t need to manually create a unit test project (through the UI or through the command line). Instead, you can can use the Create Unit Tests command in Visual Studio to generate a unit test project, add it to the solution, and wire up a test stub all at once. Note: This approach can … Read more
In a WinForms project, you can prompt the user to select a file by using the OpenFileDialog control: When you call ShowDialog(), it’ll prompt the user to select a file: When the user clicks Open, you’ll be able to get the file path they selected from the OpenFileDialog.FileName property. To use the OpenFileDialog control, drag … Read more
When you create a new project in Visual Studio the default directory is C:\Users\<userName>\Source\Repos. This article shows you how to change that. Steps Open Visual Studio. Click Tools > Options… Change the Projects location. Results Now when you create a project it’ll default to this location.
You need to auto-increment your build numbers in order to easily tell which code you’re working with. In this article I’ll explain how to auto-increment your build numbers in Visual Studio. I’ll be using text templating to generate the Assembly Version. Update (2021-3-27): I added information about how to handle this .NET Core projects. 1 … Read more
Problem You’re trying to debug a program with Visual Studio but Attach to Process does not work. Most likely you’re loading your code through some third-party process (like Excel), and when you try to use Attach to Process it simply doesn’t work. Solution Instead of trying to use Attach to Process, you can launch a … Read more
Problem You’re trying to use the ReportViewer control in Visual Studio but it’s not in the toolbox. Other symptoms: After manually adding the ReportViewer control to the toolbox clicking Design a new report does nothing. The RDLC report designer does not open and opening the RDLC file just opens the report markup. Solution Note: Tested … Read more