Skip to content

Correction to avoid Compiler Warning messages on build - #14

Open
FranckSix wants to merge 10 commits into
ycanardeau:mainfrom
FranckSix:main
Open

FranckSix wants to merge 10 commits into
ycanardeau:mainfrom
FranckSix:main

Conversation

@FranckSix

@FranckSix FranckSix commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

With tools like Roslyn or SonarQube, auto-generated code can produce warnings after build. The best way to suppress these warnings is to apply the System.CodeDom.Compiler.GeneratedCode attribute. Most code analysis tools recognize this attribute and do not generate a warning during compilation.

I also added summary comments to the auto-generated classes to avoid CS1591 warnings.

I also struggled quite a bit with AppendLineLF. To align our approaches, I added a .NormalizeLineEndings() extension method for interpolated strings. It makes testing much easier and ensures the generated classes use only \n. After re-enabling AppendLF, we had mixed line endings; now everything is consistent as intended.

Since support for .NET 8.0 and .NET 9.0 ends this November, I also took the opportunity to migrate the test projects to .NET 10.0.

I also checked the vulnerability alerts for the NuGet packages. I noticed that support for xunit has ended. I migrated the test projects to xunit.v3. This wasn't easy, as it involved switching from VSTests to MSTests.

FranckSix and others added 10 commits September 30, 2026 15:19
CS1591 - https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/compiler-messages/cs1591

I also added GeneratedCodeAttribute on each generated class to not add warning on destination solution build.

Upgrading Nuget Package to latests versions.

Replacing Deprecated xunit with xunit.v3 and adjust unit tests.
Replace $(solutionDir) by ../
Replace all new line of AppendLine with AppendLineLF
Adjust unit tests
Apply extension method NormalizeLineEndings on string interpolation to standardize line feed against existing generators
Testing with VSTest target is no longer supported by Microsoft.Testing.Platform on .NET 10 SDK and later
Spaces in Resource Name Should Produce Valid Property Names
 ycanardeau#11
Assume StaticClass and StaticMenmber to be false when GenerationType is StringLocalizer
@FranckSix

Copy link
Copy Markdown
Contributor Author

Hi @ycanardeau, this PR is ready for review whenever you have a chance. Let me know if you'd like any changes. Thanks!

@FranckSix

Copy link
Copy Markdown
Contributor Author

Hi @ycanardeau just in case are tou still active in the project ? There are somes pull request since July ? I hope you're fine. Thank-you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant