ice-builder-visualstudio icon indicating copy to clipboard operation
ice-builder-visualstudio copied to clipboard

Visual Studio 2022 (17.10 and higher): Re-Opening a .NET8 project makes all files read-only

Open DanielBernhard opened this issue 9 months ago • 1 comments

To reproduce:

  1. Install a current version of Visual Studio 2022 (version 17.10.xx or higher. versions 17.8.xx are not affected)
  2. Create a new C# library project with .NET8 (I assume other .NET core projects are also affected, but didn't check)
  3. Close the project
  4. Re-Open the project -> All files are treated as read-only and cannot be modified. Only fix is to delete the ".vs" folder and then open the project. Once closed and re-opened same effect again...

This behavior only appears when the extension "Ice Builder for Visual Studio 2022" is installed and enabled.

Note 1: Disabling the extension doesn't "fix" any broken project by itself. You still need to delete the ".vs" folder first. Note 2: The files themselves are not read-only on disk. Neither are they locked (e.g. possible to edit with any text editor). Note 3: Please note that the project itself doesn't even use ice in any way. We have a bigger project with .Net Framework 4.7 that uses ice, but the problem is, that I cannot work on our other projects anymore due to ice builder.

Workaround: Disable Ice-Builder BEFORE opening any .NET core project.

DanielBernhard avatar Mar 19 '25 10:03 DanielBernhard

Hi @DanielBernhard

Thanks for reporting this issue. I was able to reproduce it.

It appears to be caused by a problem in Visual Studio, which I have reported here: Visual Studio Developer Community Issue.

The Ice Builder marks generated files as read-only when opening a project. It relies on HasMetadata to determine whether a C# item was generated by the Slice compiler. However, in Visual Studio 17.10, HasMetadata("SliceCompileSource") appears to always return true, causing the builder to incorrectly identify and mark items as generated files.

pepone avatar Mar 19 '25 14:03 pepone

Hi @DanielBernhard,

I've attached a new IceBuilder build that should fix the problem. It would be great if you could give it a try. Just extract the ZIP file and double-click IceBuilder.vsix to install it.

IceBuilder.Next.zip

pepone avatar Apr 11 '25 09:04 pepone

Hi Jose, Sorry for the delayed response. The fix works correctly. Thanks for your work!

DanielBernhard avatar Apr 17 '25 06:04 DanielBernhard

I published 6.0.4 with the required fixes.

pepone avatar May 06 '25 15:05 pepone