[MonoDevelop] How to Embed a Configuration File in an Assembly?

Sanford Armstrong sanfordarmstrong at gmail.com
Sun Aug 19 12:19:32 EDT 2007

On 8/19/07, Jacek Ruzyczka <ruzyczka at versanet.de> wrote:
> Hi,
> Am Samstag, 11. August 2007 17:19 schrieb Marcos Marín:
> > By Ben Motmans:
> > "monodevelop does not generate any code to access resources more easily, so
> > you will have to do it the default .NET way, by calling
> > someAssembly.GetManifestResourceStream
> >
> > an example:
> > http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=75"
> >
> small problem: Where can I find the Assembly class used in this example?

You must create it yourself (Visual Studio would auto-generate it in
each project as needed).

> I also need all this to play a sound, whose WAV (or MP3) file is embedded in
> my assembly. Is there any convenience method in Mono to get this job done
> (the example in
> http://www.mono-project.com/Guide:_Porting_Winforms_Applications looks hard
> to use to me...)?

Look again at the example that uses System.Media.SoundPlayer.  You can
pass in a stream instead of a string.  Probably you can just pass in
the return value of GetManifestResourceStream, or a FileStream that
wraps that.


More information about the Monodevelop-list mailing list