razor icon indicating copy to clipboard operation
razor copied to clipboard

build.cmd fails on main due to IDE0055 formatting errors

Open StevenTCramer opened this issue 2 months ago • 5 comments

build.cmd fails on main due to IDE0055 formatting errors

Repro

git clone https://github.com/dotnet/razor.git
cd razor
./restore.cmd
./build.cmd

Expected

Build succeeds without analyzer failures.

Actual

build.cmd promotes warnings to errors, so hundreds of IDE0055 (Fix formatting) diagnostics appear in src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces for the netstandard2.0, net8.0, and net9.0 target frameworks, causing the build to fail locally and in CI.

StevenTCramer avatar Nov 05 '25 13:11 StevenTCramer

@ToddGrun - I'm guessing this is the issue we were looking at yesterday?

DustinCampbell avatar Nov 05 '25 16:11 DustinCampbell

Weird, I run command line builds pretty regularly and haven't hit this, and our CI builds all run with WarningsAsErrors and are passing.

I have seen formatting errors in the IDE for the new C# extensions syntax, but I wouldn't have thought we had hundreds of them, nor many if any in Workspaces.

davidwengier avatar Nov 05 '25 20:11 davidwengier

@StevenTCramer could you attach the full build log? I'm curious to see which files have issues. Maybe your git config is different, and our .gitattributes file is missing something. Perhaps even running build.cmd -bl and attaching the artifacts\log\Debug\Build.binlog file might be useful.

davidwengier avatar Nov 05 '25 21:11 davidwengier

@davidwengier I only work on this on the weekends and with dotnet 10 coming out in a few days I probably won't even get to on this weekend. Getting this repo to build is non trivial. Last time I end up having to remove all my sdks and runtimes afterward.

But when I get back to it I will update this if you guys haven't solved it already.

StevenTCramer avatar Nov 07 '25 19:11 StevenTCramer

@StevenTCramer as far as I'm aware you're the only person hitting this issue, so no stress from us if you don't have any more info. Just trying to unblock you :)

davidwengier avatar Nov 07 '25 21:11 davidwengier