1
\$\begingroup\$

I want to add reference to an xna content project. Which should be like the content project reference we have in an xna windows game. I am on visual studio 2013. I got the xna extensions to work by following this method. http://jaquadro.com/2013/11/migrating-monogame-projects-to-vs2013-and-windows-8-1/

But i dont see an option to add content reference in visual studio 2013. I searched everywhere and couldnt find an answer. Is this even possible? Or am i running in the wrong direction?

\$\endgroup\$
1
\$\begingroup\$

Normally XNA only works in VS2010, but you've already linked the solution to that problem.

Only certain project types can have content project references. So what you need to do is create an empty "XNA Game Library" project - just for building the content project.

Then either reference that empty project or manually modify the underlying .csproj file (or both) to just get the XNB files that you want.

See also this answer. The command-line MSBuild solution described there may even be able to be made to work without hacking around with Visual Studio.

\$\endgroup\$
  • \$\begingroup\$ i have installed xna 4.0 but i dont see "XNA Game Library" template, and my monogame content project gives me an error when creating the project \$\endgroup\$ – dimitris93 Jan 25 '15 at 16:38
1
\$\begingroup\$

I have the same setup like you.

Considering you have your Monogame Windows Project (or whatever plattform you are targeting) then simply follow:

  1. Add new project

--> MonoGame

--> Monogame Content Project

--> Rename it whatever you like to

Then you can add your content to the content project. Build it (this should create xnb files). Add reference to the content project in your game project. Now you can access your content with the Game.ContentManager.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.