Contentless 4.2.0

dotnet add package Contentless --version 4.2.0
                    
NuGet\Install-Package Contentless -Version 4.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Contentless" Version="4.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Contentless" Version="4.2.0" />
                    
Directory.Packages.props
<PackageReference Include="Contentless" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Contentless --version 4.2.0
                    
#r "nuget: Contentless, 4.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Contentless&version=4.2.0
                    
Install as a Cake Addin
#tool nuget:?package=Contentless&version=4.2.0
                    
Install as a Cake Tool

The Contentless banner

Contentless is tool for MonoGame that automatically handles adding assets to the Content Pipeline project, so you don't have to use their interface to add every content file manually.

How to use

To use Contentless, you first have to add it to your project, either through your NuGet package manager or by adding it to your .csproj file as follows. Keep in mind to update the Version to the most recent one. You can find the package on the NuGet website as well.


<ItemGroup>
    <PackageReference Include="Contentless" Version="VERSION" />
</ItemGroup>

Next, you need to find the reference to your Content.mgcb file in your .csproj file or create one if there isn't already one present. The reference's type should be MonoGameContentReference so that Contentless can identify it correctly. If you're using the MonoGame Content Builder alongside Contentless, this setting should already be applied.


<ItemGroup>
    <MonoGameContentReference Include="Content\Content.mgcb" />
</ItemGroup>

Contentless will now automatically add any content files from your Content directory and subdirectories to your Content.mgcb file if they haven't already been added either manually or by Contentless. No existing items' configurations will be overridden, so you can still use the Content Pipeline tool to modify any settings as well.

Configuring

By default, Contentless doesn't require any configuration and will work for most projects and content types out of the box.

However, if you want to change the way Contentless works, you can use a configuration file. To do so, simply create a file named Contentless.json in the same directory as your Content.mgcb file. You can use the config to change several options:

{
    // The list of files that should be excluded. 
    // Can use simple glob-style patterns including "*" to match any number of any character, and "?" to match any single character.
    // Default: ["obj/*", "bin/*"]
    "exclude": [
        "obj/*",
        "bin/*"
    ],
    // If any files that were skipped without errors should be logged (Files that already have entries or files that were ignored)
    // Default: true
    "logSkipped": true,
    // The list of files that should use a different importer or processor than the one that Contentless automatically determined. 
    // Can use simple glob-style patterns including "*" to match any number of any character, and "?" to match any single character.
    // Default: {}
    "overrides": {
        // Example: Make all files matching ".json" use the importer "JsonImporter"
        "*/*.json": {
            "importer": "JsonImporter"
        },
        // Example: Specifying both an importer and a processor
        "*/*.ogg": {
            "importer": "OggImporter",
            "processor": "SongProcessor"
        },
        // Example: Only specifying a processor
        "*/*.wav": {
            "processor": "SoundEffectProcessor"
        },
        // Example: Setting a file to the Copy build action
        "*/*.txt": {
            "copy": true
        },
        // Example: Adding processor parameters for files
        "TestFile.png": {
            "processorParams": {
                "TextureFormat": "Compressed"
            }
        }
    },
    // A set of content pipeline library references that should optionally be added to the content files. 
    // The paths of these references in the content file are automatically changed if they don't match the project's package references.
    // References already present in the content file, but not included in this list, will still be used for resolving importers and processors, but their paths will not be changed.
    // Default: []
    "references": ["MonoGame.Extended.Content.Pipeline"]
}

For an example of a config in use, see the test config.

What it does

When running Contentless and supplying the location of a MonoGame Content Pipeline project (Content.mgcb), it scans all the files in the project's directory as well as its subdirectories. For each file, it checks if the Content.mgcb file already contains any references to that file. If no references are found, then a new reference to the file is added.

Contentless figures out which importer and processor to register for any given file by generating a list of all the importers and processors that are available, both inside of MonoGame, and inside of References added to the Content.mgcb file. This process is similar to what occurs when adding an existing file through MonoGame's Content Pipeline tool. If Contentless sets the wrong importer or processor for any file, the user can simply open Content.mgcb in MonoGame's Content Pipeline tool and edit it manually.

As Contentless never changes any existing content of a Content.mgcb file, all changes that are made to it by hand or using the Content Pipeline tool will not be overridden.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.2.0 166 5/27/2025
4.1.1 139 5/26/2025
4.1.0 504 5/26/2025
4.0.0 14,892 8/31/2024
3.2.1 629 8/28/2024
3.2.0 6,077 2/4/2024
3.1.3 722 12/22/2023
3.1.2 452 12/21/2023
3.1.1 459 12/21/2023
3.1.0 975 12/21/2023
3.0.7 5,042 9/25/2022
3.0.6 1,285 10/16/2021
3.0.5 1,112 1/27/2021
3.0.4 966 1/27/2021
3.0.3 940 1/27/2021
3.0.2 1,050 10/7/2020
3.0.1 684 10/7/2020
3.0.0 836 6/25/2020
2.0.6 1,064 1/13/2020
2.0.5 916 12/4/2019
2.0.4 891 12/1/2019
2.0.3 822 12/1/2019
2.0.2 817 11/19/2019
2.0.1 1,079 11/7/2019
2.0.0 845 11/7/2019