Skip to content

Instantly share code, notes, and snippets.

@cartermp
Last active March 15, 2016 18:15
Show Gist options
  • Save cartermp/31cb8c9a8553c4cb71ce to your computer and use it in GitHub Desktop.
Save cartermp/31cb8c9a8553c4cb71ce to your computer and use it in GitHub Desktop.

Plan as of right now

  • Implement a convention for the CLI to treat the targeting package as a replacement root directory for framework assemblies.
    • The compiler would look at this package rather than the standard NuGet ref folder, e.g. ref\net40
    • It would prefer targeting packs already installed by VS so as not to interfere with what VS expects.
    • This will allow us to easily auto-ref assemblies to match the behavior you get with VS.
  • Initially, only English support in the targeting packages. We'll have targeting packages for all supported languages once we figure out a good location story.

Here's what JSON.NET's multitargeting sections in James' project.json file could look like:

{
   ...
    "frameworks": {
        "net45": {
            "Microsoft.TargetingPack.NETFramework.v4.5":"1.0.0",
            "frameworkAssemblies": {
                "System.Data": "",
                "System.Numerics": "",
                "System.Runtime.Serialization": "",
                "System.Xml": "",
                "System.Xml.Linq": ""
            }
       },
       "net40": {
            "Microsoft.TargetingPack.NETFramework.v4.0":"1.0.0",
            "frameworkAssemblies": {
                "System.Data": "",
                "System.Numerics": "",
                "System.Runtime.Serialization": "",
                "System.Xml": "",
                "System.Xml.Linq": ""
            }
       },
       "net35": {
            "Microsoft.TargetingPack.NETFramework.v3.5":"1.0.0",
            "frameworkAssemblies": {
                "System.Core": "",
                "System.Data": "",
                "System.Runtime.Serialization": "",
                "System.Xml": "",
                "System.Xml.Linq": ""
            }
       },
       "net20": {
            "Microsoft.TargetingPack.NETFramework.v2.0":"1.0.0",
            "frameworkAssemblies": {
                "System.Data": "",
                "System.Xml": ""
            }
       },
       ".NETPortable,Version=v4.5,Profile=Profile259": {
            "compilationOptions": {
                "define": [ "PORTABLE" ]
             },
            "Microsoft.TargetingPack.NETPortable.v4.0":"1.0.0"
       },
       ".NETPortable,Version=v4.0,Profile=Profile328": {
            "compilationOptions": {
                "define": [ "PORTABLE40" ]
            },
            "Microsoft.TargetingPack.NETPortable.v4.0":"1.0.0"
       },
       "netstandard1.0":{
            ...
       }
   }
   ...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment