I am currently trying to take a PCL Monogame Content Importer to handle loading my Json Serialized game objects but what builds fine in code fails in the “build” of the monogame content pipeline tool with the following error -
Importer ‘AnimationEditorImporter’ had unexpected failure!
System.NotImplementedException: This functionality is not implemented in the portable version of this assembly.
You should reference the PCLExt.FileStorage NuGet package from your main application project in order to reference the platform-specific implementation.
at PCLExt.FileStorage.Files.FileFromPath.GetFileFromPath(String path)
at PCLExt.FileStorage.Files.FileFromPath.ctor(String path)
…
I have tried to add a reference to the PCLExt.FileStorage library I am using the “read” in my JSON file in the Monogame Pipeline Tool so I can use Newtonsoft.Json to Deserialize it back into an object when loading but it does not seem to do anything for me.
What am I missing here or is there library or way to read files in a PCL library that are known to work with the Monogame content pipeline?
Here is my very basic Content Importer’s Code.
[ContentImporter(".json", DisplayName = “Json Importer”, DefaultProcessor = “”)]
public class AnimationEditorImporter : ContentImporter
{
public override Actor Import(string filename, ContentImporterContext context)
{
context.Logger.LogMessage(“Importing Actor file: {0}”, filename);
BaseFile file = new FileFromPath(filename);
using (var reader = new StreamReader(file.Open(FileAccess.Read)))
return JsonConvert.DeserializeObject<Actor>(reader.ReadToEnd());
}
}
Basically as soon as file.Open is called the build freaks out saying it is not implemented in the portable version.
Thanks