1,529 questions
-3 votes
1 answer
175 views
File encoding does not seem to be ANSI [duplicate]
I'm trying to output a text file with ANSI encoding: Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); var encoding = Encoding.GetEncoding(1252); using (var streamWriter = new ...
0 votes
0 answers
24 views
Failed to bind properties under retro-fit-client.mapper.serializer-provider.generator.write-capabilities to jackson.core.StreamWriteCapability
Error starting ApplicationContext. To display the condition evaluation report re-run your application with 'debug' enabled. 2025-04-01T15:07:23.041+05:30 ERROR 33273 --- [pnp-reporting] [ ...
0 votes
0 answers
530 views
The requested operation could not be completed due to a file system limitation
While writing to a .gz file, and when the file size reaches about 291,261,644,800 bytes, I get the following. at System.IO.Strategies.BufferedFileStreamStrategy.WriteSpan(ReadOnlySpan`1 source, ...
0 votes
1 answer
45 views
Why is this code throwing random "file is being used by another process" exceptions?
.NET 4.8 VS 2019 I have a class in my program that logs text to a file to log command activity and free text messages. The program is crashing for one (1) customer of tens of thousands with a "...
1 vote
0 answers
29 views
C# Single NetworkStream creates both Reader and Writer, are they independent? [duplicate]
Until now I've had no dealing with NetworkStream and am having to use it for some TCP comms with a tcp enabled device, but I'm seeing some strange behaviour and it's got me asking the question above......
3 votes
1 answer
91 views
Writing into the same file with two `using` statements and two writers
I am trying to open a file in c#, then write some text into it, and conclude by dumping a compression of a bytes array into the same file. So, the file I want to create is something like ...
-1 votes
1 answer
67 views
OutOfMemory Excpetion when write a large txt file vb.net
In my program recovering data from the db (there are over 500k lines) I create a path with this data and write it in a file (in the db as a where clause I insert what the date range is, the lower it ...
1 vote
1 answer
69 views
Delete a string value in a CSV File with C#
I deleted my previous post in hopes this one is better and clear to be able to get help. I appreciate it. So far, with my code I am uploading a CSV file to format it as: I have skip the headers and ...
0 votes
2 answers
71 views
need to close after FILE.READLINES
I need to read all content of a file but keep only some of the content and append new content. So I tried to use READLINES filter the lines I need to keep then rewrite the file with the kept lines and ...
1 vote
1 answer
998 views
ASP.NET - HttpResponse.WriteAsync() vs HttpResponse.Body.WriteAsync() vs HttpResponse.BodyWriter.WriteAsync()
In ASP.NET one has three options (that I know of) for writing directly to the response buffer. Given the following data: var str = "Hello World"; var bytes = Encoding.UTF8.GetBytes(str); We ...
0 votes
1 answer
285 views
streamwriter and special characters & ’
To my understanding when I write a file using notepad++ I can write the symbols ’ and & without a problem in a text file. Both are valid ASCI symbols and they are not that exotic either. & = ...
0 votes
0 answers
43 views
How to Remedy Error System.UnauthorizedAccessException in My Console App?
I've programmed a console app using C#. When I run the console app I receive the error noted above. My programming logic is as follows: class Program { static void Main(string[] args) { ...
0 votes
2 answers
460 views
How do I download an xml file written with StreamWriter as an xml file
I have an XML file written in C# using StreamWriter with this code: String filename = Session.SessionID + ".xml"; String filepath = "h:\\root\\home\\mchinni-001\\www\\site1\\OUTFolder\\&...
0 votes
1 answer
112 views
C# StreamWriter with using-block inside a while loop intermittently fails on slow network drive
I have a logging class in which I spawn a Task to append all messages from a BlockingCollection<string> to the log file, sleep two seconds, and repeat infinitely, until the fifo is completed. ...
0 votes
1 answer
130 views
C# Export Logs to 2 txt files
So I have a button made from my xaml file (view), called Export. When the user clicks on it, the logs created during the run of the app get exported to Logs.txt. If there are Warnings, Errors or ...