Visual Studio debugger starts Solution build - visual-studio

I've designed a Visual Studio 2022 solution that contains 6 projects. One produces an executable (.exe) and the others produce dlls that are consumed by the executable. I've noticed that when I try to debug the executable, Visual Studio starts a build for the solution every time I debug. I'm at a loss as to why it builds the solution when nothing has changed in any project. I'm assuming that something in a project is causing the build to occur, but, I don't know what that may be.
Any ideas on how to troubleshoot this?
Update: This solution is built for.Net5. I found this setting in the options under SDK-Style projects that does not appear to work.

Go Tools->Options->Projects and Solutions->Build And Run, set MSBuild output to Detailed, build the project, check the output log.
You can also try resetting all settings.

The post, "Visual Studio not auto-building when I press the debug button" solved my problem. I set the following to force Visual Studio to NOT build each time I started the debugger.

Related

Visual studio does not update bin folder

I have a problem with visual studio 2022. I am creating a WPF app in vs 2022 version 17.2.4 using .NET 7 Preview. When I build the solution or press Start Debugging or Start Without Debugging, Visual studio won't update the compiled code(Won't replace binary files with the latest ones) and the behavior of the program won't change to correspond to the code. The problem does not persist when I press Build->Clean Solution and then Build->Build Solution. It does the same whether I build the solution with the debug or release configuration. I tried it with other solutions as well and the problem will not go away. So I know how to deal with this, but it seems weird and annoying nonetheless. It's the first time that I encounter something like this.
P.S.(Yes the solution compiles with no errors or warnings)

Visual Studio doesn't run programs

I downloaded visual studio for C# and now my problem is that when I run a program the very first time it runs without issues but the second time after exiting the program it shows this (pressing f5 also does nothing):
I have tried repairing Visual Studio and uninstalling and reinstalling it but that also doesn't work. It happens to other files too like Python files or asp.net files. Anyone know what's going on?
Try setting your project as a StartUp Project.
See this answer for details.

Visual Studio 2012 not debugging current solution

My Visual Studio 2012 Professional doesn't debug as it should.
It looks like VS is debugging old versions of my projects.
I tried debugging several projects but the same problem occurs with all of them, even when I start a new project (both console applications and windows forms applications).
It doesn't even hit the breakpoints I place right at the start of the program.
Things i've tried:
• cleaning and rebuilding my solution
• DEBUG -> options and settings -> Projects and Solutions -> Build and Run. Here I unchecked "Only build startup projects and dependencies on Run" and selected "Always build " from the "On Run, when projects are out of date" list
• deleting the .suo file (since the problem not project related I didn't expect it to be the solution but it was worth a shot).
As far as I know I didn't make any other changes to any property and I didn't perform any updates just before this issue started.
The following link descibes a similar issue but it doesn't contain a solution that works for me.
http://social.msdn.microsoft.com/Forums/vstudio/en-US/23e70e79-970d-423f-b434-12681b88ef2c/visual-studio-2012-debug-runs-old-code?forum=vsdebug
Superman also had a similar problem but again no suitable solution but in my case cleaning and rebuilding doesn't temporarily solve the problem.
Visual Studio 2012 Debugging Old Code
any ideas on how to solve this?
Have you tried a repair/reinstall of Visual Studio from the control panel ?
Also it could be related to a windows User profile issues. Assuming you are using Windows 7 you can try re-creating the profile using this post. http://www.techstaty.com/how-to-rebuild-a-windows-7-user-profile-the-correct-way/

Visual studio - build selection not available

In Microsoft Visual Studio 2010 the option to build a single file, via the command "Build Selection" has suddenly become unavailable. I can however still build and as far as I know I did not change any solution/project properties.
What can I do to make this option available again?
If you open a file and do not [add it to a project] then apparently MSVS doesn't know how to build it. Simply adding it to my project fixed this problem.

Strange! VS 2005 -Break Point is not being hit

I am using Visual Studio 2005.I am running my code in Debug mode only.But my break point is
not being hit.
I followed :
Cleared my solution and created the one again
Closed the VS and Opened it again
Restarted my PC and tested the break point
But i am unable to figure out the problem.
My Question is:
Is it due to any virus ?
Add-on feature in my IE 8.0 prevents this
My VS is Corrupted ?
I am having botn VS 2008 and VS 2005 installed in my machine so any version
conflicts?
Suggestion is needed.
It sounds like the problem you are having may be due to the source code and the .pdb files being out of sync with each other.
Try these steps:
Perform a "Clean" build in Visual Studio.
Shut down Visual Studio.
Delete any "bin" and "obj" folders in all of your project folders.
Delete the solution .suo file
Sometimes the solution .suo file can become corrupt (doesn't cause Visual Studio to indicate any errors, but usually leads to strange behavior). Nine out of ten times, deleting the .suo file clears any strange behavior in Visual Studio.
The trick about deleting the "obj" folders forces Visual Studio to truely do a clean build the next time it compiles. Doing a "clean" build in Visual Studio only deletes the compiled binary results, it doesn't remove any intermediate object files that may have been created that Visual Studio might be linking against. By manually deleting the "obj" folders, you delete those cached object files and force a true rebuild.
What kind of project is it (website, console app, ...) Are you running the project directly from visual studio, or attaching to it afterwards?
Usually when this happens to me, its because the assemblies that are being used to run the process I want to debug do not match the currently built assemblies from visual studio.
You mention IE8, so if this is a website, you should try to attach visual studio to the w3wp.exe process. Otherwise the breakpoint won't have any effect. Alternatively, run the website using visual studio.
If you hover over the breakpoint in Visual Studio, does it indicate an error? Common problems are that the code hasn't been built, or the DLL that contains the code isn't loaded into the debugged process.

Resources