18

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.

E.Z. Hart
  • 5,717
  • 1
  • 30
  • 24
Raj
  • 203
  • 1
  • 2
  • 5

14 Answers14

27

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.

Jens H
  • 4,590
  • 2
  • 25
  • 35
  • I am having the same issue but when I delete bin and obj i get configuration error. Or is the rosalyn and x64 folders i should delete – Sue Sep 07 '17 at 22:04
  • @Sue: If you get a configurationerror after re-compiling, the cause of your problem might be something different. I haven't tried with the latest VS version yet. But If you just delete auto-generated folders you should not get into any troubles. Just try it, you have nothing to lose. :-) – Jens H Sep 08 '17 at 07:58
  • I don't see any changes. – Sue Sep 08 '17 at 13:53
  • @Sue, it looks like you are having a different problem. In that case you should better open up a new question (if haven't already). – Jens H Sep 11 '17 at 08:53
  • Yeah I did open a new question, doesn't seem to solve my issue – Sue Sep 11 '17 at 14:53
  • 1
    And I think it's the same issue, when I make changes in the controller, nothing happens but in the view the changes are made – Sue Sep 11 '17 at 15:21
  • What do you delete from the folders bin obj, the sub-folders or the files? – Sue Sep 13 '17 at 14:48
  • @Sue: I simply delete the actual folders "bin" and"obj" folder themselves.All child folder get re-created anyways. And not just from one project but from ALL projects in the solution. – Jens H Sep 14 '17 at 07:21
  • +1 for closing solution and opening again. Didn't have to delete anything nor Clean aniything nor building again – Gjaa May 09 '23 at 17:13
6

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".

tuxedo25
  • 4,798
  • 1
  • 16
  • 12
3

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.

Robert Koritnik
  • 103,639
  • 52
  • 277
  • 404
Dave Rael
  • 1,759
  • 2
  • 16
  • 21
1

Had issue with saving code changes on VS2017 (mac) Version 7.3 Preview (7.3 build 740)

Only way to get file changes to save was to do File > Save All

Doing File>Save would act like the file saved. But, when I opened the file again and no changes were saved.

brady321
  • 1,475
  • 13
  • 14
0

delete Published DLL From Bin

file names -

projectName.ddl
projectName.pdb

delete these two files and run project

  • i have tried this, and I still don't see the changes and the files were created – Sue Sep 25 '17 at 15:20
0

I had the same problem (Visual studio 2015 is not noticing my modifications in C# XAML files).

Problem solved by deleting 2 'debug' subfolders. One in the bin folder and one in the obj folder.

0

I met the same problem. the code changes is not saved.(you can see from the edit it is in Yellow color. e.g. indicating changes). SAVE and BUILD will not let it save the changes. i have to wait sometime, then it could possibly save success..

RyanShao
  • 429
  • 2
  • 9
0

also check another option in Tools>Build and Run>Only build startup project & dependencies if you have more than 1 nested dependency, especially when using Prism or any other reflection-based frameworks that prevent "dependency detection". Also, make sure you're in the editor when using shortcuts like Ctrl+S (Save) or Ctrl+Shift+S (Save all)

ajaysinghdav10d
  • 1,771
  • 3
  • 23
  • 33
Wesley Kenis
  • 107
  • 4
  • related: [Why don't other programs see the changes I made to a file in VS Code until I save those changes?](/q/76984829/11107541) – starball Aug 26 '23 at 21:59
0

Deleting the whole project and the corresponding folder from local and check out the solution again. This worked for me=> VS2017

Aathira
  • 655
  • 3
  • 14
  • 31
0

I solved the problem like this:

1. I closed the program

2. I opened the folder that contains the file (.csproj) and opened it with Visual Studio.

Next, I chose the folder to run the command as in the image

vs header

איש נחמד
  • 333
  • 2
  • 4
  • 11
0

Had the same problem. Turns out I had moved a project folder. Even when opening the solution from the moved folder and editing and saving this source code, VS 2019 was building and running a different instance of the program with the same name. Go to File-> Save yourproject.cs as..and manually walk back through the directory structure to find the instance VS is actually running. Hope this helps.

Bob
  • 1
0

Ok, you need to add more detail, but you may want to have a look at this answer:

How to enable/disable compile errors warning in Visual Studio

Community
  • 1
  • 1
manojlds
  • 290,304
  • 63
  • 469
  • 417
  • @Raj Yes there is. Read two comments on the question and answer those as well. We need to know more about the project you're trying to compile. It may as well be a Sharepoint project for what we know. – Robert Koritnik May 20 '11 at 22:05
  • Alright there a 3 projects in my solution. 2 are pure C#. 1 is a winforms application. I can't make changes to any of them. – Raj May 20 '11 at 22:12
0

Go to this location:

C:\Users\<your_system>\AppData\Local\Microsoft\VisualStudio\<studio_version>

Then remove all files and start Visual Studio.

janw
  • 8,758
  • 11
  • 40
  • 62
0

accidently

this was the error , no changes made after build.

iBala
  • 235
  • 1
  • 2
  • 13