MGCB don't copy .xnb content files to build folder.

Hello everyone. I got a problem when working with the content manager.
Previously, work with the project was as follows:

  1. Create a project
  2. Add resources to the content manager
  3. Build content manager
  4. Using the added resources.

But now

  1. Create a project
  2. Add resources to the content manager
  3. Build content manager
  4. Using the added resources. And then we get an error that the .xnb file does not exist. The Content folder is not created in the build folder and therefore there are no .xnb files.
    MGCB screen

    Error
    image
    This problem remains even when creating a completely new project. Already reinstalled both the content manager and the extension for the visual studio 2019.

Hi Daniel,

can you please show us the line where load the Content?
I think you have written this

font = contentManager.Load<SpriteFont>("Content/Arial");

but it should be this:

font = contentManager.Load<SpriteFont>("Arial");

because on Gamestart you have this line:

Content.RootDirectory = "Content";

This is how i could replicate your error.

Edit:
i just saw that you have /bin/WindowsStoreApp/ in your path on the screenshot. Perhaps try to set the Content.Root = WindowsStoreApp

Yes, in constructor set Content.Root="Content";
Im load a content like this
FontManager.Register("Arial", Content.Load<SpriteFont>("Arial"));
In build folder dont created a Content folder


But if I create a folder with my own hand and copy the .xnb files there, then everything works.

Can you please check these settings?
grafik

and if you have that package referenced in your Project:
grafik

1 Like