I am pretty new to C#, but not Visual Studio, and I wonder if anyone can tell me how I reference the MonoGame.Framework nuget package from a shared library? The shared library would be used to share code amongst projects targeting different platforms.
That’s excellent! Forgive my ignorance, but what does this look like during deployment? I know that the Content folder will be copied to the target directory, so is the Content of both the app and the shared library put into the same directory? There is no “bundle” concept is there, like with macOS/iOS?
You can also try MonoGame Kickstarter if you like. Using one command it will setup a solution for Visual Studio and setup one or ore projects (windows directx, opengl crossplatform) together with a project for your shared code and content.
You can then add or remove more projects if you like, it just does automates the manual steps for you.
Here is a video of it showing the command and starting the generated MonoGame project (again you can open it with visual studio also etc).
If you need support just let me know. I think it may look complicated but it really is not. Basically you would just download the script (monogame-kickstarter.sh) file. Make it executable. Run it providing only a solution name as parameter. Hit Enter and everything should be in a folder named like the solution name in a short time like you see in the demo video.
To run the script you need either run it in bash (linux) or git bash (windows). On the YouTube channel you find another video with a linux demo too…
Hey sorry to bother you again. I have a skeleton version of my library working with an effect file (.fx) in the shared library Content, and this effect file is being compiled into shared library output folder Content/bin/DesktopGL/Content.
However the main executable is a UWP app with it’s own Content and the shared library Content does not appear in the AppX target directory. I assume I need a post-build step to copy the library Contents over? Have you had this working yourself in the past?
@Synammon I am using 3.8. Weird. I did have to add the MonoGame.Content.Pipeline.Task to the shared library in order for it to process the Content.mgcb in the first place, but after that the directory was appearing the target dir of the shared library, just not in the target dir of the app.
I wonder if I’m missing a reference of some sort from the app to the shared library? All I did to start using the library was to right-click the app project and do Reference > Add.