Error writing stream file

1
  

The stream was not writable

You receive this exception when you try to change a file that is in resource . Here is the code:

var assembly = Assembly.GetExecutingAssembly();
        Stream str = assembly.GetManifestResourceStream("PCCLC9875.versao.txt");

        String linha = "versao=" + INICIAL_VERSAO + ";revisao=00;compilacao=00";
        StreamWriter sw = new StreamWriter(str);
        sw.WriteLine(linha);
        sw.Close();
        str.Close();

I can only read, but when trying to change the error.

    
asked by anonymous 07.06.2016 / 22:04

1 answer

2

This stream was made available for reading only, you can not try to save it. The error explicitly says this.

If you want to move the assembly metadata, that's possible, but care must be taken to understand all the implications, which are not few.

Just to start the study on the subject:

07.06.2016 / 22:24