question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot save *.cs or *.fs file.

See original GitHub issue
  • code-server version: 1.408-vsc1.32.0-linux-x64
  • OS Version: ubuntu 18.04 LTS

Description

In a directory that command dotnet new console was emitted, cannot save *.cs or *fs or etc file. And its content is lost. But in a directory that command dotnet new console was not emitted, no problem occurs.

Steps to Reproduce

  1. Open a directory, and dotnet new console.
  2. Edit *.cs file, try to save it.
  3. Cannot save a file, and its content is lost.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
wdstarcommented, May 2, 2019

I have the same issue too. However, after deleting BOM from *.cs, I can edit and save the files.

2reactions
foresthoffmancommented, Apr 10, 2019

There’s another Discord user reporting the same problem. The dev console provides the following error when attempting to edit and save one of the .cs files:

ERROR  Failed to handle server message
c01964.bundle.js:53 id (String): event: open
c01964.bundle.js:53 length (Number): 24
c01964.bundle.js:53 error (String): s.encodeStream is not a function

encodeStream traces back to vs/base/node/encoding which uses the encodeStream function exposed by the iconv-lite package.


Running file -i on one of the .cs files indicates that the files are binary, e.g.

/home/coder/test/Program.cs: inode/x-empty; charset=binary

Edit: Version: 1.604-vsc1.32.0-linux-x64 Edit 2: The user said that refreshing, after generating the .cs files and before editing, allowed for editing and saving any files.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot save *.cs or *.fs file. · Issue #389 · coder/code-server
Open a directory, and dotnet new console . Edit *.cs file, try to save it. Cannot save a file, and its content is...
Read more >
Cannot save .cs files - MSDN - Microsoft
I closed that project (without saving the changes, obviously), opened another project, made a change and it saved with no problem.
Read more >
C# file won't save - Stack Overflow
1 Answer 1 ... You are saving a player.players collection and you are trying to load a single Player ( player.players.Add((Player)formatter.
Read more >
Can't save .cs file after changing the name attribute of a button.
After I change the button Name attribute from "button1" to "RecordButton", I can't save the file and I get the following error:
Read more >
Photoshop (NonCC) CS6 - Cannot Save Files "File Not Found"
Because the message does not contain the path and file name the programmer is still learning their craft. If you are using "Save"...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found