Search code examples
c#backgroundwin-universal-appbackground-taskbackground-audio

UWP Background Audio fails because RPC server is unavailable


I am implementing the UWP sample for background audio on Github, but with no success. I copy and pasted everything, and while it works in the sample, it doesn't work on my project. Every time the CurrentPlayer object (type is a MediaPlayer), it calls teh existing BackgroundMediaPlayer. But that one always crashes because the RPC server is unavailable. I have no idea what this means or why, because it does work in the sample, even though I copied the code (I even imported the BackgroundAudioTask and BackgroundShared projects without changing any of the code)

I hosted the full code on GitHub, because it might be more useful than my description. I've been stuck on this for months now, so help is much appreciated!


Solution

  • I downloaded and checked your code,everything is proper except you dint add background task reference to your main project

    You need to do add BackgroundPlayer refernce to your mainproject(musictest)