Following the problems mentioned in earlier threads, I reinstalled MonoGame using the dev installer and rebuilt my game project using the Universal App template. I’m using VS 2013 Express for Windows.
When I created the .mgcb file I did get the correct icon but it was not automatically associated with the Pipeline.exe tool (I had to set this up myself). Is that normal? But the tool does at least open up the Content project correctly. However I get the following error at build time:
2> Unhandled Exception: System.ArgumentException: Empty path name is not legal.
2> at System.IO.File.ReadAllLines(String path)
2> at MGCB.MGBuildParser.Preprocess(IEnumerable`1 args)
2> at MGCB.MGBuildParser.Parse(IEnumerable`1 args)
2> at MGCB.Program.Main(String[] args)
The command ""C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools\MGCB.exe" /@:"" /platform:WindowsStoreApp /outputDir:"...\Content\bin\WindowsStoreApp" /intermediateDir:"...\Content\obj\WindowsStoreApp" /quiet" exited with code -532462766
I can run the Pipeline.exe tool manually using my .mgcb file, and when I “Build” in that tool, the output files are generated. It seems that MonoGame has not integrated properly into Visual Studio.
Unfortunately even if I build the content in Pipeline.exe, VS still tries to build the content project using MGCB.exe - and when it fails, my project build fails.
As you can see from the runline above, it seems that ContentReferences.RootDir and .Directory are defined, but that ContentReferences.FullPath is not defined in this context. If I hack the .targets file and give it a dummy filename, then MGCB.exe tries to open that file. If I use the filename of my .mgcb file then I believe the tool will build my project.
I don’t know enough about VS build config files to know what to do next. Maybe .FullPath is the wrong child node (I have tried a few random ideas but none of them were defined either), or maybe there is more I should have set up in Visual Studio (some prooperty or something I need to set). My .csproj looks like this:
I was having this problem as well, after copying a solution and targeting a different platform. It seems like it still had links to the old Content.mgcb, so I removed and re-added it, but I think in not quite the same way the MonoGame template does it when it creates the project.
Thanks David, but I do have the cotnent reference in my project in that format. It doesn’t work. There must be something else missing.
Meanwhile I am building my content outside of Visual Studio and "Add as link"ing all the compiled .xnb files individually. Hardly ideal but it has got me going.
I wonder if it’s a problem with VS Express? Can you get a full version of Visual Studio installed? Maybe it’s worth re-creating your solution and starting with a fresh MonoGame project template.
You shouldn’t need to add all your xnb files as links btw… Just put them under the /bin/Content folder, and the contentmanager should point at the correct path.
Any updates? I am having the same issue as @pauliharman:
"C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools\MGCB.exe" /@:"" /platform:Windows /outputDir:"E:\Prog\Visual Studio 2015\Projects\Fractals\Fractals\Content\bin\Windows" /intermediateDir:"E:\Prog\Visual Studio 2015\Projects\Fractals\Fractals\Content\obj\Windows" /quiet
Unhandled Exception: System.ArgumentException: Empty path name is not legal.