Reputation: 463
I started days ago programming c# using monogame. Today I got an error that says "Could not load asset as a non-content file". Here's the code, I need much help. List textures;
public Game1()
: base()
{
graphics = new GraphicsDeviceManager(this);
Content.RootDirectory = "Content";
}
protected override void Initialize()
{
base.Initialize();
}
protected override void LoadContent()
{
spriteBatch = new SpriteBatch(GraphicsDevice);
// the below line errors
textures.Add(Content.Load<Texture2D>("Lol"));
}
protected override void UnloadContent()
{
}
protected override void Update(GameTime gameTime)
{
base.Update(gameTime);
}
protected override void Draw(GameTime gameTime)
{
GraphicsDevice.Clear(Color.CornflowerBlue);
base.Draw(gameTime);
}
}
Upvotes: 0
Views: 281
Reputation: 463
SOLVED
P.s. : Everytime you add a file, repeat 3rd and 4th step
Upvotes: 1