MGCB can't find default importer

Can you share the contents of your .config/dotnet-tools.json file that’s in your project folder?

{
“version”: 1,
“isRoot”: true,
“tools”: {
“dotnet-mgcb”: {
“version”: “3.8.1.303”,
“commands”: [
“mgcb”
]
},
“dotnet-mgcb-editor”: {
“version”: “3.8.1.303”,
“commands”: [
“mgcb-editor”
]
},
“dotnet-mgcb-editor-linux”: {
“version”: “3.8.1.303”,
“commands”: [
“mgcb-editor-linux”
]
},
“dotnet-mgcb-editor-windows”: {
“version”: “3.8.1.303”,
“commands”: [
“mgcb-editor-windows”
]
},
“dotnet-mgcb-editor-mac”: {
“version”: “3.8.1.303”,
“commands”: [
“mgcb-editor-mac”
]
}
}
}

hmm this all looks correct.

Can you open the terminal again like I mentioned above and run this command instead

dotnet mgcb ./Content/Content.mgcb

And copy/paste the errors that it shows

…/Content/2d/obj/.mgstats: error: Couldn’t find a default importer for ‘…/Content/2d/obj/.mgstats’

The ellipse is just a replacement for the full directory starting at C:/Users/…

And if it’s a possibility, the directory is in the right spot for the project it’s trying to operate on.

So this is trying to process the .mgstats file, which it shouldn’t be doing.
This is a file that get’s output when content is built that provides stats on how long the content took to import/process/build etc.

Open you Content.mgcb file and remove the block where it references the .mgstats file

Also at the top of the Content.mgcb file in a text editor, unless you needed to change it for some project specific reason, make sure the following defaults are configured for output and intermediate directory

/outputDir:bin/$(Platform)
/intermediateDir:obj/$(Platform)

Edit: Added the “in a text editor” info

1 Like

looks like that fixed it. Thank you for your time!

2 Likes