loodakrawa / SpriterDotNet

A pure C# Spriter implementation
zlib License
220 stars 75 forks source link

MonoGame Importer coming up as 'invalid / missing' #97

Closed KamiGrave closed 6 years ago

KamiGrave commented 6 years ago

I've been using SpriterDotNet for MonoGame for a number of weeks now. There's been the occasional problem with it where it's reported as being invalid or missing by the content pipeline tool. Currently, my project's content can't build because of this issue where it states that the SpriterImporter cannot be created. I figured this was something to do with my project and usually moving the DLLs around a bit works, but I've had no luck with that.

Cloned the repo for SpriterDotNet and tried building the example DesktopGL application. Now everything builds fine but the content pipeline is still reporting that the SpriterDotNet importer is 'missing / invalid'. So while it manages to correctly build the XNB files in the example projects, it's still baffling the content tool.

These may be two separate problems, for at least for now I can't get the importer working properly.

Extra details: Running Windows 10 VS2017 Community Monogame 3.7 installed (Previously 3.6, still had the same issue)

loodakrawa commented 6 years ago

Hi,

This seems like a common issue that occasionally happens for no apparent reason. I tried lots of combinations but I don't think you can have a consistent integration of the MonoGame content pipeline as part of the build process. My recommendation (and that's the way I'm doing it for my projects) is to take the asset build process out of the code build process and have it completely separate (i.e. shell script). Then you can just include the pre-built assets with a wildcard include in your project. Someting like:

<ItemGroup>
    <None Include="$(SolutionDir)\Assets\Content\bin\DesktopGL\**\*.*">
      <Link>Content\%(RecursiveDir)%(FileName)%(Extension)</Link>
      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
    </None>
</ItemGroup>

MGCB CLI reference: http://www.monogame.net/documentation/?page=MGCB

I plan to do this in the examples here (for version 2) but that will take a while.

Hope this helps!

KamiGrave commented 6 years ago

Thankfully the content builds so I've not got any real blocking issues, it just reports as being invalid for some reason. I suspected it was to do with versions of MonoGame, what DLLs are installed and the alignment of the stars.