FIX: Local File Is Not Saved with Save All

ID: Q139295


The information in this article applies to:
  • Microsoft Visual C++ 32-bit Edition, versions 2.2, 4.0, 4.1, 4.2
  • Microsoft Fortran Powerstation 32 for Windows NT, version 4.0


SYMPTOMS

Save All will not save a file loaded into the Developer's Studio editing environment if all of the following are true:

  • The loaded file is not modified in the editor.


  • The copy of the file stored on disk is modified.


  • The modified version is not reloaded.


Subsequent builds will use the version on disk that does not match the one in the editor. Debugging will display in the loaded version, but the debug information will be from the version on disk.


CAUSE

The Developer's Studio does not recognize that an unchanged file may need to be saved. It assumes that this would have no effect, so the save does not occur.


WORKAROUND

If a change you do not want occurs with an external file and you want the local copy of the file to replace the one on disk, use Save rather than Save All.


STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual C++ version 5.0.


MORE INFORMATION

Steps to Reproduce Problem

  1. Run Microsoft Developer's Studio, and load a project.


  2. Open a file containing code, but make no changes.


  3. On the Tools menu, click Options, and then click the Editor tab. Turn off the 'Automatic reload of externally modified files' switch.


  4. Using the Notepad editor, load the same file you are editing in the Developer's Studio. Introduce a compile time error, and save the file.


  5. Switch back to the Developer's Studio.


  6. Answer No when you're asked "This file has been modified outside the source editor. Do you want to reload it?"


  7. On the File menu, click Save All. This should replace the modified file on disk with the copy previously loaded into Developer's Studio, but it does not.


  8. Build the project. The compiler will report the errors you introduced. Click the error or press the F4 key to jump to a line in the file (which does not contain the error) that is loaded in Developer's Studio.


Example Workaround

To work around the problem, replace step 7 with this:
  1. On the Window menu, select the file that was modified externally. Then on the File menu, click Save. This will replace the modified copy on disk with the copy currently loaded in the Developer's Studio.


Additional query words: kbVC400bug update

Keywords : kbide kbVC kbVC500fix
Version : :2.2,4.0,4.1,4.2
Platform : NT WINDOWS
Issue type : kbbug


Last Reviewed: January 31, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.