Hey, Visual Studio usually prefixes the resource name with a namespace based on the folder they're into.
So instead of “EmbeddedBinaryFileName”, they may be in NamespaceDummy.EmbeddedBinaryFileName or NamespaceDummy.Resources.EmbeddedBinaryFileName. Make sure you match the original name of the resource. Have a good night! Best, Jb On Mon, Sep 10, 2012 at 6:16 AM, cryogen <[email protected]> wrote: > Hi, > > I want to embed a binary resource (byte[] array) to an existing assembly, so > it can be read by the assembly like this: > > MemoryStream streamSelf = new > MemoryStream(global::NamespaceDummy.Resources.EmbeddedBinaryFileName); > > so I was trying to do: > > EmbeddedResource res = new EmbeddedResource("EmbeddedBinaryFileName", > ManifestResourceAttributes.Public, binaryFile.ToArray()); > assembly.MainModule.Resources.Add(res); > > but after modifications, original assembly can't find this resource. If I > add it manually within Visual Studio and I open it with .NET Reflector I can > see resources has different layout. > > It's 5am and I need some help :) > > > -- > -- > mono-cecil -- -- mono-cecil
