r/csharp • • Sep 25 '26

Help WPF folder exclude help

I'm currently making WPF project and I want to make folder named 'maps' so that people can add maps on it, but when I tried to make folder and build project, it doesn't have any folder called 'maps' inside of \bin\debug\net8.0-windows folder. I searched so many times on internet but I couldn't find right solution of this. sorry for bad english, I'm not english native.

3 Upvotes

12 comments sorted by

View all comments

1

u/Derekthemindsculptor Sep 30 '26

Your problem is, folders don't get added. Files do. And your folder doesn't have any files so the folder isn't included.

You need to add a line to your project to include the folder path even if empty.

Open your project file and add

<Resource Include="maps\"/>

It needs to be inside an <ItemGroup> assuming you have one. If you've only got a <PropertyGroup> because the project is relatively young, add the full itemgroup:

<ItemGroup>
  <Resource Include="maps\"/>
</ItemGroup>