Visual Studio 13 doesn't build all changes - c#

I'm using Visual Studio 2013 Professional, C# settings.
For some reason, when I hit "build", it won't build all the changes I made. Only when I rebuild or clean and build, my changes are compiled correctly (of course).
Even when I just set a breakpoint and build, it says the breakpoint can't be hit.
I know I can just reset F6 to execute a rebuild, but because I have a big solution, this would always take about 10-15 seconds, even for the smallest changes..
I know this is a problem many people have faced, and there are some steps suggested to fix it. These don't work in my case though.
Yes, I've set "On run, when projects are out of date" to "Always build" or "Prompt to build", both didn't work.
Yes, I've checked the build configurations manager that all projects are checked to build.
I have a feeling that it's still something in my settings..
Because a few weeks ago I was still using Visual Studio 2012, and I had the same problem. Now in my company, I got VS13, and because of some specific settings they used my VS12 settings file to maintain them.
Only one other person in our IT-department has that problem, so the general company settings are not the problem. I can't recall changing anything on my own though..
So, did anybody find another way to solve this problem besides the 2 tips I listed above ?

I think you are working in a team and you are not aloud to make these changes.
http://msdn.microsoft.com/en-us/library/hh561430.aspx

I spent ages messing with project and environment settings without sucess. For me I fixed this problem by selecting configuration manager from the debug/release dropdown and ensuring that the build checkbox was ticked.
After this it appears to build as and when needed.
HTH
Paul

Uncheck: Options > Project And Solutions > Build And Run > "Only build startup project and dependencies on run"

Related

VS13 won't build all changes

I'm using Visual Studio 2013 Professional.
When I do a "build", VS won't build all the changes I made in my solution. Only when I hit "rebuild" or "clean and build", my changes are compiled correctly. Even when I just set a breakpoint and build, it says the breakpoint can't be hit. I know I can just reset F6 to execute a rebuild, but because I have a big solution, this would always take about 10 seconds, even for the smallest changes..
This is a problem other people have faced, and there are a few steps suggested to fix it. These don't work in my case though.
•Yes, I've set "On run, when projects are out of date" to "Always build" or "Prompt to build", both didn't work.
•Yes, I've checked the build configurations manager that all projects are checked to build.
I have a feeling that it's still something in my settings.. WhenA few weeks ago I was still using Visual Studio 2012, and I had the same problem. Now in my company, I got VS13, and because of some specific settings they used my VS12 settings file to maintain them. Only one other person in our IT-department has that problem, so the general company settings are not the problem. I can't recall changing anything on my own though..
So, did anybody find another way to solve this problem besides the 2 tips I listed above ?
Try to check skipped source files modified timestamps. Incremental build compares timestamps in input and output files: MSDN Incremental build link.
Also you can set msbuild output level to Diagnostic in Tools -> Option -> Projects and Solutions -> Build and Run and see more detailed output.

"Publish Now" button doesn't work, but Build>Publish does

In Visual Studio 2010, I have just one project that cannot be published using the "Publish Now" button.
If I publish using the menu option instead, it works fine. I can then increment the version number, click "Publish Now" (or use "Publish Wizard..."), and get this error:
Cannot publish because a project failed to build.
However, no other error message is given. I managed to get screenshots of the output screen before it clears and flips to the Error List tab, but there is no mention there of any error. Clean & Rebuild doesn't fix the problem.
What do these two options do differently? Why is the build failing one way but not the other?
Since "rebuild solution" and "clean Solution" are not solving these issues, it might be either logs or assemblies in Bin.
This error seems to be caused by various issues :
Solution 1. set the build log verbosity to Diagnostic from the menu Tools->Options->Project and Solutions->Build and Run in Visual Studio 2010.
After that, if you build and publish your project, you can see the detailed build log from the Output window. From there, we should get futher information about why it failed to build.
Solution 2. Do you have Google Desktop by chance? If you do, close the sidebar and try once.
Solution 3. Click here for an another solution
Solution 4. Do you work with people from other timezones ? Files modified in future time may also cause this issue. check this utility
Solution 5.
I suggest you to try running the Visual Studio in safemode that will force the visual studio loading only the default environment and services, and shipped versions of third party packages. If the problem disappears you may stuck with some version of IDE tools with bugs. update them then.
If nothing seems to work, try this.
*Solution 6*
After researching it, it appears that the built in build/publish script that Visual Studio (2010 in our case) uses has a flaw in the order that it does things. Most importantly it runs a cleanup on the OBJ directory deleting the target EXE file before the publish step can grab it.
The solution
This is somewhat of a hacky workaround, but it solved the problem for me.
The fix is to copy the file back to the /obj/ folder from the /bin/ folder right before the publish step. Unfortunately there is no way that I know to specify a BeforePublish event through the IDE, so you will have to edit the .vbproj file in a text editor.
Add the following section just before the final tag.
<Target Name="BeforePublish">
<Copy SourceFiles="$(TargetPath)" DestinationFolder="$(IntermediateOutputPath)" />
</Target>
Clean and Rebuild worked for me. It seems like Google desktop and some browser extenstions causing this bug often. looking for a security update is good way to go with this.
I eventually created a new branch, and that branch did not have this problem. I never discovered what the actual cause was.

Visual Studio 2012 not compiling anymore after changes made

i recently installed VS 12 Service Pack 1.
Since then, i noticed Visual Studio doesn't compile my project on start if changes were made.
Normally if you start (debugging) a project which has some changes, it recompiles it and starts then. But now, i always get debugging errors like "this breakpoint can´t be reached, because the source code is unequal to the runtime code" or whatever.
It´s annoying to recompile it manually always before starting - I always forget that :-/
Is there any option to fix this?
Can you check if the build on run option is set?
You will find it under Tools->Options->Project and Solutions->Build and Run.
I dont have a good answer as to why this would have been flipped just via installing the update1.
I think that you should enter the Solution's Property Pages (by right clicking the solution in the Solution Explorer pane) and setting the 'build' check-box of the relevant project.

no breakpoints can be set VS2010?

This is happening to me very often. When I am working in Visual Studio 2010 and say I make a code change, then build... Both my existing breakpoints become disabled / and or cannot be set and I also cannot set new breakpoints. Does anyone have a solution for this? It is very annoying. So far the only way I have been able to get around this is to restart Visual Studio which can take 5 to 8 minutes to reindex everything or to try rebuilding individual projects in my solution. My solution consists of several DLLs which make up the entire program.
Check that you have the dependencies set correctly in your projects. I know my breakpoints will become disabled if the code is "out of date". If you don't have the dependencies set up right, then when the updated code is rebuilt it will not rebuild all of the related code which will then leave those modules "out of date".
Since this is VS 2010, the dependencies are on the project not on the solution (you can add solution dependencies, but project dependencies will carry over into a new solution so it is the better way to go when possible).
This issue is caused when you having your Configuration Manager settings set to Release rather than Debug.
In Visual Studios select Build from the menu, then Configuration Manager.
In the next dialog select your project, then locate the drop down menu near the top left corner titled "Active solution configuration:" Make sure it is set to Debug.
That should fix the problem.
As it turns out the post.build file contained numerous conditions for whether or not it should copy several DLLs to a target directory... Since I didn't have time to pick through the xml for these actions I just used a bash script to copy the files after building. No need to get complicated... Otherwise, the formal solution involves setting conditions for allowing the DLLs to be overwritten/copied after compile or not.
I find the Visual Studio post.build file concept a little excessive since in the end it will make little difference whether a dll is overwritten with a freshly compiled version, yet, if you make code changes, compile, and it doesn't copy to the target directory you end up running your app with an out of date DLL and you are not testing with the recent code change..! Others have even implemented the post.build file complete with xml and goto statements...! Leave it to Microsoft to complicate the build & debug process...
Alternatively, if your code is under version control start afresh by checking out the head revision, do another clean and rebuild and start debugging again.
This for whatever reason enabled me to insert breakpoints in my VS 2010 C# project once again, whereas no amount of fannying around with properties, configurations etc got rid of my phantom breakpoint problem.
The best solution I found for this was to quit my Windows job and get another job as a Mac Developer where we use Xcode.! What a huge difference.! I sure haven't seen that breakpoints problem again.!

Code changes not being included when compiling in Visual C# Express 2010

At seemingly random times, whenever I load up VC# Express for the day and start working, any changes I make to my code don't get reflected in my debug runs. It's as if VC just refuses to compile the code and just runs the old already-compiled version. Deleting the "bin" folder in the project directory doesn't help, as then VC just complains that it can't find the *.exe instead of recompiling. Doing a rebuild helps, but only for that one rebuild, so I'm continuously having to rebuild the solution to see any changes, which is really slow.
The only way I've found to get rid of this problem (for maybe a week or two) is to create a new project and manually copy over my code. Needless to say, this is really frustrating and tedious. Is this a documented issue? What can be done to fix it? Searching online doesn't really turn up any answers, as the search terms most applicable to the problem bring up a lot of noise results.
You might see if the project you are working on is set to Build when the solution builds. To check this, right-click your Solution and go to Properties. Click the Configuration Properties node on the left and make sure all of the projects you want to build are checked on the ride side for your given build type.
UPDATE: Also, what is the timestamp on your build files? Is the timestamp getting updated on your build?
I had this problem when working on a network drive, and the time on the server was out of sync. Linux+Samba accessed by Win7 Pro and VB 2010 Express.
Correcting the time-difference solved the issue.
click on BUILD-->REBUILD SOLUTION and you are now good to go

Categories