Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio. Code changes don't do anything

Any changes I make to my code aren't doing anything. I've even tried putting lines in that I know will crash my program, and nothing. It just keep running the old version. It's even loading old versions of files I've edited and saved.

There a 3 projects in my solution. 2 are pure C#. 1 is a WinForms application.

like image 662
Raj Avatar asked May 20 '11 21:05

Raj


People also ask

How do I enable code changes?

Tools > Options > Debugging > General > Enable Edit and Continue has a checkmark, as do Enable Native Edit and Continue, Apply changes on continue, Warn about stale code, and Allow precomiling are all checked.

How do you auto adjust in VS Code?

Select the text you want to automatically indent.Click menu Edit → Advanced → *Format Selection, or press Ctrl + K , Ctrl + F . Format Selection applies the smart indenting rules for the language in which you are programming to the selected text.


3 Answers

It sometimes happens that some files "are being used by another process".

Close your solution and delete all "bin" and "obj" subfolders of all your projects that are included in the solution.

Then open your solution again, execute "Clean solution" and build it again.

like image 95
Jens H Avatar answered Sep 22 '22 05:09

Jens H


Check this setting in Tools/Options, then under Projects and Solutions>Build and Run.

On Run, when build or deployment errors occur:

My personal preference is for this value to be 'Do not launch'. It will prevent Visual Studio from launching the "last successful build".

like image 21
tuxedo25 Avatar answered Sep 22 '22 05:09

tuxedo25


Try Ctrl+Shift+B. This will build your solution (not just a particular project). Other environments might build when you save but this needs to be explicit in Visual Studio.

like image 45
Dave Rael Avatar answered Sep 24 '22 05:09

Dave Rael