The NOSONAR flag doesn’t work in razor files. Applying an exclusion via the scanner doesn’t work since the analyzers run against the build. We are going to have to stop using SonarQube in order to work around this issue.
Hey @austinmcdaniel, this is a known limitation that we are tracking internally and which also has an open issue on GitHub (feel free to follow progress there).
However, I don’t think you need to completely stop using SonarQube because of this. I would say you have 2 potential workarounds:
Use MSBuild’s NoWarn to suppress S3267 at compiler output level. Other users with similar issues have added this to directory.build.targets: