Emptying bin Folder Using Probing Path
Last updated
Last updated
This document is written for older versions of FlatRedBall (.NET 4.X) and for games which do not include the .NET runtimes. We recommend that you include .NET runtimes in your game to make it easier for people to play your game. Doing so prevents the Probing Path from working.
By default FlatRedBall games are built to a bin folder which contains the game .exe file, referenced .dlls, and content. If you plan on distributing your game as a .zip file, users may be overwhelmed by the number of files after unzipping.
This can be solved using the probing
tag in the app.config file. This guide shows how to use probing
to move your game's files into a data folder. Note for .NET 6 users - if your game targets .NET 6 and you include .dlls for .NET 6 so that the user does not need to install the runtimes, this method will not work.
First, we'll need to decide the name of the sub-folder we want to use for our libraries and data. A common name is data. To add this:
Open your project in Visual Studio
Open the app.config
file.
Add the probing
tag with the folder name as shown in the following snippet
The example above tells the app to look in a data folder for referenced libraries. Note that when picking a folder, you will want to pick one that doesn't already exist in your project's folder structure.
Now that the probing
tag has been added, the game will look in the data folder for any libraries. Note that the game will continue to look in the main folder as well, so you are not required to move the libraries and content into the data folder until you are ready to distribute your game. Once you are ready, you will want to move every file into the data folder except for the main executable and the config file. Make sure to include your game's content folder and any of the files/folders required by MonoGame such as the x86 and x64 folders.
Once the files have been moved, the only remaining files will be the executable, the config file, and the data folder.
At this point there are only two files left in the root folder, but we can further simplify the folder by hiding the config file:
Right-click on the .config file
Select properties
Check the Hidden property
Click OK
Now the config file will be hidden. Note that if your settings are to show hidden files you may still see the file (with a half-transparent icon).