Question

Developing with C# on Visual Studio 2012.

Just finished a project which includes sound files that it needs to play on certain moments and when I copy the exe from the release and run it somewhere outside the solution folder it gives me a framework error when the sound file needs to be played.

Was it helpful?

Solution

It sounds like you are including your sound files in your project, but the sound files are simply sitting in your project directory. Try adding them as resources, or set the "Copy Local" property to "copy if newer" in the properties of the sound files in your project. If you absolutely need a single file that you can give to other people, I suggest looking into adding them as a resource, as that will actually bundle them into the exe. However, how you access them from within the code will change slightly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top