Play WAV Files from Resources in Visual Studio
How to fix the issue of Resources not a Member of the VB Project
Does this sound familiar? When you work inside Visual Studio none of your audio files play back from your Resources folder even though you definitely have uploaded them to your project. Instead, your .NET build infuriatingly fails with the error ‘file not a member of Resources’.
Here is the scenario. You start by creating a new Windows Forms Project in Visual Studio. Since I teach programming in VB.NET to my students, that is the language that I ask them to select for their projects.
There is no Resources folder .and Resources.resx file created in your project, yet. For that to happen, we need to upload an image.
You insert a PictureBox and upload some image for it on the Form and you rebuild the project. The Resources.resx shows up now (you click the ‘Show All Files’ icon at the top of the Solution Explorer). The Resources folder has clearly been created too. So far, so good.
Next, you double-click on the PictureBox that you would like to play a baloon pop sound on the Click event. Great, you need to upload a WAV file into the Resource Explorer.
You then click on the View menu, click Other Windows, and find the Resources Explorer. Next, you click the green ‘+’ symbol to add your audio file.
You can clearly see the pop.wav audio file in your Resources. You are not hallucinating!
This is where the false hope sets in… You try to call the pop.wav from resources and you get the terrifying red underline:
When you build the .NET project (in the latest versions of Visual Studio 2022 and 2026) you now get the following error:
Error BC30456: [your wav file] is not a member of [your project].My.Resources
I have literally spent WEEKS searching for a fix all over the internet without any success. All the troubleshooting suggestion did not help!
Get Aurel Nicolae’s stories in your inbox
Join Medium for free to get updates from this writer.
Sure, you could play the audio file by simply specifying the location of the wav file, like so:
Dim popSoundPath As String = "C:\Users\...\Resources\pop.wav"
My.Computer.Audio.Play(popSoundPath, AudioPlayMode.Background)But that does not include the pop.wav when the .exe file is complied. This would usually raise an error complaining that the file is missing.
One of my student suggested to me: “Sir, you won’t like this, but why don’t you try Copilot?”. I hesitated… The truth is, I am not a fan of AI for a number of reasons which I won’t bore you with… Let’s just say, I am ‘old school’ when it comes to all things programming, maths, etc. No pain, no gain, that’s what I believe.
I took a short moment to think about it. After all the struggle and dissapoinment searching for a solution that worked, it made sense that AI can do research a trillion times faster than my mortal self. The ‘cherry on the cake’ was that Copilot shoud have been trained on all the Microsoft documentation and technical specifications.
I grinned and swallowed my pride and responded, “Okay, I’ll give it a try”.
Based on my previous attempts of using AI, most of Copilot’s suggestions were as expected , terribly useless, to put it mildly. I have tried those suggestions before without any success.
But as I read to the end, I found one tip which never crossed my mind to look at…
Double-click Resource.resx and change the Access Modifier to ‘Public’. The clean and rebuild your project.
As usual, I didn’t think much of it. I just gave it a go and wow… Game changer!
This is not to say that I trust what comes out of Copilot. Far from it! I will always take AI ‘with a pinch of salt’. But this is genuinely, the first useful piece of information that I have ever got from AI.
The access to the resources is set to ‘Friend’ mode by default in the latest versions of Visual Studio. All you really have to do is change it to ‘Public’, and hey presto!
You might need to add the wav file again as Visual Studio somehow loses that link to your previously uploaded file…
Clean and rebuild your Solution. No more errors!
Go back to your Form1 and, lo and behold, no more red underlinning either!
Happy popping! 🎈
In summary, to fix the ‘file not a member of Resources’ error, you need to open Resources.resx file in your project and set the Access Modifier to Public. Clean and rebuild your project, then you should be able to play audio files from your resources. 😎









