1

I'm working on a program, in C#, that uses both a System.IO.BinaryWriter and a System.IO.Streamwriter to create two datafiles.

I know how to retrieve/set the Assembly of my C# program.

What I'd like to do, is embed my C# program's assembly information into the binary datafiles' assembly. That way, an end-user could get the Properties->Details of the datafile(s) and know which version of the C# program created them.

Anyone know of a way to do this?

Thanks.

  • Does this answer your question? [Add new metadata properties to a file](https://stackoverflow.com/questions/19947887/add-new-metadata-properties-to-a-file) – Christian Gollhardt Mar 03 '21 at 19:21
  • Thanks Christian, I'll look into that (never thought to search 'metadata'). – Annalisa Seubert Mar 03 '21 at 20:12
  • Something tricky to get started. I would probably don't do it. Instead write it directly into the file (e.g. via the `BinaryWriter`, the first n bytes are the version). For Explorer you would need an Shell Extension anyway (When you directly embed it in your datafile, you can skip the NTFS part, which is very specifc). But probably you application can just show the version. Executables have some default meta data, but not custom files. – Christian Gollhardt Mar 03 '21 at 22:24
  • yeah - I'm currently writing the data into the file. I wanted to see if there was a way so the end-user could look at the properties to know the version of the SW that created the file. Just researching my options. thanks! – Annalisa Seubert Mar 05 '21 at 16:14

0 Answers0