New Reload Solution feature: external .sln changes silently reverted, new project not picked up

Clarion build

12.0.14204

OS / architecture

Windows 11 25H2

Area

IDE / editor

What happened

When a project is added to a .sln from outside the IDE while the solution is open,
the IDE detects the change and offers to reload, but answering Yes both fails to
show the project and overwrites the .sln on disk with the IDE’s in-memory copy, so
the external change is lost.

The dialog appears exactly as expected:

Solution changed externally
The solution or one of its project files has been changed outside the IDE.
Reload the solution to pick up the changes?
[Yes] [No]

Answering Yes:

  • the new project does not appear in the Solution Explorer tree
  • the .sln on disk is rewritten back to its previous contents, byte-identical to a
    copy taken before the edit, with a modified timestamp a few seconds after Yes was
    clicked

No error message is shown - the change is discarded silently. Reproduced twice,
answering Yes both times. The new project’s own folder, .cwproj and .clw were left
untouched on disk; only the .sln was reverted. The .sln.cache file was not written
at any point during the tests.

The equivalent project-level case works correctly. Adding a
entry to an already-loaded .cwproj externally produces the
same prompt, and answering Yes shows the new file in the tree straight away, with
the .cwproj left untouched on disk (same size and timestamp as the external write),
so the IDE re-read it rather than rewriting it. The fault appears to be specific to
solution-level structure.

This looks like the reload re-reads the projects it already knows about and then
re-serialises the .sln from the stale in-memory project list, so a project that
exists only on disk is neither picked up nor preserved. It may also mean the
save-time staleness check covers .cwproj but not .sln.

Worth noting the practical trigger is not hand-editing a .sln, but a git pull,
branch switch or merge that adds a project while the solution is open: the IDE
asks, you answer Yes, and the incoming change is reverted without warning.

Steps to reproduce

  1. Open a solution containing a single Clarion project and leave the IDE open.

  2. Outside the IDE, create a second project - a folder containing a minimal
    .cwproj (own ProjectGuid) and one .clw source file.

  3. Outside the IDE, edit the .sln in a text editor to add the second project:
    a Project(“{12B76EC0-1D7B-4FA7-A7D0-C524288B48A1}”) = “HelloWorld”,
    “HelloWorld\HelloWorld.cwproj”, “{new-guid}” block with its EndProject, plus the
    four matching lines in GlobalSection(ProjectConfigurationPlatforms). Save it.
    (Take a copy of the .sln first - it is needed for step 6.)

  4. Switch focus back to the IDE. The “Solution changed externally” dialog appears.

  5. Click Yes. Observe that the Solution Explorer tree still shows only the original
    project - the new one is not listed.

  6. Compare the .sln on disk with the copy taken in step 3. It has been rewritten
    back to its original single-project contents, and its timestamp is later than
    the external edit.

For contrast, the working case: add to the
already-loaded project’s .cwproj externally, create that .clw alongside it, switch
back to the IDE and answer Yes to the same dialog. The file appears in the tree and
the .cwproj on disk is not modified.

Confirmed — and your read was right. Reload closed the solution before it re-reads the file, and the close-time save wrote the in-memory model over your edit; the reload then read the reverted file. No error because, as far as the IDE knew, it had just saved the solution.

Fixed: a solution save now checks whether the .sln changed on disk since the IDE last read or wrote it. Reload never overwrites in that case — your new project shows up and the .sln stays exactly as you saved it. Close Solution after an external edit (git pull, branch switch) now asks before overwriting instead of doing it silently — the same prompt the .cwproj already had.

It’ll be in the next refresh.