I’m trying to set up a .NET Core 3 project to use the MonoGame.Extended.Content.Pipeline.
My goal is to import a .tmx file into my game project.
I’m starting my project my using the dotnet new template, outlined here:
http://www.monogameextended.net/posts/getting-started-with-monogame-extended
I initially go to NuGet and added package MonoGame.Extended.Content.Pipeline (3.7.0).
It warns me about .NETFramework versioning issues (NU1701), which I am ignoring for the time being.
Oddly enough adding this to NoWarn doesn’t work - I’ve reported that to Microsoft.
I then open up the Content.mgcb, and go to Content properties > References.
This is my first question - how is it recommended I link this up?
Currently Nuget packages are placed automatically in my user folder, so the location of the DLL I’d normally reference is:
C:\Users[username].nuget\packages\monogame.extended.content.pipeline\3.7.0\lib\netstandard2.0\MonoGame.Extended.Content.Pipeline.dll
This stinks because:
- If I share this code with someone else, this path won’t exist
- If a build this project with a build agent, this path won’t exist
- If I update the NuGet package the path will change at this will break
is there any way I can swap out part of this path with a MSBuild variable or something to make this work?
The only workaround I’ve come up with so far is to copy this DLL into a lib folder, which makes the project sharable but not easily NuGet upgradable.
Ok, so I do a workaround and set the path. This is where the next issue comes up. The MonoGame Pipeline Tool, upon selecting the DLL, gives me this error then crashes:
System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
at System.Reflection.Assembly.GetTypes()
at MonoGame.Tools.Pipeline.PipelineTypes.ResolveAssemblies(IEnumerable`1 assemblyPaths)
at MonoGame.Tools.Pipeline.PipelineTypes.Load(PipelineProject project)
at MonoGame.Tools.Pipeline.PipelineController.ResolveTypes()
at MonoGame.Tools.Pipeline.PipelineController.OnReferencesModified()
at MonoGame.Tools.Pipeline.CellRefs.Edit(PixelLayout control)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at MonoGame.Tools.Pipeline.Program.Main(String[] args)
As a workaround, instead of using the UI I edit the Content.mgcb file by hand. However, this doesn’t seem to work and the ‘Tiled Map Importer - MonoGame.Extended’ and the ‘Tiled Map Processor - MonoGame.Extended’ don’t appear.
Any tips/help on wiring this all up from anyone?