not include images/sounds into a compiled .resource or .dll

A

Art

hi,

i got a big project with a bunch of images and sounds. i organized
them into several resources, which get compiled into a .dll. but there
is a sound-file i want to be able to change after installation. is
there a way to not to include this file (which is included in one of
the resources) into the .dll?

i know i can add the file to the project and open the file and get a
stream, etc ... but i want to have it in the resources (for unified
resource-access), but not compiled into the .dll.

i messed around with the persistence-property. when i switch it to
"linked at compile time" it does nothing different (to my concern)
than when set to "included to .resx".

also the "build action" property of the sound file itself does not
effect the output in any way!

so what are all these options for, and anyone has any suggestions on
this issue?

thanks in advance,
arthur
 
I

Ignacio Machin ( .NET/ C# MVP )

hi,

i got a big project with a bunch of images and sounds. i organized
them into several resources, which get compiled into a .dll. but there
is a sound-file i want to be able to change after installation. is
there a way to not to include this file (which is included in one of
the resources) into the .dll?

i know i can add the file to the project and open the file and get a
stream, etc ... but i want to have it in the resources (for unified
resource-access), but not compiled into the .dll.

You can have unified resource access even with the resouce in the
filesystem. you can do something like

MyResource resourceTofind=GetResourceFromDll( resourceName);
if ( recourceToFind == null )
{
resourceTofind = GetResourceFromFileSystem( resourceName);
if ( resourceTofind == null )
throw new Exception(......
}

MyResource GetResourceFromFileSystem( string resourceName){
if ( !File.Exist( Assembly.GetExecutingAssemblu().Location + "\\" +
resourceName) )
return null
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top