botframework-components icon indicating copy to clipboard operation
botframework-components copied to clipboard

Generated cs need to be stored as UTF-8 with byte order mark

Open gabog opened this issue 4 years ago • 3 comments

Version

Latest from main as of 3/30/2021

Describe the bug

StyleCop throws a Store files as UTF-8 with byte order mark warning when trying to open the csproj in visual studio.

image

Affected files (that I've found so far) are:

  • BotControoler.cs
  • SkillController.cs
  • Program.cs
  • Startup.cs

To Reproduce

  1. Create an empty bot
  2. open the bot in Visual stdudio and add StyleCop to it image
  3. Turn warnings as errors to make it easier to see the violations
  4. Try to compile the bot and you'll get the errors shown above.

Expected behavior

Generated projects should pass StyleCop (and FxCop if used) checks on compile.

Additional context

My current workaround is to open the affected files in VS and resave them so they have the proper encoding.

gabog avatar Mar 30 '21 12:03 gabog

It looks like we can achieve this through yeoman with a combination of registerTransformStream() (see Transform output files through streams) and gulp-line-ending-corrector.

CRLF is a very Windows-specific thing; we should determine what the desired behavior across all OS environments ought to be here.

peterinnesmsft avatar Apr 01 '21 17:04 peterinnesmsft

Need to investigate if CRLF has negative impact on other OS (Max/Linux) environments.

peterinnesmsft avatar Apr 05 '21 19:04 peterinnesmsft

Moving to backlog for R14 consideration.

peterinnesmsft avatar Apr 27 '21 19:04 peterinnesmsft