Knowledge.ToString()

Month: December 2019

  • Mailto Invalid URI: The Hostname Could Not be Parsed.

    If the Uri is “mailto”, the Uri format must be in the following format. I encountered following error It was difficult to find the root cause. Finally I found that I used “&subject” (ampersand) for the first parameter instead of “?subject” (question mark). Once I used “?subject”, everything worked as expected.

    |

  • CsvHelper – Cannot write to a closed TextWriter.

    If you are using CsvHelper and get the error “Cannot write to a closed TextWriter”, here is a solution. You are trying to reuse the same underlying stream to write using CsvWriter Instead, you don’t want to close the underlying stream so change your code to “true” parameter will leave the underlying stream open.

    |