Describe the bug
The SDK changes encoding of file-based app files when adding packages.
To Reproduce
1 - Create a a file.cs (UTF-8 encoded)
2 - Add a shebang : #!/usr/bin/env dotnet run and chmod +x file.cs
3- Run it: ./file.cs
4 - Add any package dotnet add file.cs AnyNugetPackageIdHere => file.cs is converted to UTF-8 with BOM
5 - Running ./file.cs again after the package is added results in failure:
> ./file.cs
./file.cs: line 1: #!/usr/bin/env: No such file or directory
Further technical details
.NET 10 SDK, 1.0.100
Describe the bug
The SDK changes encoding of file-based app files when adding packages.
To Reproduce
1 - Create a a file.cs (UTF-8 encoded)
2 - Add a shebang :
#!/usr/bin/env dotnet runandchmod +x file.cs3- Run it:
./file.cs4 - Add any package
dotnet add file.cs AnyNugetPackageIdHere=>file.csis converted to UTF-8 with BOM5 - Running
./file.csagain after the package is added results in failure:Further technical details
.NET 10 SDK, 1.0.100