Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6182967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:17:11+00:00 2026-05-24T01:17:11+00:00

In my project I have a DLL for some WPF/XAML controls that need to

  • 0

In my project I have a DLL for some WPF/XAML controls that need to play some audio files. Now, with SoundPlayer I can make these audio files “Embedded Resources” of the DLL (that also contains the WPF controls). However, SoundPlayer has some severe limitation so I switched to MediaPlayer.

Unfortunately, the MediaPlayer help page states that MediaPlayer can’t work with resources. (I tried using Pack URIs anyway but this didn’t work – at least none of the combinations I’ve tried.) So, for now, I’m writing the DLL resources (audio files) to temporary files and then use them with MediaPlayer, but that’s IMHO not a “good” solution.

So, I was wondering if there is a “correct” way in WPF with MediaPlayer to place audio files in a DLL project.

The help page states that the (audio) files should be marked as “Content” and use “Copy to Output Directory” but obviously this only works for file that are part of the EXE project. It doesn’t work for a DLL project.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T01:17:12+00:00Added an answer on May 24, 2026 at 1:17 am

    As you discovered MediaPlayer does not support loading media from resources.

    The simplest option is to distribute the sound files with your application and place them in the application folder – Content/”Copy to Output Directory” does just that.

    If you hit a limitaiton of Visual Studio build system you can just copy the files yourself (drag/drop them into the bin/Debug or bin/Release folser of the exe project) or write a batch file that will copy them and use it as a post-build action.

    Obviously, when you ship the applicaiton to an end user you have to make sure the files are copied correctly.

    If you are writing a DLL to be used by other develpers and you don’t want manual file copying to be part of the developer’s installation process you can always use a registry key that points to the files location (set by the DLL’s installer) – and fall back to the EXE folder if the registry key is missing (so the EXE developer still has to bundle the files with the EXE but doesn’t need to mess with anything during development).

    And, of course, if you must have the DLL as a one file standalone package you are left only with the “extract to temp folder” option you already use.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project that comprises pre-build Dll modules, built some time in the
I have a c# project that calls some functions from a c dll, the
I have some dll files(not custom and not written by me) and I need
I have a .dll that I generated thorugh a C++ project. I have to
I have a large project where we have 2-3 dll projects that are converted
I have a .DLL that i include in my Visual Studio 2008 project. The
i have a project that links with ICSharpCode.SharpZipLib.dll (the dll itself doesn't matter). one
I have a dll-type project that contains MSTest integration tests. On my machine the
I have a Visual Studio 2008 project with some legacy native C++ DLL projects,
I have a .NET 4.0 WPF project. When I open a FileDialog, choose some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.