My story stretches from the previous topic :

You need to read the bytes from your own assembly (exe), but because it is executed, access is denied (the file is being used by another process).

var assemblyPath = System.Reflection.Assembly.GetExecutingAssembly().Location; var reader = new BinaryReader(File.Open(assemblyPath, FileMode.Open)); 

How to still read the bytes?

    1 answer 1

    Use the more detailed File.Open option.

     var reader = new BinaryReader( File.Open(assemblyPath, FileMode.Open, FileAccess.Read, FileShare.Read) );