XNA 内容管理器无法加载文件

XNA Content Manager not able to load files

我有一个控制台应用程序,我正在尝试将音乐与之结合。所以我决定使用 XNA Framework 来完成它,因为我知道 唯一能做到这一点。

所以我让 Content Manager RootDirectory 指向我添加的内容项目。我有位于项目中的 mp3 文件,但是,总是抛出异常,说一旦我尝试加载它就找不到它。

有没有办法将我设置 RootDirectory 的目录的内容打印到控制台?

如果问题是我正在使用 Xna,但由于它不是 Xna 项目而无法正常工作,还有哪些其他选择?

好好用'SoundPlayer.Play

The Play method plays the sound using a new thread. If you call Play before the .wav file has been loaded into memory, the .wav file will be loaded before playback starts. You can use the LoadAsync or Load method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a Stream or URL, future calls to playback methods for the SoundPlayer will not need to reload the .wav file until the path for the sound changes.