문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top