Monogame: netstandard

Created on 2 Jul 2016  路  5Comments  路  Source: MonoGame/MonoGame

With the introduction of netstandard can we expect a move away from the PCL approach, to instead adopt this new paradigm?

Maintenance

Most helpful comment

We should use .NET Standard instead of PCL

All 5 comments

I hadn't heard of netstandard before you mentioned it. Looking it up and reading about it, it makes sense.

We should use .NET Standard instead of PCL

I guess we could do the bait and switch trick with a .NET Standard lib and the good old .NET Framework class libraries we have now? As long as the build target is compatible with the .NET Standard version we're building the library for that should be fine, right?

Of course, we should still port all MG projects to .NET Standard eventually, but I think there were some difficulties left there.

What we need is a tool that does what Piranha does, but that can emit a .NET Standard library. We can probably just extend Piranha to support writing out a .NET Standard project, that shouldn't be too hard.
Though I was thinking it would be cool if we had a tool that can take any number of csproj files and spits out a .NET Standard lib with the intersection of their public API and stubs for implementation. I think it would be a lot easier to process the csproj and source files with the MSBuild.WorkSpaces API than to process the dll's with Mono.Cecil (which is what Piranha does IIRC).
I started a project a week or two ago that kind of had this goal. Right now it just extracts the public API from a .csproj + source files, but the intention was (among other things) to have it replace Piranha.

I have been using Microsoft's GenAPI for several projects:
https://www.nuget.org/packages/Microsoft.DotNet.BuildTools.GenAPI

This generates source code stubs which has the benefit of being more flexible. I also have a small sample repo that you can check out: https://github.com/mattleibow/CreatingPlatformPlugins/tree/master/UsingGeneratedProjects

https://www.nuget.org/packages/MonoGame.Framework.DesktopGL.Core/ could be used as PCL. We don't really need to do anything special to strip it down of the API.

Was this page helpful?
0 / 5 - 0 ratings