Visual Studio builds every time - visual-studio-2010

I'm running VS2010, debugging as normal, and suddenly I notice that my code changes are having no effect. Moreover, even when I just type in some random crap and hit 'play', it still builds regardless. How do I fix this?
Thanks!

I would check your Settings in the Tools --> Options --> Projects and Solutions --> Build and Run Section making sure Save all changes is selected and Launch Old Version is not Selected.

Related

Edits were made which cannot be compiled. When using Resharper in VS2019

I have a multi project solution using .Net Core 2.1
With VS2019 16.3.9 and Resharper 2019.23 Build 192.0.20191016.60459
If I try to run a test in debug, it will run ok once.
On the second run I will get the error
Edits were made which cannot be compiled. Execution cannot continue
until the compile errors are fixed.
I have tried deleting the .vs folder
A similar question is asked here but I thought it was worth starting a new question as this is related to Resharper.
I get the error in the VS unit test window and in Resharper's test window.
Potentially this is caused by Visual Studio's Edit & Continue feature.
A workaround is to disable this feature:
Debug --> Options --> Debugging --> General --> uncheck Enable Edit and Continue
Solution taken from here.
Make sure than your debugging things are like this:

How to figure out why ReSharper is not rebuilding unit test project before running?

Recently I am having an annoying problem. When I go to Unit Test Sessions window and run some tests, ReSharper seems to completely ignore any changes in my code(even in the code of the test itself!) and does not rebuild anything. Because of that I have to rebuild everything manually. I think that problem is too generic to post on bug-tracker so I would like to find at least any additional information. For MsBuild I can always enable diagnostic logging and track all its decisions during build. How can I find what is the problem with ReSharper?
Versions:
Visual Studio 2015 Pro Update 2; ReSharper Ultimate 2016.1.2.
Have you installed the Rider EAP by any chance? There is a bug in the latest EAP (EAP7) that sets the build action before running tests to "Never", and since the global settings file is shared between Rider and ReSharper, this also causes ReSharper to not build tests before running. The fix is simple - just change the value in the drop down in the unit test runner window. See the bug report for more details.
One thing I'm not sure on is if this is a recurring issue - i.e. the value gets reset to "Never" every time Rider opens the unit testing window. This is an unfortunate bug, and will definitely be fixed for EAP8.

Save All Files Before Build Gone in Visual Studio 2012?

In Visual Studio 2010, there was a setting under Tools --> Options --> Projects and Solutions --> Build And Run --> Before Building (Save all changes). In VS 2012, this setting appears to be gone, and my solution is not saving before build. Note that the projects I am building is a MakeFile project with Clang/LLVM for the compiler, if that is relevant info.
Is there a setting somewhere that I am missing?
According to the answer provided by Vicky Song (Microsoft), the feature is no longer available. If you wish to submit a feature request, they will consider it.
Reference:
http://social.msdn.microsoft.com/forums/vstudio/en-US/be441ff6-682f-4534-b653-99632a7975a4/before-building-settings
This feature is very useful mainly when considering that many users have the Visual Studio to crash randomly (myself as well). So when I want to run a compile-build-test, I would like to save everything open (including the environment that gets lost on those nasty events)...

How to disable generating the project all the time in Visual Studio 2005?

I am just having a problem in my Visual Studio 2005. Every time I debug my code, the project is re-generated and it really takes too much time. For this reason I am looking a possibility to disable this option if possible. Can you please help me with this situation?
Right click the solution and select "Properties". There should be an entry "Configuration" (sorry, I'm using German VS, so it may be named differently). There you can check boxes that determine whether a project should be built or not.
Please note that this affects the overall build process, too. I've had situations where I wondered why changes wouldn't work until I noticed that I kept working with an old version because I unchecked the Build checkbox!

Visual Studio 2010 doesn't rebuild changed code unless I manually select "Rebuild"

In the past week or so, I've noticed that Visual Studio 2010 is not recompiling code unless I force it to. This is a C# 4.0 project with WPF. I hit F5, which seems like it used rebuild, if the code had changed, and then launch the app. Instead, it now says in the bottom left status bar "Build Successful" and launches the application. It doesn't actually rebuild the app, though. I can tell because:
even if I make a large number of changes, it "compiles" very quickly and
if I try to set a breakpoint, it gives the warning that the code has changed and doesn't
set the breakpoint.
This happens regardless of whether there are errors in the code or not, so I don't believe it's the thing where it launches an older version if the build fails.
If I instead select from the menu to rebuild the project, it then works. This kind of impedes my usual workflow, however. I semi-frequently forget to do this, and then spend 10 minutes trying to figure out what the hell is wrong with my changes. Even worse, sometimes there are build errors that I don't notice right away.
Pressing F6 to "rebuild" the solution does not do anything either. What settings might I have mucked with that would cause this behavior?
Gah, I figured this out. It was naturally something stupid I did when messing around with build settings after a too-late night. Here are the things to check:
Tools >> Options >> Project and Solution >> Build and Run >> Check that "On run, when projects are out of date" is set to "Always build" or "Prompt to build"
Build >> Configuration Manager >> Check that "Build" is checked for all of the projects you want to build for each of the configurations you need to use.
Also if multiple projects in solution, check configuration manager.
If you have some projects "Any CPU" and some "x86", will be builded only projects of same arhitecture.
Same with "Debug" and "Realese" config.
Had similar issue in 2020 with VS 2019 (Community Edition) and WPF project not being rebuilt (deemed as "up-to-date") even though the referenced project was rebuilt. The above advice (Tools->Options and Configuration Manager) is met in many places, though didn't work for me.
Eventually changing .csproj file and adding the following line (under ProertyGroup) worked for me:
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>

Resources