I am trying to modify an existing MonoGame project, so that it uses the MonoGame source. I deleted the references to the MonoGame Dlls, added the projects from the MonoGame source to the solution and referenced these in my project. So far so good.
Now I get an error when loading effects: “This MGFX effect is for an older release of MonoGame and needs to be rebuilt.”. Where can I configure that the new Pipeline Tool gets used to build the project’s content?
The easiest way is to install the latest version of MonoGame. Are you using the MonoGameContentReference build action? It just launches the MGCB.exe in your install folder in that case.
I manually changed the mgcb in my project to be openend with the Pipeline Tool from source. But it won’t be used during the build process because MSBuild just uses the one installed, if I understand correctly?
Hmm, I think about just replacing the Pipeline Tool in the installation folder with the Pipeline Tool from source. This way I could keep the old Pipeline Tool and it is easier to switch between MonoGame source and the stable version installed. I tried compiling some effect files which built fine (no warnings, no errors). With the Pipeline Tool from source I get this error at many places: “Unexpected token ‘,’ found. Expected Semicolon”.
I think @Jjagg meant if you’ve set the properties on your mgcb file correctly, if I’m not mistaken…
like so:
That’s what causes the pipeline-tool to be launched when building.
Yes, the Build Action of the mgcb is set to MonoGameContentReference in my project.
I just did this:
Copy the Pipeline Tool files from source, e.g. this file “…\MonoGameSource\MonoGame\Tools\Pipeline\bin\Windows\AnyCPU\Debug\Pipeline.exe” to “C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools”. When I build the project, the mgcb is passed to Pipeline.exe from the latter directory (“C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools”).
As suggested, I could also install the current version of MonoGame. This would override the files in “C:\Program Files (x86)\MSBuild\MonoGame\v3.0\Tools”.
But unfortunately I get an error on the effect files during the build process as mentioned above (they built fine before, with no warnings and no errors).
The Solution builds fine. And with the hint from @Jjagg I could make the project use the Pipeline Tool from the source (just copied the Pipeline Tool to the installation directory of MonoGame as described above).
So now the issue reduced to some effect files not being build with the current version of the Pipeline Tool.
Just found out the GraphicsDeviceManager throws a “Failed to create graphics device!” message, when starting a fresh MonoGame Windows project, with the latest source.
You can’t do that because the Pipeline Tool will use the assemblies in the installation folder, and that will cause inconsistency. At least that’s what I think is happening. Ideally you should be able to point the MonoGameContentReference build action at another executable… Maybe that can be added in, because this issue makes it hard to use develop while stable is installed. I don’t know of an easy way around this.
The inner exception should give you more information. If you have dpi-scaling enabled it might be because of SharpDX gets wrong resolution causing crash on startup · Issue #5040 · MonoGame/MonoGame · GitHub. If that’s the case make sure you have a manifest that makes the game aware of it. You can just add one from the template in Visual Studio or use the one that comes with MG templates here. Then set it as the manifest to be used in your project properties.
You are right, it was due to dpi-scaling… When I set it to 100% I don’t get an error. Tried the app.manifest file you linked to. I added the file to the project and in the project properties I could then select the app.manifest file in a drop down. But it does not work. I stil get the same error.
I copied the whole content from the source directory, where I found the Pipeline Tool. So this should work, if the Piepline Tool does not need files from parent directories?! I think it worked, because I could build nearly all content.
I think maybe it’s a bug in the Pipeline Tool. I tried this:
Create new effect in the Pipeline Tool (source version)
The Pipeline Tool fails to build the effect: “error X3000: syntax error: unexpected token ‘;’” at psoition right after “Texture” in the line with “float4 SampleTexture(in sampler Texture”.
How can I format the code, so that it’s easier to read it?
Yes, I also tried to clean and build. The error is still there.
Yes. The effect template build succeeds.[quote=“Jjagg, post:11, topic:8333”]
You can put triple backticks before and after it
[/quote]
Ok will try this out next time, thank you