Skip to content

BOM or an invisible character added in .Net project #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
oviyahmk-1998 opened this issue Mar 21, 2025 · 0 comments
Open

BOM or an invisible character added in .Net project #79

oviyahmk-1998 opened this issue Mar 21, 2025 · 0 comments

Comments

@oviyahmk-1998
Copy link

What happened?

Experiencing difficulties in utilizing the Hai Build code generator for the .NET Web API project. Whenever the code generator makes changes to Program.cs and appsetting.json files, it inadvertently introduces a Byte Order Mark (BOM) or an invisible character at the beginning of line 1. This issue should be addressed to avoid build issues.

Steps to reproduce

Scenario 1:

  1. On a .Net Web API project
  2. Execute a tasks that will make changes on Program.cs. Like, make a CORS change to allow all origin/ specific client origin.
  3. Code generator will execute the task. If you review the changes made to Program.cs file on .Net project, there will be a BOM or an invisible character will get added in line 1.
  4. Here is the screenshot for the reference
Image 5. With this character, the project build will not be successful. 6. Expected behaviour is to prevent this character from being added.

Scenario 2:

  1. On a .Net Web API project
  2. Execute a tasks that will make changes on appsettings.json. Like, add database connection string in appsettings.json file.
  3. Code generator will execute the task. If you review the changes made to appsettings.json file on .Net project, there will be a BOM or an invisible character will get added in line 1 similar to previous screenshot attached.
  4. With this character, the project build will not be successful.
  5. Expected behaviour is to prevent this character from being added.

Relevant API REQUEST output

Operating System

macOS Sonoma

HAI Build Version

v3.1.1

Additional context

No response

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

No branches or pull requests

1 participant