I am using Visual Studio 2019 enterprise to work on a .NET project. I wasn't noticing it before, but it seems like every time I am saving a file, the solution is building. I am inferring this because when I save, I can see a number with a red X next to it in the bottom pane. And if i click on the bottom pane, it will open up a console showing me build errors. This changes every time I save.
This is an annoying "feature". I searched for multiple solutions, but none of them work. The "code analysis" option for a solution is deprecated, so you can't change it. I don't have any abnormal extensions either, so this looks like a VS feature.
There is a menu named BuildOnSave in the Visual Studio menu bar with options to disable BuildOnSave, build the whole solution in its active configuration, or the startup project only. The options are stored per solution. An output "pane" is registered for BuildOnSave and activates as soon a build starts.
On the menu bar, choose Tools > Options. In the Options dialog box, expand the Projects and Solutions node, and then choose the Build and Run page. The Build and Run > Projects and Solutions > Options dialog box opens. Select the Only build startup projects and dependencies on Run check box.
On the menu bar, choose Debug > Start ( F5 ). On the menu bar, choose Build > Build Solution ( Ctrl + Shift + B ). When this check box is cleared, all projects, their dependencies, and the solution files are built when you run either of the preceding commands. By default, this check box is cleared.
To open this page, right-click the project node in Solution Explorer and select Properties. Select the Code Analysis tab. To disable source analysis at build time, uncheck the Run on build option. To disable live source analysis, uncheck the Run on live analysis option.
Another one but very similar cause of the automatic rebuild and restart is Auto build and refresh browser after saving changes
option under the Tools -> Options -> Projects and Solutions -> ASP .NET Core
settings.
Just set it to None
or any other option than Auto build and refresh browser after saving changes
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With